This commit is contained in:
Fine 2025-05-29 15:01:09 +08:00
parent 0ca3992840
commit 3882cc2d0c
2 changed files with 8 additions and 7 deletions

View File

@ -222,8 +222,8 @@ limitations under the License. -->
appStore.setDuration(timeFormat(val)); appStore.setDuration(timeFormat(val));
} }
function setTTL() { async function setTTL() {
getMetricsTTL(); await getMetricsTTL();
getRecordsTTL(); getRecordsTTL();
changeDataMode(); changeDataMode();
} }
@ -250,6 +250,7 @@ limitations under the License. -->
} }
const gap = Math.max(day, hour, minute); const gap = Math.max(day, hour, minute);
const dates: Date[] = [new Date(new Date().getTime() - dayToMS(gap + 1)), new Date()]; const dates: Date[] = [new Date(new Date().getTime() - dayToMS(gap + 1)), new Date()];
appStore.setMaxRange(dates); appStore.setMaxRange(dates);
} }

View File

@ -223,12 +223,12 @@ export const appStore = defineStore({
return res.data; return res.data;
}, },
async queryMetricsTTL() { async queryMetricsTTL() {
const res = await graphql.query("queryMetricsTTL").params({}); const response = await graphql.query("queryMetricsTTL").params({});
if (res.errors) { if (response.errors) {
return res; return response;
} }
this.metricsTTL = res.data.getMetricsTTL; this.metricsTTL = response.data.getMetricsTTL;
return res.data; return response.data;
}, },
async queryRecordsTTL() { async queryRecordsTTL() {
const res = await graphql.query("queryRecordsTTL").params({}); const res = await graphql.query("queryRecordsTTL").params({});