diff --git a/nezha-fronted/src/components/common/alert/alertLabel.vue b/nezha-fronted/src/components/common/alert/alertLabel.vue index 302004062..010ba5e47 100644 --- a/nezha-fronted/src/components/common/alert/alertLabel.vue +++ b/nezha-fronted/src/components/common/alert/alertLabel.vue @@ -116,6 +116,37 @@
{{alertLabelData && alertLabelData.state ? alertLabelData.state : '--'}}
+ +
+
+
ID
+
{{alertLabelData && alertLabelData.id ? alertLabelData.id : '--'}}
+
+
+
name
+
{{alertLabelData && alertLabelData.name ? alertLabelData.name : '--'}}
+
+
+
Location
+
{{alertLabelData && alertLabelData.location && alertLabelData.location ? alertLabelData.location : '--'}}
+
+
+
Asset num
+
{{alertLabelData && alertLabelData.assetNum && alertLabelData.assetNum ? alertLabelData.assetNum: '--'}}
+
+
+
Alert
+
{{alertLabelData && alertLabelData.alertNum ? alertLabelData.alertNum : '--'}}
+
+
+
State
+
+
+ {{alertLabelData && alertLabelData.state ? alertLabelData.state : '--'}} +
+
+
+ @@ -271,6 +302,16 @@ export default { } }) } + if (this.type === 'datacenter') { + this.$get('dc/' + this.id).then((res) => { + if (res.msg === 'success') { + this.loading = false + this.alertLabelData = res.data + } else { + this.$message.error(res.msg) + } + }) + } }, alertActiveStr () { return this.$t('overall.active') diff --git a/nezha-fronted/src/components/common/alert/alertRuleInfo.vue b/nezha-fronted/src/components/common/alert/alertRuleInfo.vue index 869d94f43..7cabe5ae4 100644 --- a/nezha-fronted/src/components/common/alert/alertRuleInfo.vue +++ b/nezha-fronted/src/components/common/alert/alertRuleInfo.vue @@ -32,6 +32,10 @@ --> +
+
{{$t('alert.config.trbShot')}}
+
+
@@ -58,6 +62,12 @@ export default { computed: { calcPosition () { return function (position) { + if (!position) { + return { + left: '0px', + top: '0px' + } + } const clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight const elHeight = 50 if (position.top + elHeight > clientHeight) { @@ -77,6 +87,13 @@ export default { return function (position) { const clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight const elHeight = 50 + if (!position) { + if (elHeight > clientHeight) { + return 'alert-rule-abs-Up' + } else { + return 'alert-rule-abs' + } + } if (position.top + elHeight > clientHeight) { return 'alert-rule-tip-Up' } else { @@ -93,6 +110,9 @@ export default { } else { return value } + }, + trbShotShow () { + this.$emit('showText') } }, mounted () { @@ -134,6 +154,13 @@ export default { left: 0; transform: translate(-100%, -50%); } + .alert-rule-abs { + background-color: white; + z-index: 3000; + padding: 10px; + border-radius: 4px; + box-shadow: -1px 1px 9px -1px rgba(205,205,205,0.77); + } .alert-rule-tip-Up { position: fixed; background-color: white; @@ -158,6 +185,13 @@ export default { left: 0; transform: translate(-100%, -50%); } + .alert-rule-abs-Up { + background-color: white; + z-index: 3000; + padding: 10px; + border-radius: 4px; + box-shadow: -1px 1px 9px -1px rgba(205,205,205,0.77); + } .alert-rule-info{ border: 1px solid #ebeef5; border-bottom: none; diff --git a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue index c806e62e8..907e376d7 100644 --- a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue @@ -21,7 +21,7 @@ - + - + @@ -216,6 +216,7 @@ size="small" > @@ -86,7 +90,7 @@ - {{$t('alert.config.trbShot')}} + {{$t('overall.delete')}} {{$t('overall.silenceAlert')}} @@ -161,7 +165,7 @@ export default { graphShow: false, chartDatas: [], sameLabels: ['instance', 'module', 'project', 'asset', 'endpoint', 'datacenter'], - exclusiveLabels: ['_id', 'severity'], + exclusiveLabels: ['_id', 'severity', '__name__'], legend: [], searchTime: [new Date().setHours(new Date().getHours() - 1), new Date()], currentMsg: {}, @@ -222,8 +226,12 @@ export default { }, computed: { tagType () { - return () => { - return 'normal' + return (key) => { + if (key == 'asset' || key == 'module' || key == 'project' || key == 'datacenter' || key == 'endpoint') { + return 'normal' + } else { + return 'info' + } } }, tagValue () { @@ -534,6 +542,7 @@ export default { case 'module': case 'endpoint': case 'project': + case 'datacenter': return false default: return true } @@ -557,6 +566,9 @@ export default { if (e) { const dom = e.currentTarget const position = dom.getBoundingClientRect() + if (type === 'datacenter') { + item[type] = item.dc + } this.$set(item[type], 'position', position) } this.$set(item[type], 'loading', loading) @@ -579,7 +591,11 @@ export default { } - +