From a7f05d35add2ca31ac8cea5d9eb859178da53f53 Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Mon, 14 Mar 2022 10:50:54 +0800 Subject: [PATCH] fix logs --- src/constants/templates.ts | 25 ++++++++++++++++++++++ src/store/modules/log.ts | 4 ++-- src/store/modules/profile.ts | 4 ++-- src/views/dashboard/related/log/Header.vue | 2 +- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/constants/templates.ts b/src/constants/templates.ts index f2c5eee2..9a5388df 100644 --- a/src/constants/templates.ts +++ b/src/constants/templates.ts @@ -332,6 +332,31 @@ export const ServiceLayout = { }, ], }, + { + name: "Topology", + children: [ + { + x: 0, + y: 0, + w: 4, + h: 6, + i: "0", + metrics: [], + metricTypes: [], + type: "Topology", + widget: {}, + graph: { + fontColor: "white", + backgroundColor: "green", + iconTheme: true, + content: "Topology", + fontSize: 18, + showDepth: true, + }, + standard: {}, + }, + ], + }, { name: "Trace", children: [ diff --git a/src/store/modules/log.ts b/src/store/modules/log.ts index f7846d66..ef1e97bc 100644 --- a/src/store/modules/log.ts +++ b/src/store/modules/log.ts @@ -38,7 +38,7 @@ interface LogState { } export const logStore = defineStore({ - id: "trace", + id: "log", state: (): LogState => ({ services: [{ value: "0", label: "All" }], instances: [{ value: "0", label: "All" }], @@ -101,7 +101,7 @@ export const logStore = defineStore({ ] || [{ value: "0", label: "All" }]; return res.data; }, - async queryLogsByKeywords() { + async getLogsByKeywords() { const res: AxiosResponse = await graphql .query("queryLogsByKeywords") .params({}); diff --git a/src/store/modules/profile.ts b/src/store/modules/profile.ts index 1ab55266..ccca3d56 100644 --- a/src/store/modules/profile.ts +++ b/src/store/modules/profile.ts @@ -44,7 +44,7 @@ interface ProfileState { highlightTop: boolean; } -export const traceStore = defineStore({ +export const profileStore = defineStore({ id: "profile", state: (): ProfileState => ({ services: [{ value: "0", label: "All" }], @@ -208,5 +208,5 @@ export const traceStore = defineStore({ }); export function useProfileStore(): any { - return traceStore(store); + return profileStore(store); } diff --git a/src/views/dashboard/related/log/Header.vue b/src/views/dashboard/related/log/Header.vue index 3b6c6d4e..5051aa90 100644 --- a/src/views/dashboard/related/log/Header.vue +++ b/src/views/dashboard/related/log/Header.vue @@ -148,7 +148,7 @@ const state = reactive({ init(); async function init() { - const resp = await logStore.queryLogsByKeywords(); + const resp = await logStore.getLogsByKeywords(); if (resp.errors) { ElMessage.error(resp.errors);