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"),