diff --git a/nezha-fronted/src/components/charts/chart-alert-list.vue b/nezha-fronted/src/components/charts/chart-alert-list.vue
index 92e25e6ad..c87fb324b 100644
--- a/nezha-fronted/src/components/charts/chart-alert-list.vue
+++ b/nezha-fronted/src/components/charts/chart-alert-list.vue
@@ -41,104 +41,16 @@
-
-
-
-
-
-
-
-
-
-
- {{scope.row[item.prop].alertName}}
- -
-
-
- {{scope.row[item.prop]}}
- -
-
-
- {{scope.row[item.prop]}}
- -
-
-
- {{severityData[1].value}}
- {{severityData[0].value}}
- {{severityData[2].value}}
-
-
- {{item.value}}
-
-
-
- {{scope.row['state'] == 1 ? "Pending" : ""}}
- {{scope.row['state'] == 2 ? "Expired" : ""}}
-
-
-
-
-
-
- {{formatThreshold(scope.row.current[1],scope.row.alertRule.unit)}}
- {{$unixTimeParseToString(scope.row.current[0])}}
-
-
-
-
-
-
- {{scope.row[item.prop]}}
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
+ >
@@ -148,100 +60,16 @@
-
-
-
-
-
-
-
-
-
-
- {{scope.row[item.prop].alertName}}
- -
-
-
- {{scope.row[item.prop]}}
- -
-
-
- {{scope.row[item.prop]}}
- -
-
-
- {{severityData[1].value}}
- {{severityData[0].value}}
- {{severityData[2].value}}
-
-
- {{item.value}}
-
-
-
- {{scope.row['state'] == 1 ? "Pending" : ""}}
- {{scope.row['state'] == 2 ? "Expired" : ""}}
-
-
-
-
-
-
- {{scope.row.current[1]}}
- {{$unixTimeParseToString(scope.row.current[0])}}
-
-
-
-
-
-
- {{scope.row[item.prop]}}
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
+ >
@@ -298,6 +126,7 @@ import nzAlertTag from "../page/alert/nzAlertTag";
import axios from "axios";
import pickTime from "../common/pickTime";
import chart from "../page/dashboard/overview/chart";
+import alertMessageTable from '@/components/common/alert/alertMessageTable.vue'
export default {
name: 'chartTable',
components: {
@@ -306,6 +135,7 @@ export default {
'nz-alert-tag':nzAlertTag,
'chart':chart,
'pick-time':pickTime,
+ 'alertMessageTable':alertMessageTable
},
props: {
// 看板id
@@ -505,28 +335,6 @@ export default {
let vm = this;
this.$chartResizeTool.start(vm, this.data, e);
},
- labelsSort:function(obj){
- let buildIn=['asset','endpoint','module','project','datacenter']
- let labels=JSON.parse(JSON.stringify(obj));
- let result=[];
- for(let key of buildIn){
- if(key in labels){
- result.push({label:key,value:labels[key]})
- delete labels[key]
- }
- }
- Object.keys(labels).sort().forEach(key=>{
- result.push({label:key,value:labels[key]})
- })
- return result;
- },
- labelsClassName(row) {
- if (row.column.label == this.$t("alert.list.labels")) {
- return "alert-message-list-labels";
- } else {
- return "";
- }
- },
formatThreshold:function(value,unit){
let unitMethod=chartDataFormat.getUnit(unit)
if(unitMethod&&value){
@@ -574,13 +382,7 @@ export default {
screenDialogClose:function(){
this.screenModal = false
this.deleteBox.ids=[];
- this.$refs.alertListScreenTable.clearSelection();
- },
- toDeleteMessage(obj) {
- if (obj) {
- this.deleteBox.ids = obj.id + "";
- }
- this.deleteBox.show = true;
+ this.$refs.alertListScreenTable.$refs.alertListTable.clearSelection();
},
selectChange(s) {
let ids = [];
@@ -590,8 +392,8 @@ export default {
});
this.deleteBox.ids = ids.join(",");
},
- deleteMessage() {
- this.$put("alert/message", this.deleteBox).then(res => {
+ deleteMessage(deleltebox) {
+ this.$put("alert/message", deleltebox).then(res => {
if (res.code === 200) {
this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")});
this.deleteBox.show = false;
@@ -970,7 +772,7 @@ export default {
this.storedScreanTableData = this.storedTableData
this.screenModal = true;
this.deleteBox.ids=[];
- this.$refs.alertListTable.clearSelection();
+ this.$refs.alertListTable.$refs.alertListTable.clearSelection();
},
// 设置数据, filter区分
setData(chartItem, seriesItem, panelId, filter,area,errorMsg) {
diff --git a/nezha-fronted/src/components/common/alert/alertLabel.vue b/nezha-fronted/src/components/common/alert/alertLabel.vue
index 51ec9dacf..dc2583066 100644
--- a/nezha-fronted/src/components/common/alert/alertLabel.vue
+++ b/nezha-fronted/src/components/common/alert/alertLabel.vue
@@ -1,96 +1,96 @@
-
-
-
ID
-
{{alertLabelData?alertLabelData.id:''}}
+
+
+
ID
+
{{alertLabelData?alertLabelData.id:''}}
-
-
SN
-
{{alertLabelData?alertLabelData.sn:''}}
+
+
SN
+
{{alertLabelData?alertLabelData.sn:''}}
-
-
Host
-
{{alertLabelData?alertLabelData.host:''}}
+
+
Host
+
{{alertLabelData?alertLabelData.host:''}}
-
-
State
-
{{alertLabelData?(alertStateStr(alertLabelData.state)):''}}
+
+
State
+
{{alertLabelData?(alertStateStr(alertLabelData.state)):''}}
-
-
Ping
-
+
+
Ping
+
{{alertLabelData.pingRtt?alertLabelData.pingRtt+'ms':''}}
-
-
Asset Type
-
{{alertLabelData?alertLabelData.assetType:''}}
+
+
Asset Type
+
{{alertLabelData?alertLabelData.assetType:''}}
-
-
Vendor
-
{{alertLabelData?alertLabelData.vendor:''}}
+
+
Vendor
+
{{alertLabelData?alertLabelData.vendor:''}}
-
-
Model
-
{{alertLabelData?alertLabelData.model:''}}
+
+
Model
+
{{alertLabelData?alertLabelData.model:''}}
-
-
PingLastReply
-
{{alertLabelData?alertLabelData.pingLastReply:''}}
+
+
PingLastReply
+
{{alertLabelData?alertLabelData.pingLastReply:''}}
-
-
Alert
-
+
+
Alert
+
{{alertLabelData.alert + alertActiveStr()}}
-
-
DC
-
{{alertLabelData?alertLabelData.dataCenter:''}}
+
+
DC
+
{{alertLabelData?alertLabelData.dataCenter:''}}
-
-
Endpoint
-
{{alertLabelData?alertLabelData.endpoint:''}}
+
+
Endpoint
+
{{alertLabelData?alertLabelData.endpoint:''}}
-
-
Administrator
-
{{alertLabelData?alertLabelData.principal:''}}
+
+
Administrator
+
{{alertLabelData?alertLabelData.principal:''}}
-
-
-
ID
-
{{alertLabelData?alertLabelData.id:''}}
+
+
+
ID
+
{{alertLabelData?alertLabelData.id:''}}
-
-
Name
-
{{alertLabelData?alertLabelData.name:''}}
+
+
Name
+
{{alertLabelData?alertLabelData.name:''}}
-
-
Project
-
{{alertLabelData?alertLabelData.project.name:''}}
+
+
Project
+
{{alertLabelData?alertLabelData.project.name:''}}
-
-
Description
-
{{alertLabelData?(alertLabelData.remark?alertLabelData.remark:'-'):''}}
+
+
Description
+
{{alertLabelData?(alertLabelData.remark?alertLabelData.remark:'-'):''}}
-
-
-
ID
-
{{alertLabelData?alertLabelData.id:''}}
+
+
+
ID
+
{{alertLabelData?alertLabelData.id:''}}
-
-
Name
-
{{alertLabelData?alertLabelData.name:''}}
+
+
Name
+
{{alertLabelData?alertLabelData.name:''}}
-
-
Description
-
{{alertLabelData?(alertLabelData.remark?alertLabelData.remark:'-'):''}}
+
+
Description
+
{{alertLabelData?(alertLabelData.remark?alertLabelData.remark:'-'):''}}
@@ -172,25 +172,25 @@
-
+
+
+
+
+
+
diff --git a/nezha-fronted/src/components/common/alert/alertRuleInfo.vue b/nezha-fronted/src/components/common/alert/alertRuleInfo.vue
index 0f42c26d1..0b34f4bcc 100644
--- a/nezha-fronted/src/components/common/alert/alertRuleInfo.vue
+++ b/nezha-fronted/src/components/common/alert/alertRuleInfo.vue
@@ -1,20 +1,20 @@
-
-
-
ID
-
{{alertRuleData?alertRuleData.id:''}}
+
+
+
ID
+
{{alertRuleData?alertRuleData.id:''}}
-
-
-
+
+
+
-
-
Expression
-
{{alertRuleData?(alertRuleData.expr + alertRuleData.operator + formatThreshold(alertRuleData.threshold,alertRuleData.unit)):''}}
+
+
Expression
+
{{alertRuleData?(alertRuleData.expr + alertRuleData.operator + formatThreshold(alertRuleData.threshold,alertRuleData.unit)):''}}
-
-
Level
-
+
+
Level
+
{{severityData[1].value}}
{{severityData[0].value}}
{{severityData[2].value}}
@@ -26,7 +26,7 @@