@@ -4,6 +4,7 @@ import type { LandscapeMetricConfig } from "@landscape-router/types/api/schemas"
44import { get_metric_config_edit , update_metric_config } from "@/api/sys/config" ;
55
66export const useMetricConfigStore = defineStore ( "metric_config" , ( ) => {
7+ const enabled = ref < boolean > ( true ) ;
78 const rawRetentionMinutes = ref < number | undefined > ( undefined ) ;
89 const rollup1mRetentionDays = ref < number | undefined > ( undefined ) ;
910 const rollup1hRetentionDays = ref < number | undefined > ( undefined ) ;
@@ -21,6 +22,7 @@ export const useMetricConfigStore = defineStore("metric_config", () => {
2122
2223 async function loadMetricConfig ( ) {
2324 const { metric, hash } = await get_metric_config_edit ( ) ;
25+ enabled . value = metric . enable ?? true ;
2426 rawRetentionMinutes . value = metric . raw_retention_minutes ?? undefined ;
2527 rollup1mRetentionDays . value = metric . rollup_1m_retention_days ?? undefined ;
2628 rollup1hRetentionDays . value = metric . rollup_1h_retention_days ?? undefined ;
@@ -41,6 +43,7 @@ export const useMetricConfigStore = defineStore("metric_config", () => {
4143
4244 async function saveMetricConfig ( ) {
4345 const new_metric : LandscapeMetricConfig = {
46+ enable : enabled . value ,
4447 raw_retention_minutes : rawRetentionMinutes . value ,
4548 rollup_1m_retention_days : rollup1mRetentionDays . value ,
4649 rollup_1h_retention_days : rollup1hRetentionDays . value ,
@@ -66,6 +69,7 @@ export const useMetricConfigStore = defineStore("metric_config", () => {
6669 }
6770
6871 return {
72+ enabled,
6973 rawRetentionMinutes,
7074 rollup1mRetentionDays,
7175 rollup1hRetentionDays,
0 commit comments