Limit log entries to 500. Add comments.
This commit is contained in:
parent
8e20f183b6
commit
b7b105ff3a
10
app.js
10
app.js
|
@ -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', {
|
Vue.component('lt-node-link', {
|
||||||
template: `<a :href='uri' target="_blank">{{ node }}</a>`,
|
template: `<a :href='uri' target="_blank">{{ node }}</a>`,
|
||||||
props: ['node', 'type'],
|
props: ['node', 'type'],
|
||||||
|
@ -75,6 +82,7 @@ let App = new Vue({
|
||||||
axios.get(this.uri + '?cmd=log').then(({data}) => {
|
axios.get(this.uri + '?cmd=log').then(({data}) => {
|
||||||
this.lastData = data;
|
this.lastData = data;
|
||||||
this.parseLogData();
|
this.parseLogData();
|
||||||
|
this.logs = this.logs.slice(0,500);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -91,7 +99,7 @@ let App = new Vue({
|
||||||
parseLogData() {
|
parseLogData() {
|
||||||
let rows = this.lastData.split("\n");
|
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]+))?/);
|
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;
|
if (!match) return;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "ajax-logtail",
|
"name": "ajax-logtail",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"author": "Rob Vella",
|
"author": "Rob Vella KK9ROB <me@robvella.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"moment": "^2.27.0"
|
"moment": "^2.27.0"
|
||||||
|
|
Loading…
Reference in New Issue