From 3882cc2d0cefa68194931100cba6c14d26f1d614 Mon Sep 17 00:00:00 2001 From: Fine Date: Thu, 29 May 2025 15:01:09 +0800 Subject: [PATCH] fix --- src/layout/components/NavBar.vue | 5 +++-- src/store/modules/app.ts | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/layout/components/NavBar.vue b/src/layout/components/NavBar.vue index ba7626da..50a0a218 100644 --- a/src/layout/components/NavBar.vue +++ b/src/layout/components/NavBar.vue @@ -222,8 +222,8 @@ limitations under the License. --> appStore.setDuration(timeFormat(val)); } - function setTTL() { - getMetricsTTL(); + async function setTTL() { + await getMetricsTTL(); getRecordsTTL(); changeDataMode(); } @@ -250,6 +250,7 @@ limitations under the License. --> } const gap = Math.max(day, hour, minute); const dates: Date[] = [new Date(new Date().getTime() - dayToMS(gap + 1)), new Date()]; + appStore.setMaxRange(dates); } diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts index 5cfc40af..58a1d4bf 100644 --- a/src/store/modules/app.ts +++ b/src/store/modules/app.ts @@ -223,12 +223,12 @@ export const appStore = defineStore({ return res.data; }, async queryMetricsTTL() { - const res = await graphql.query("queryMetricsTTL").params({}); - if (res.errors) { - return res; + const response = await graphql.query("queryMetricsTTL").params({}); + if (response.errors) { + return response; } - this.metricsTTL = res.data.getMetricsTTL; - return res.data; + this.metricsTTL = response.data.getMetricsTTL; + return response.data; }, async queryRecordsTTL() { const res = await graphql.query("queryRecordsTTL").params({});