This is an automated email from the ASF dual-hosted git repository.
qiuxiafan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-booster-ui.git
The following commit(s) were added to refs/heads/main by this push:
new 224e761d Fix initialization dashboards (#424)
224e761d is described below
commit 224e761d70a005a21aa2f4fc4effde57dcfc4a5d
Author: Fine0830 <[email protected]>
AuthorDate: Thu Oct 24 15:49:02 2024 +0800
Fix initialization dashboards (#424)
---
src/views/dashboard/panel/Layout.vue | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/src/views/dashboard/panel/Layout.vue
b/src/views/dashboard/panel/Layout.vue
index a3ae9ce1..bfebc00c 100644
--- a/src/views/dashboard/panel/Layout.vue
+++ b/src/views/dashboard/panel/Layout.vue
@@ -78,15 +78,19 @@ limitations under the License. -->
}
async function queryMetrics() {
const widgets = [];
-
for (const item of dashboardStore.layout) {
- const isList = ListChartTypes.includes(item.type || "");
- if (item.type === WidgetType.Widget && !isList) {
- widgets.push(item);
+ if (item.type === WidgetType.Widget) {
+ if (!ListChartTypes.includes(item.graph?.type || "")) {
+ widgets.push(item);
+ }
}
if (item.type === WidgetType.Tab) {
const index = isNaN(item.activedTabIndex) ? 0 :
item.activedTabIndex;
- widgets.push(...item.children[index].children);
+ widgets.push(
+ ...item.children[index].children.filter(
+ (d: LayoutConfig) => !ListChartTypes.includes(d.graph?.type ||
""),
+ ),
+ );
}
}
const configList = widgets.map((d: LayoutConfig) => ({
@@ -103,7 +107,9 @@ limitations under the License. -->
}
async function queryTabsMetrics() {
const configList = dashboardStore.currentTabItems
- .filter((item: LayoutConfig) => item.type === WidgetType.Widget &&
!ListChartTypes.includes(item.type || ""))
+ .filter(
+ (item: LayoutConfig) => item.type === WidgetType.Widget &&
!ListChartTypes.includes(item.graph?.type || ""),
+ )
.map((d: LayoutConfig) => ({
metrics: d.expressions || [],
metricConfig: d.metricConfig || [],
@@ -151,7 +157,7 @@ limitations under the License. -->
},
);
watch(
- () => appStore.durationTime,
+ () => [appStore.durationTime, dashboardStore.layout],
() => {
if (dashboardStore.entity === EntityType[1].value) {
queryMetrics();