|
@@ -17,7 +17,7 @@
|
|
|
|
|
|
<ul id="loglist">
|
|
|
<li v-for="(item, index) in log.slice().reverse()">
|
|
|
- {{ index }} - {{ item.entry.message }} - {{ ts2txt(item.ts) }}
|
|
|
+ {{ ts2txt(item.ts) }} - {{ item.entry.message }} - <pre>{{ JSON.stringify(item.entry) }}</pre>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
@@ -47,7 +47,7 @@
|
|
|
});
|
|
|
},
|
|
|
ts2txt: function (ts) {
|
|
|
- return moment(ts).format('YYYY-MM-DD [at] hh:mm')
|
|
|
+ return moment(ts).format('YYYY-MM-DD hh:mm ss.SSS ')
|
|
|
},
|
|
|
update: function (event) {
|
|
|
fetch('/log/'+this.lastID, {method: "GET"})
|
|
@@ -59,13 +59,14 @@
|
|
|
console.log(JSON.stringify(myJson));
|
|
|
this.$data.log=this.$data.log.concat(myJson.entries);
|
|
|
this.$data.lastID=myJson.lastID;
|
|
|
+ let len=this.$data.log.length;
|
|
|
+ this.$data.log.splice(0,len-200);
|
|
|
})
|
|
|
.catch(error => {
|
|
|
- this.$data.lastID=0;3
|
|
|
+ this.$data.lastID=0;
|
|
|
this.$data.log=[];
|
|
|
console.log(error)
|
|
|
} );
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
})
|