mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 15:52:57 +00:00
feat: update tabs
This commit is contained in:
parent
bdc9b14f7a
commit
48a37d1093
@ -128,7 +128,7 @@ limitations under the License. -->
|
||||
import type { LayoutConfig } from "@/types/dashboard";
|
||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||
import controls from "./tab";
|
||||
import { dragIgnoreFrom, WidgetType } from "../data";
|
||||
import { dragIgnoreFrom, ListChartTypes, WidgetType } from "../data";
|
||||
import copy from "@/utils/copy";
|
||||
import { useDashboardQueryProcessor } from "@/hooks/useExpressionsProcessor";
|
||||
|
||||
|
@ -95,6 +95,25 @@ limitations under the License. -->
|
||||
}
|
||||
metricsValues.value = (await useDashboardQueryProcessor(configList)) || {};
|
||||
}
|
||||
async function queryTabsMetrics() {
|
||||
const widgets = [];
|
||||
|
||||
for (const item of dashboardStore.currentTabItems) {
|
||||
const isList = ListChartTypes.includes(item.type || "");
|
||||
if (item.type === WidgetType.Widget && !isList) {
|
||||
widgets.push(item);
|
||||
}
|
||||
}
|
||||
const configList = widgets.map((d: LayoutConfig) => ({
|
||||
metrics: d.expressions || [],
|
||||
metricConfig: d.metricConfig || [],
|
||||
id: d.i,
|
||||
}));
|
||||
if (!widgets.length) {
|
||||
return {};
|
||||
}
|
||||
metricsValues.value = (await useDashboardQueryProcessor(configList)) || {};
|
||||
}
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
dashboardStore.setLayout([]);
|
||||
@ -137,6 +156,12 @@ limitations under the License. -->
|
||||
}
|
||||
},
|
||||
);
|
||||
watch(
|
||||
() => dashboardStore.currentTabItems,
|
||||
() => {
|
||||
queryTabsMetrics();
|
||||
},
|
||||
);
|
||||
return {
|
||||
dashboardStore,
|
||||
clickGrid,
|
||||
|
Loading…
Reference in New Issue
Block a user