From 5b97d381dca08b407db8ea5340ad2ea7ee9bb744 Mon Sep 17 00:00:00 2001 From: zhangzhiqiang Date: Fri, 10 Feb 2023 17:06:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lms/nladmin-ui/src/views/loki/api/loki.js | 4 +- lms/nladmin-ui/src/views/loki/view/index.vue | 46 +++++++++++++++----- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/lms/nladmin-ui/src/views/loki/api/loki.js b/lms/nladmin-ui/src/views/loki/api/loki.js index a1da580e3..b5a309420 100644 --- a/lms/nladmin-ui/src/views/loki/api/loki.js +++ b/lms/nladmin-ui/src/views/loki/api/loki.js @@ -8,9 +8,9 @@ export function getLogData(param) { }) } -export function labelsValues() { +export function labelsValues(type) { return request({ - url: '/api/esLog/labels', + url: '/api/esLog/labels/' + type, method: 'get' }) } diff --git a/lms/nladmin-ui/src/views/loki/view/index.vue b/lms/nladmin-ui/src/views/loki/view/index.vue index 2a7111615..65b239c40 100644 --- a/lms/nladmin-ui/src/views/loki/view/index.vue +++ b/lms/nladmin-ui/src/views/loki/view/index.vue @@ -3,12 +3,27 @@
- + + + + + + @@ -135,16 +150,15 @@
- {{ log.system }} + {{ log.system }} {{ log.thread }} {{ log.logLevel }} {{ log.requestIp }} - {{ log.requestTime }} + {{ log.requestTime }} {{ log.traceId }} {{ log.requestMethod }} -----{{ log.message }}
-
@@ -158,6 +172,7 @@ import logOperation from '@/views/loki/api/loki' let queryParam = { logLevel: null, + system: null, startTime: null, endTime: null, traceId: null, @@ -172,7 +187,9 @@ export default { data() { return { labelsOptions: [], // 所有标签和对应所有值数据 + systemOptions: [], // 所有标签和对应所有值数据 logLevelValue: '', + system: '', timeRange: [], message: '', traceId: '', @@ -243,7 +260,8 @@ export default { } }, created() { - this.initLabelsValues() + this.initLabelsValues('logLevel') + this.initLabelsValues('system') }, methods: { fontType(level) { @@ -258,9 +276,14 @@ export default { } return { 'color': '#a74dc6' } }, - initLabelsValues() { - logOperation.labelsValues().then(res => { - this.labelsOptions = res + initLabelsValues(type) { + logOperation.labelsValues(type).then(res => { + if (type === 'logLevel') { + this.labelsOptions = res + } + if (type === 'system') { + this.systemOptions = res + } }) }, queryData() { @@ -281,6 +304,7 @@ export default { queryParam.traceId = this.traceId queryParam.size = this.size queryParam.page = this.page + queryParam.system = this.system logOperation.getLogData(queryParam).then(res => { this.showEmpty = false