node.vue
1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<template>
<div>
<Table highlight-row ref="currentRowTable" :columns="columns" :data="logs"></Table>
</div>
</template>
<script>
import {LogService} from '../../js/services/logs';
export default {
data() {
return {
columns: [
{
title: 'topic_name',
key: 'topic_name'
},
{
title: 'topic_id',
key: 'topic_id'
},
{
title: '级别',
key: 'level'
},
{
title: '内容',
key: 'message'
},
{
title: '时间',
key: 'timestamp'
}
],
logs: []
}
},
methods: {
searchLog() {
this.logService.getLogs({limit: 20}).then(res => {
this.logs = res.results;
});
}
},
created() {
this.logService = new LogService();
this.searchLog();
}
}
</script>