mirror of
https://github.com/ShaYmez/allmon2-last-heard.git
synced 2024-11-23 08:28:38 -05:00
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', {
|
||||
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;
|
||||
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user