Limit log entries to 500. Add comments.

This commit is contained in:
Rob Vella 2020-07-30 21:39:02 -07:00
parent 8e20f183b6
commit b7b105ff3a
2 changed files with 10 additions and 2 deletions

10
app.js
View File

@ -1,3 +1,10 @@
/**
* WIN System Log Tail / Who's Talking?
*
* @author Rob Vella KK9ROB <me@robvella.com>
* @type {Vue}
*/
Vue.component('lt-node-link', {
template: `<a :href='uri' target="_blank">{{ node }}</a>`,
props: ['node', 'type'],
@ -75,6 +82,7 @@ let App = new Vue({
axios.get(this.uri + '?cmd=log').then(({data}) => {
this.lastData = data;
this.parseLogData();
this.logs = this.logs.slice(0,500);
});
},
@ -91,7 +99,7 @@ let App = new Vue({
parseLogData() {
let rows = this.lastData.split("\n");
rows.forEach(async (v) => {
rows.forEach((v) => {
let match = v.match(/([A-Za-z]+ [0-9]+ [0-9]+\:[0-9]+\:[0-9]+) (rpt|stn)([A-Za-z0-9]+) .*? (?:\[(?:via) ([0-9]+))?/);
if (!match) return;

View File

@ -2,7 +2,7 @@
"name": "ajax-logtail",
"version": "1.0.0",
"main": "app.js",
"author": "Rob Vella",
"author": "Rob Vella KK9ROB <me@robvella.com>",
"license": "MIT",
"dependencies": {
"moment": "^2.27.0"