From 4d758314193b1d6900606c88b6346e61060acf98 Mon Sep 17 00:00:00 2001 From: Fine Date: Thu, 29 May 2025 16:00:19 +0800 Subject: [PATCH] address feedbacks --- src/layout/components/NavBar.vue | 2 +- src/store/modules/settings.ts | 17 +++++++++-------- src/types/events.ts | 8 +++++++- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/layout/components/NavBar.vue b/src/layout/components/NavBar.vue index 50a0a218..274f3912 100644 --- a/src/layout/components/NavBar.vue +++ b/src/layout/components/NavBar.vue @@ -224,7 +224,7 @@ limitations under the License. --> async function setTTL() { await getMetricsTTL(); - getRecordsTTL(); + await getRecordsTTL(); changeDataMode(); } async function getRecordsTTL() { diff --git a/src/store/modules/settings.ts b/src/store/modules/settings.ts index 31722194..a7bfc844 100644 --- a/src/store/modules/settings.ts +++ b/src/store/modules/settings.ts @@ -34,27 +34,28 @@ export const settingsStore = defineStore({ }), actions: { async getClusterNodes() { - const res = await fetchQuery({ + const response = await fetchQuery({ method: "get", path: "ClusterNodes", }); - return res.nodes; + this.clusterNodes = response.nodes; + return response; }, async getConfigTTL() { - const res = await fetchQuery({ + const response = await fetchQuery({ method: "get", path: "ConfigTTL", }); - this.configTTL = res; - return res; + this.configTTL = response; + return response; }, async getDebuggingConfigDump() { - const res = await fetchQuery({ + const response = await fetchQuery({ method: "get", path: "DebuggingConfigDump", }); - this.debuggingConfig = res; - return res; + this.debuggingConfig = response; + return response; }, }, }); diff --git a/src/types/events.ts b/src/types/events.ts index be611039..655d5c03 100644 --- a/src/types/events.ts +++ b/src/types/events.ts @@ -16,11 +16,17 @@ */ import type { Duration } from "./app"; +const enum EventType { + ALL = "", + NORMAL = "Normal", + ERROR = "Error", +} + export type Event = { uuid: string; source: SourceInput; name: string; - type: string; + type: EventType; message: string; parameters: { key: string; value: string }[]; startTime: number | string;