fix viewing dashboard with url

This commit is contained in:
Qiuxia Fan 2022-03-18 10:17:52 +08:00
parent 9dba83643e
commit 3885617b58
2 changed files with 10 additions and 3 deletions

View File

@ -261,7 +261,6 @@ function changeMetrics(
});
return;
}
console.log(arr);
states.metrics[index] = arr[0].value;
const typeOfMetrics = arr[0].type;

View File

@ -101,7 +101,11 @@ export default defineComponent({
const dashboardStore = useDashboardStore();
const selectorStore = useSelectorStore();
if (dashboardStore.entity === EntityType[1].value || props.needQuery) {
if (
dashboardStore.entity === EntityType[1].value ||
props.needQuery ||
!dashboardStore.currentDashboard.id
) {
queryMetrics();
}
@ -154,7 +158,11 @@ export default defineComponent({
}
);
watch(
() => [selectorStore.currentService, selectorStore.currentDestService],
() => [
selectorStore.currentService,
selectorStore.currentDestService,
appStore.durationTime,
],
() => {
if (
dashboardStore.entity === EntityType[0].value ||