diff --git a/src/types/dashboard.d.ts b/src/types/dashboard.d.ts index 6fb6a929..1d11c3c7 100644 --- a/src/types/dashboard.d.ts +++ b/src/types/dashboard.d.ts @@ -23,6 +23,7 @@ export type DashboardItem = { name: string; isDefault: boolean; expressions?: string[]; + expressionsConfig?: MetricConfigOpt[]; }; export interface LayoutConfig { x: number; diff --git a/src/views/dashboard/List.vue b/src/views/dashboard/List.vue index f9489ce0..08ed6695 100644 --- a/src/views/dashboard/List.vue +++ b/src/views/dashboard/List.vue @@ -147,7 +147,22 @@ limitations under the License. --> /> -
{{ t("hierarchyNodeMetrics") }}
+
+ {{ t("hierarchyNodeMetrics") }} + + + + +
@@ -178,6 +193,7 @@ limitations under the License. --> import { EntityType } from "./data"; import { isEmptyObject } from "@/utils/is"; import { WidgetType } from "@/views/dashboard/data"; + import Metrics from "@/views/dashboard/related/topology/config/Metrics.vue"; /*global Nullable*/ const { t } = useI18n(); @@ -207,6 +223,13 @@ limitations under the License. --> currentRow.value.expressions = params; } + function updateSettings(config: any) { + currentRow.value = { + ...currentRow.value, + expressionsConfig: config.hierarchyServicesConfig, + }; + } + function handleEditMQE(row: DashboardItem) { MQEVisible.value = !MQEVisible.value; currentRow.value = row; @@ -218,6 +241,7 @@ limitations under the License. --> for (const d of dashboardStore.dashboards) { if (d.id === currentRow.value.id) { d.expressions = currentRow.value.expressions; + d.expressionsConfig = currentRow.value.expressionsConfig; const key = [d.layer, d.entity, d.name].join("_"); const layout = sessionStorage.getItem(key) || "{}"; const c = { @@ -247,8 +271,9 @@ limitations under the License. --> items.push(d); } dashboardStore.resetDashboards(items); - searchDashboards(1); + searchDashboards(currentPage.value); loading.value = false; + MQEVisible.value = false; } async function importTemplates(event: any) { @@ -467,7 +492,7 @@ limitations under the License. --> items.push(d); } dashboardStore.resetDashboards(items); - searchDashboards(1); + searchDashboards(currentPage.value); loading.value = false; } async function handleTopLevel(row: DashboardItem) { @@ -532,7 +557,7 @@ limitations under the License. --> items.push(d); } dashboardStore.resetDashboards(items); - searchDashboards(1); + searchDashboards(currentPage.value); loading.value = false; } function handleRename(row: DashboardItem) { diff --git a/src/views/dashboard/related/topology/config/Metrics.vue b/src/views/dashboard/related/topology/config/Metrics.vue index eebf2ffc..8f2ddd23 100644 --- a/src/views/dashboard/related/topology/config/Metrics.vue +++ b/src/views/dashboard/related/topology/config/Metrics.vue @@ -15,9 +15,12 @@ limitations under the License. -->