diff --git a/nezha-fronted/src/components/chart/chartDetail.vue b/nezha-fronted/src/components/chart/chartDetail.vue index 913d12668..3f9022e2c 100644 --- a/nezha-fronted/src/components/chart/chartDetail.vue +++ b/nezha-fronted/src/components/chart/chartDetail.vue @@ -68,7 +68,7 @@
-
Alert message (active)
+
{{$t('project.topology.alert')}}({{$t('asset.pingActive')}})
{{$t('overall.result.total')}}
{{chartDetail.alertNum}}
@@ -118,7 +118,7 @@
-
Alert message (active)
+
{{$t('project.topology.alert')}}({{$t('asset.pingActive')}})
{{$t('overall.result.total')}}
{{chartDetail.alertNum}}
diff --git a/nezha-fronted/src/components/chart/chartList.vue b/nezha-fronted/src/components/chart/chartList.vue index 8c3314d4c..1b66aa7bb 100644 --- a/nezha-fronted/src/components/chart/chartList.vue +++ b/nezha-fronted/src/components/chart/chartList.vue @@ -210,6 +210,8 @@ export default { if (!this.isGroup) { this.moveChart() this.onScroll(this.scrollTop) + } else { + bus.$emit('groupChildMove') } }, containerResizedEvent (i, newH, newW, newHPx, newWPx) { @@ -346,6 +348,65 @@ export default { }, refreshPanel () { bus.$emit('refreshPanel') + }, + createChartSuccess (params) { + const arr = this.copyDataList.filter(item => !item.staic) + const charts = [] + let weight = 0 + arr.forEach(item => { + const chart = { + id: item.id, + x: item.x, + y: item.y, + span: item.span, + height: item.height, + groupId: item.groupId, + weight: weight + } + if (!params.groupId && chart.y >= params.y) { + chart.y = chart.y + 1 + } + if (params.id == item.id) { + chart.y = params.y + chart.x = params.x + } + charts.push(chart) + + weight++ + if (item.type === 'group') { + item.children && item.children.forEach(children => { + const childrenChart = { + id: children.id, + x: children.x, + y: children.y, + span: children.span, + height: children.height, + groupId: children.groupId, + weight: weight + } + if (item.id === params.groupId && children.y >= params.y) { + childrenChart.y = childrenChart.y + 1 + } + if (params.id == childrenChart.id) { + childrenChart.y = params.y + childrenChart.x = params.x + } + charts.push(childrenChart) + weight++ + }) + } + }) + const chartParams = { + panelId: this.panelId, + charts: charts + } + if (charts && charts.length) { + this.$put('/visual/panel/chart/weights', chartParams).then(() => { + if (params.cb) { + params.cb() + } + }) + } } }, created () { @@ -355,6 +416,8 @@ export default { this.init() if (!this.isGroup) { bus.$on('groupMove', this.changeGroupHeight) + bus.$on('creat-chart-success', this.createChartSuccess) + bus.$on('groupChildMove', this.moveChart) this.$store.commit('setChartListId', `chartList${this.timestamp}`) window.addEventListener('resize', this.resize) } diff --git a/nezha-fronted/src/components/chart/chartMixin.js b/nezha-fronted/src/components/chart/chartMixin.js index 3e8224aef..181536364 100644 --- a/nezha-fronted/src/components/chart/chartMixin.js +++ b/nezha-fronted/src/components/chart/chartMixin.js @@ -261,7 +261,6 @@ export default { } }, resize () { - console.log('reszie') setTimeout(() => { getChart(this.chartId) && getChart(this.chartId).resize() }, 100) diff --git a/nezha-fronted/src/components/common/alert/alertLabel.vue b/nezha-fronted/src/components/common/alert/alertLabel.vue index 4535d6c48..47cb26f3f 100644 --- a/nezha-fronted/src/components/common/alert/alertLabel.vue +++ b/nezha-fronted/src/components/common/alert/alertLabel.vue @@ -49,7 +49,7 @@
-
Alert message (active)
+
{{$t('project.topology.alert')}}({{$t('asset.pingActive')}})
{{$t('overall.result.total')}}
{{alertLabelData.alertNum}}
@@ -62,7 +62,7 @@
-
Endpoint
+
{{$t('asset.endpoint')}}
  {{alertLabelData && alertLabelData.endpointNum ? alertLabelData.endpointNum : 0}}
@@ -83,7 +83,7 @@
{{alertLabelData && alertLabelData.project && alertLabelData.project.name ?alertLabelData.project.name : '--'}}
-
Endpoint
+
{{$t('asset.endpoint')}}
  {{alertLabelData && alertLabelData.endpointNum ? alertLabelData.endpointNum : 0}}
@@ -100,7 +100,7 @@
-
Alert message (active)
+
{{$t('project.topology.alert')}}({{$t('asset.pingActive')}})
{{$t('overall.result.total')}}
{{alertLabelData.alertNum}}
@@ -152,7 +152,7 @@
-
Alert message (active)
+
{{$t('project.topology.alert')}}({{$t('asset.pingActive')}})
{{$t('overall.result.total')}}
{{alertLabelData.alertNum}}
@@ -202,7 +202,7 @@
-
Alert message (active)
+
{{$t('project.topology.alert')}}({{$t('asset.pingActive')}})
{{$t('overall.result.total')}}
{{alertLabelData.alertNum}}
@@ -276,7 +276,7 @@
-
Alert message (active)
+
{{$t('project.topology.alert')}}({{$t('asset.pingActive')}})
{{$t('overall.result.total')}}
{{alertLabelData.alertNum}}
diff --git a/nezha-fronted/src/components/common/alert/alertLabel2.vue b/nezha-fronted/src/components/common/alert/alertLabel2.vue index ccfe6c6c7..c2f07db24 100644 --- a/nezha-fronted/src/components/common/alert/alertLabel2.vue +++ b/nezha-fronted/src/components/common/alert/alertLabel2.vue @@ -56,7 +56,7 @@
-
Alert message (active)
+
{{$t('project.topology.alert')}}({{$t('asset.pingActive')}})
{{$t('overall.result.total')}}
{{alertLabelData.alertNum}}
@@ -107,7 +107,7 @@
-
Alert message (active)
+
{{$t('project.topology.alert')}}({{$t('asset.pingActive')}})
{{$t('overall.result.total')}}
{{alertLabelData.alertNum}}
@@ -158,7 +158,7 @@
-
Alert message (active)
+
{{$t('project.topology.alert')}}({{$t('asset.pingActive')}})
{{$t('overall.result.total')}}
{{alertLabelData.alertNum}}
@@ -208,7 +208,7 @@
-
Alert message (active)
+
{{$t('project.topology.alert')}}({{$t('asset.pingActive')}})
{{$t('overall.result.total')}}
{{alertLabelData.alertNum}}
@@ -282,7 +282,7 @@
-
Alert message (active)
+
{{$t('project.topology.alert')}}({{$t('asset.pingActive')}})
{{$t('overall.result.total')}}
{{alertLabelData.alertNum}}
diff --git a/nezha-fronted/src/components/common/alert/alertRuleInfo.vue b/nezha-fronted/src/components/common/alert/alertRuleInfo.vue index 8798eaf18..969b345b8 100644 --- a/nezha-fronted/src/components/common/alert/alertRuleInfo.vue +++ b/nezha-fronted/src/components/common/alert/alertRuleInfo.vue @@ -35,7 +35,7 @@
-
Alert message (active)
+
{{$t('project.topology.alert')}}({{$t('asset.pingActive')}})
{{$t('overall.result.total')}}
{{alertRuleData.alertNum}}
diff --git a/nezha-fronted/src/components/common/globalSearch/searchItemInfo.vue b/nezha-fronted/src/components/common/globalSearch/searchItemInfo.vue index 368528f82..68b4ecef5 100644 --- a/nezha-fronted/src/components/common/globalSearch/searchItemInfo.vue +++ b/nezha-fronted/src/components/common/globalSearch/searchItemInfo.vue @@ -66,7 +66,7 @@
-
Alert message (active)
+
{{$t('project.topology.alert')}}({{$t('asset.pingActive')}})
{{$t('overall.result.total')}}
{{getPathContent(item.key)}}
diff --git a/nezha-fronted/src/components/common/project/popData/Info.vue b/nezha-fronted/src/components/common/project/popData/Info.vue index 5796d232b..9778fd64f 100644 --- a/nezha-fronted/src/components/common/project/popData/Info.vue +++ b/nezha-fronted/src/components/common/project/popData/Info.vue @@ -1,7 +1,7 @@