mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-06-17 19:44:08 +00:00
update
This commit is contained in:
parent
96a7133c65
commit
5f68f54c84
@ -379,6 +379,7 @@ limitations under the License. -->
|
|||||||
classObj[`${state.pre}-date-disabled`] =
|
classObj[`${state.pre}-date-disabled`] =
|
||||||
(props.right && (t < start.value || t > maxEnd.value)) ||
|
(props.right && (t < start.value || t > maxEnd.value)) ||
|
||||||
(props.left && t < minStart.value) ||
|
(props.left && t < minStart.value) ||
|
||||||
|
t > maxEnd.value ||
|
||||||
props.disabledDate(time, format);
|
props.disabledDate(time, format);
|
||||||
classObj[`${state.pre}-date-on`] = (props.left && t > start.value) || (props.right && t < end.value);
|
classObj[`${state.pre}-date-on`] = (props.left && t > start.value) || (props.right && t < end.value);
|
||||||
classObj[`${state.pre}-date-selected`] = flag;
|
classObj[`${state.pre}-date-selected`] = flag;
|
||||||
|
@ -141,9 +141,17 @@ limitations under the License. -->
|
|||||||
function changeDataMode() {
|
function changeDataMode() {
|
||||||
appStore.setColdStageMode(coldStage.value);
|
appStore.setColdStageMode(coldStage.value);
|
||||||
if (coldStage.value) {
|
if (coldStage.value) {
|
||||||
// const gap = appStore.duration.end.getTime() - appStore.duration.start.getTime();
|
handleMetricsTTL({
|
||||||
// const dates: Date[] = [new Date(new Date().getTime() - gap), new Date()];
|
minute: appStore.metricsTTL.coldMinute,
|
||||||
// appStore.setDuration(timeFormat(dates));
|
hour: appStore.metricsTTL.coldHour,
|
||||||
|
day: appStore.metricsTTL.coldDay,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
handleMetricsTTL({
|
||||||
|
minute: appStore.metricsTTL.minute,
|
||||||
|
hour: appStore.metricsTTL.hour,
|
||||||
|
day: appStore.metricsTTL.day,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,19 +231,8 @@ limitations under the License. -->
|
|||||||
coldHour: 10,
|
coldHour: 10,
|
||||||
coldDay: 9,
|
coldDay: 9,
|
||||||
};
|
};
|
||||||
if (coldStage.value) {
|
appStore.setMetricsTTL(data);
|
||||||
handleMetricsTTL({
|
changeDataMode();
|
||||||
minute: data.coldMinute,
|
|
||||||
hour: data.coldHour,
|
|
||||||
day: data.coldDay,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
handleMetricsTTL({
|
|
||||||
minute: data.minute,
|
|
||||||
hour: data.hour,
|
|
||||||
day: data.day,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleMetricsTTL(params: { minute: number; hour: number; day: number }) {
|
function handleMetricsTTL(params: { minute: number; hour: number; day: number }) {
|
||||||
|
@ -21,7 +21,7 @@ import type { Duration, DurationTime } from "@/types/app";
|
|||||||
import getLocalTime from "@/utils/localtime";
|
import getLocalTime from "@/utils/localtime";
|
||||||
import dateFormatStep, { dateFormatTime } from "@/utils/dateFormat";
|
import dateFormatStep, { dateFormatTime } from "@/utils/dateFormat";
|
||||||
import { TimeType } from "@/constants/data";
|
import { TimeType } from "@/constants/data";
|
||||||
import type { MenuOptions, SubItem } from "@/types/app";
|
import type { MenuOptions, SubItem, MetricsTTL } from "@/types/app";
|
||||||
import { Themes } from "@/constants/data";
|
import { Themes } from "@/constants/data";
|
||||||
/*global Nullable*/
|
/*global Nullable*/
|
||||||
interface AppState {
|
interface AppState {
|
||||||
@ -39,6 +39,7 @@ interface AppState {
|
|||||||
theme: string;
|
theme: string;
|
||||||
coldStageMode: boolean;
|
coldStageMode: boolean;
|
||||||
maxRange: Date[];
|
maxRange: Date[];
|
||||||
|
metricsTTL: Recordable<MetricsTTL>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const appStore = defineStore({
|
export const appStore = defineStore({
|
||||||
@ -62,6 +63,7 @@ export const appStore = defineStore({
|
|||||||
theme: Themes.Dark,
|
theme: Themes.Dark,
|
||||||
coldStageMode: false,
|
coldStageMode: false,
|
||||||
maxRange: [],
|
maxRange: [],
|
||||||
|
metricsTTL: {},
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
duration(): Duration {
|
duration(): Duration {
|
||||||
@ -129,6 +131,9 @@ export const appStore = defineStore({
|
|||||||
setMaxRange(times: Date[]) {
|
setMaxRange(times: Date[]) {
|
||||||
this.maxRange = times;
|
this.maxRange = times;
|
||||||
},
|
},
|
||||||
|
setMetricsTTL(data: MetricsTTL) {
|
||||||
|
this.metricsTTL = data;
|
||||||
|
},
|
||||||
setTheme(data: string) {
|
setTheme(data: string) {
|
||||||
this.theme = data;
|
this.theme = data;
|
||||||
},
|
},
|
||||||
|
9
src/types/app.d.ts
vendored
9
src/types/app.d.ts
vendored
@ -68,3 +68,12 @@ export interface SubItem {
|
|||||||
descKey: string;
|
descKey: string;
|
||||||
i18nKey: string;
|
i18nKey: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface MetricsTTL {
|
||||||
|
minute: number;
|
||||||
|
hour: number;
|
||||||
|
day: number;
|
||||||
|
coldMinute: number;
|
||||||
|
coldHour: number;
|
||||||
|
coldDay: number;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user