mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-03 07:25:24 +00:00
fix: update
This commit is contained in:
parent
7c94adc8bb
commit
6bfea64a15
@ -54,7 +54,6 @@ limitations under the License. -->
|
|||||||
import { useQueryProcessor, useSourceProcessor, useGetMetricEntity } from "@/hooks/useMetricsProcessor";
|
import { useQueryProcessor, useSourceProcessor, useGetMetricEntity } from "@/hooks/useMetricsProcessor";
|
||||||
import graphs from "./graphs";
|
import graphs from "./graphs";
|
||||||
import { EntityType } from "./data";
|
import { EntityType } from "./data";
|
||||||
import { TimeType } from "@/constants/data";
|
|
||||||
import getLocalTime from "@/utils/localtime";
|
import getLocalTime from "@/utils/localtime";
|
||||||
import timeFormat from "@/utils/timeFormat";
|
import timeFormat from "@/utils/timeFormat";
|
||||||
|
|
||||||
@ -75,22 +74,14 @@ limitations under the License. -->
|
|||||||
const dashboardStore = useDashboardStore();
|
const dashboardStore = useDashboardStore();
|
||||||
const title = computed(() => (config.value.widget && config.value.widget.title) || "");
|
const title = computed(() => (config.value.widget && config.value.widget.title) || "");
|
||||||
const tips = computed(() => (config.value.widget && config.value.widget.tips) || "");
|
const tips = computed(() => (config.value.widget && config.value.widget.tips) || "");
|
||||||
const gap = ref<number>(0);
|
|
||||||
|
|
||||||
init();
|
init();
|
||||||
async function init() {
|
async function init() {
|
||||||
const { auto } = config.value;
|
const { auto } = config.value;
|
||||||
|
|
||||||
if (auto) {
|
if (auto) {
|
||||||
gap.value = Number(auto.value) * 60 * 1000;
|
|
||||||
if (auto.step === TimeType.HOUR_TIME) {
|
|
||||||
gap.value = Number(auto.value) * 60 * 60 * 1000;
|
|
||||||
}
|
|
||||||
if (auto.step === TimeType.DAY_TIME) {
|
|
||||||
gap.value = Number(auto.value) * 60 * 60 * 60 * 1000;
|
|
||||||
}
|
|
||||||
await setDuration();
|
await setDuration();
|
||||||
appStoreWithOut.setReloadTimer(setInterval(setDuration, gap.value));
|
appStoreWithOut.setReloadTimer(setInterval(setDuration, auto));
|
||||||
}
|
}
|
||||||
dashboardStore.setLayer(route.params.layer);
|
dashboardStore.setLayer(route.params.layer);
|
||||||
dashboardStore.setEntity(route.params.entity);
|
dashboardStore.setEntity(route.params.entity);
|
||||||
@ -99,7 +90,7 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
async function setDuration() {
|
async function setDuration() {
|
||||||
const dates: Date[] = [
|
const dates: Date[] = [
|
||||||
getLocalTime(appStoreWithOut.utc, new Date(new Date().getTime() - gap.value)),
|
getLocalTime(appStoreWithOut.utc, new Date(new Date().getTime() - config.value.auto)),
|
||||||
getLocalTime(appStoreWithOut.utc, new Date()),
|
getLocalTime(appStoreWithOut.utc, new Date()),
|
||||||
];
|
];
|
||||||
appStoreWithOut.setDuration(timeFormat(dates));
|
appStoreWithOut.setDuration(timeFormat(dates));
|
||||||
|
@ -52,6 +52,7 @@ limitations under the License. -->
|
|||||||
import router from "@/router";
|
import router from "@/router";
|
||||||
import copy from "@/utils/copy";
|
import copy from "@/utils/copy";
|
||||||
import { RefreshOptions } from "@/views/dashboard/data";
|
import { RefreshOptions } from "@/views/dashboard/data";
|
||||||
|
import { TimeType } from "@/constants/data";
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const appStore = useAppStoreWithOut();
|
const appStore = useAppStoreWithOut();
|
||||||
@ -109,10 +110,13 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
if (auto.value) {
|
if (auto.value) {
|
||||||
const f = RefreshOptions.filter((d: { value: string }) => d.value === freshOpt.value)[0] || {};
|
const f = RefreshOptions.filter((d: { value: string }) => d.value === freshOpt.value)[0] || {};
|
||||||
opt.auto = {
|
opt.auto = Number(auto.value) * 60 * 1000;
|
||||||
value: f.value,
|
if (f.step === TimeType.HOUR_TIME) {
|
||||||
step: f.step,
|
opt.auto = Number(auto.value) * 60 * 60 * 1000;
|
||||||
};
|
}
|
||||||
|
if (f.step === TimeType.DAY_TIME) {
|
||||||
|
opt.auto = Number(auto.value) * 60 * 60 * 60 * 1000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const config = JSON.stringify(opt);
|
const config = JSON.stringify(opt);
|
||||||
const path = `/page/${dashboardStore.layerId}/${
|
const path = `/page/${dashboardStore.layerId}/${
|
||||||
|
Loading…
Reference in New Issue
Block a user