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 @@
-
{{editModule.id ? $t("project.module.editModule") : $t("project.module.createModule")}}
+
{{editModule.id ? $t("project.module.editModule") : $t("project.module.createModule")}}
@@ -10,250 +10,237 @@
-
- - - - - - - - - - - - - - - +
+
+ + + + + + + + + + + + + + + - - - - - - + + + + + + - - -
SNMP settings + + +
SNMP settings
+
+ + + +
{{$t('project.module.walk')}}
+
+ + + + + + + +
+ + + + + + +
+ + + + + + +
{{ $t("overall.endpointTemplate") }} + +
+ {{$t('project.module.tip.defaultEndpointSet')}} +
+ {{$t('project.module.tip.relation')}} +
+ +
- - -
{{$t('project.module.walk')}}
-
- - - - - + + + + + - -
- - - - - - - + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+
- - - - - -
{{ $t("overall.endpointTemplate") }} - -
- {{$t('project.module.tip.defaultEndpointSet')}} -
- {{$t('project.module.tip.relation')}} -
- -
-
-
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - +
+ + {{$t('overall.moreOption')}} + +
- - -
- - {{$t('overall.moreOption')}} - + + +
+
+ + + + = + + + + +
+
+
+ + -
-
- -
-
- - - - = - - - - - - - - - - - - - - - - - -
-
-
- - - -
-
- -
-
- - - - = - - - - + + +
+
+ + + + = + + + + +
-
-
- - - -
- - - - - - - - +
+ + + +
+
+ + + + + + + - - - - + + + + - - - + + + - - - - + + + + - - -
- -
{{configsCopyValue}}
-
- + + +
+ +
{{configsCopyValue}}
+
+ +
diff --git a/nezha-fronted/src/components/common/rightBox/projectBox.vue b/nezha-fronted/src/components/common/rightBox/projectBox.vue index f25f9ab7c..9b9442eec 100644 --- a/nezha-fronted/src/components/common/rightBox/projectBox.vue +++ b/nezha-fronted/src/components/common/rightBox/projectBox.vue @@ -2,23 +2,24 @@
-
{{editProject.id ? $t("project.project.editProject") : $t("overall.createProject")}}
+
{{editProject.id ? $t("project.project.editProject") : $t("overall.createProject")}}
-
-
- - - - - - - - +
+
+ + + + + + + + +
diff --git a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue index d46241f27..cddd27a8c 100644 --- a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue +++ b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue @@ -41,7 +41,7 @@ @mouseenter="alertMessageHover(scope.row.alertRule, true, $event)" @mouseleave="alertMessageHover(scope.row.alertRule, false)" >{{scope.row.alertRule.name}} - +
@@ -162,6 +162,7 @@ export default { searchTime: [new Date().setHours(new Date().getHours() - 1), new Date()], currentMsg: {}, chartUnit: 5, + severityData: [], tableTitle: [ { label: 'ID', @@ -248,7 +249,17 @@ export default { } } }, + mounted () { + this.getSeverityData() + }, methods: { + getSeverityData () { + this.$get('alert/severity', { pageNo: 1, pageSize: -1 }).then(response => { + if (response.code == 200) { + this.severityData = response.data.list + } + }) + }, labelsSort (obj) { const buildIn = ['asset', 'endpoint', 'module', 'project', 'datacenter'] if (typeof obj === 'string') obj = JSON.parse(obj) @@ -457,31 +468,6 @@ export default { }()) } return r - /* let result="(" + obj.alertRule.expr + ")"; - if(obj.labels){ - if(obj.labels.alertname){ - delete obj.labels.alertname; - } - if(obj.labels.severity){ - delete obj.labels.severity; - } - } - if(Object.keys(obj.labels).length>0){ - result+=" and ("+function(){ - let q = "{"; - for (let k in obj.labels) { - q += k; - q += "="; - q += ("'" + obj.labels[k] + "',"); - }; - if (q.length > 1) { - q = q.substring(0, q.length-1); - } - q += "}"; - return q; - }() + ")"; - } - return result; */ }, // asset弹框控制 tabControl (data) { diff --git a/nezha-fronted/src/components/layout/path_navigation/PathNavigation.vue b/nezha-fronted/src/components/layout/path_navigation/PathNavigation.vue deleted file mode 100644 index 7e58f6034..000000000 --- a/nezha-fronted/src/components/layout/path_navigation/PathNavigation.vue +++ /dev/null @@ -1,1098 +0,0 @@ - - -