From 7f8c7330d8732ddced7d654e950637c64903b18e Mon Sep 17 00:00:00 2001 From: wangwenrui Date: Sun, 27 Sep 2020 17:08:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4endpoint=E5=88=97?= =?UTF-8?q?=E8=A1=A8Alerts=E5=88=97=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/bottomBox/tabs/endpointTab.vue | 24 +++++++++++++++++++ .../src/components/page/project/project.vue | 8 +++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/endpointTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/endpointTab.vue index 1ff1a3a4e..350af6402 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/endpointTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/endpointTab.vue @@ -45,6 +45,7 @@ class="nz-table endpoint-table" :height="$tableHeight.noPagination" v-scrollBar:el-table="'large'" + :cell-class-name="messageStyle" ref="endpointTable" style="width: 100%;" @sort-change="tableDataSort" @@ -89,6 +90,15 @@ + {{scope.row[item.prop]}} @@ -189,6 +199,10 @@ label: this.$t("alert.list.state"), prop: 'state', show: true, + },{ + label: this.$t("project.endpoint.alerts"), + prop: 'alerts', + show: true, }, /*{ label: this.$t("project.endpoint.lastUpdate"), @@ -378,6 +392,16 @@ this.$set(this.endpointSearchLabel, "orderBy", orderBy); this.getTableData(); }, + messageStyle(e) { + if (e.column.label == 'Alerts' || e.column.label == this.$t("asset.tableTitle.alerts")) { + if (e.row.alertNum > 0) { + return 'danger'; + } else { + return 'success'; + } + } + return ''; + }, }, watch: { obj: { diff --git a/nezha-fronted/src/components/page/project/project.vue b/nezha-fronted/src/components/page/project/project.vue index bb4d1b3b4..40974fb6c 100644 --- a/nezha-fronted/src/components/page/project/project.vue +++ b/nezha-fronted/src/components/page/project/project.vue @@ -232,10 +232,6 @@ label: this.$t("project.endpoint.port"), prop: 'port', show: true, - },{ - label: this.$t("project.endpoint.alerts"), - prop: 'alerts', - show: true, },{ label: this.$t("overall.type"), prop: 'type', @@ -252,6 +248,10 @@ label: this.$t("alert.list.state"), prop: 'state', show: true, + },{ + label: this.$t("project.endpoint.alerts"), + prop: 'alerts', + show: true, }, // { // label: this.$t("project.endpoint.lastUpdate"),