From 13b0454d0041a8bccf63d74893218d941cc07bf4 Mon Sep 17 00:00:00 2001
From: chenjinsong <523037378@qq.com>
Date: Fri, 21 May 2021 19:28:50 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dalertmsg=E7=9A=84rule?=
=?UTF-8?q?=E5=BC=B9=E6=A1=86=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/common/alert/alertRuleInfo.vue | 59 +-
.../components/common/rightBox/moduleBox.vue | 447 ++++---
.../components/common/rightBox/projectBox.vue | 23 +-
.../common/table/alert/alertMessageTable.vue | 38 +-
.../layout/path_navigation/PathNavigation.vue | 1098 -----------------
5 files changed, 266 insertions(+), 1399 deletions(-)
delete mode 100644 nezha-fronted/src/components/layout/path_navigation/PathNavigation.vue
diff --git a/nezha-fronted/src/components/common/alert/alertRuleInfo.vue b/nezha-fronted/src/components/common/alert/alertRuleInfo.vue
index cfe028520..869d94f43 100644
--- a/nezha-fronted/src/components/common/alert/alertRuleInfo.vue
+++ b/nezha-fronted/src/components/common/alert/alertRuleInfo.vue
@@ -3,19 +3,24 @@
ID
-
{{alertRuleData?alertRuleData.id:''}}
-
-
-
-
-
-
-
Expression
-
{{alertRuleData?(alertRuleData.expr + alertRuleData.operator + formatThreshold(alertRuleData.threshold,alertRuleData.unit)):''}}
+
{{alertRuleData.id ? alertRuleData.id : ''}}
-
Level
-
+
{{$t('alert.alertName')}}
+
{{alertRuleData.name ? alertRuleData.name : ''}}
+
+
+
{{$t('alert.config.expr')}}
+
{{alertRuleData.expr ? (alertRuleData.expr + alertRuleData.operator + formatThreshold(alertRuleData.threshold,alertRuleData.unit)) : ''}}
+
+
+
{{$t('alert.config.threshold')}}
+
{{alertRuleData.threshold ? alertRuleData.threshold : ''}}
+
+
+
{{$t('alert.severity')}}
+
{{alertRuleData.severityId ? severityData.find(s => alertRuleData.severityId === s.id).name : ''}}
+
@@ -38,23 +43,9 @@ export default {
props: {
id: {},
messageLoad: {},
- that: {}
+ that: {},
+ severityData: Array
},
- /* watch:{
- messageLoad:{
- handler:function(){
- this.$get('/alert/rule?id='+this.id).then((res)=>{
- if(res.msg==='success'){
- this.loading=false;
- this.alertRuleData=res.data.list[0];
- } else{
- this.$message.error(res.msg);
- }
- })
- },
- deep:true
- }
- }, */
data () {
return {
loading: true,
@@ -72,12 +63,12 @@ export default {
if (position.top + elHeight > clientHeight) {
return {
left: `${position.left + position.width + 20}px`,
- top: `${position.top - elHeight - 20}px`
+ top: `${position.top - elHeight - 80}px`
}
} else {
return {
left: `${position.left + position.width + 20}px`,
- top: `${position.top - 20}px`
+ top: `${position.top - 80}px`
}
}
}
@@ -105,10 +96,10 @@ export default {
}
},
mounted () {
- this.$get('/alert/rule?id=' + this.id).then((res) => {
+ this.$get('/alert/rule/' + this.id).then((res) => {
if (res.msg === 'success') {
this.loading = false
- this.alertRuleData = res.data.list[0]
+ this.alertRuleData = res.data
} else {
this.$message.error(res.msg)
}
@@ -139,7 +130,7 @@ export default {
border-style: dashed solid dashed dashed;
border-color: transparent #fff transparent transparent;
position: absolute;
- top: 20px;
+ top: 100px;
left: 0;
transform: translate(-100%, -50%);
}
@@ -163,7 +154,7 @@ export default {
border-style: dashed solid dashed dashed;
border-color: transparent #fff transparent transparent;
position: absolute;
- bottom: 20px;
+ bottom: 95px;
left: 0;
transform: translate(-100%, -50%);
}
diff --git a/nezha-fronted/src/components/common/rightBox/moduleBox.vue b/nezha-fronted/src/components/common/rightBox/moduleBox.vue
index 6e56aee86..00e1a6758 100644
--- a/nezha-fronted/src/components/common/rightBox/moduleBox.vue
+++ b/nezha-fronted/src/components/common/rightBox/moduleBox.vue
@@ -2,7 +2,7 @@