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));
}
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);
}

View File

@ -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({});