diff --git a/nezha-fronted/src/assets/css/common.scss b/nezha-fronted/src/assets/css/common.scss
index b66e76bf4..2bd0c8f84 100644
--- a/nezha-fronted/src/assets/css/common.scss
+++ b/nezha-fronted/src/assets/css/common.scss
@@ -73,6 +73,9 @@
.green-bg {
background-color:$--color-success !important;
}
+.yellow-bg {
+ background-color:$--color-silence !important;
+}
.gray-bg {
background-color: $--color-suspended !important;
}
diff --git a/nezha-fronted/src/assets/css/components/common/table/alert/alertMessageTable.scss b/nezha-fronted/src/assets/css/components/common/table/alert/alertMessageTable.scss
index e79e19333..5c380bfa0 100644
--- a/nezha-fronted/src/assets/css/components/common/table/alert/alertMessageTable.scss
+++ b/nezha-fronted/src/assets/css/components/common/table/alert/alertMessageTable.scss
@@ -101,3 +101,8 @@
.nz-message .el-textarea textarea{
height: 108px !important;
}
+.alert-message-state{
+ padding: 3px 5px;
+ border-radius: 4px;
+ color: $--color-text-primary;
+}
diff --git a/nezha-fronted/src/assets/css/themes/theme-dark.scss b/nezha-fronted/src/assets/css/themes/theme-dark.scss
index 95bdc1a69..11ef03a7e 100644
--- a/nezha-fronted/src/assets/css/themes/theme-dark.scss
+++ b/nezha-fronted/src/assets/css/themes/theme-dark.scss
@@ -69,6 +69,8 @@ $--color-info: #999998;
$--color-suspended: #9e9c98;
// 监控色
$--color-monitor: #98AEC5;
+// silence
+$--color-silence: #FFC107;
/* 6.table */
// 表头字色
diff --git a/nezha-fronted/src/assets/css/themes/theme-light.scss b/nezha-fronted/src/assets/css/themes/theme-light.scss
index 413cd8ff3..8ceb5e38a 100644
--- a/nezha-fronted/src/assets/css/themes/theme-light.scss
+++ b/nezha-fronted/src/assets/css/themes/theme-light.scss
@@ -69,6 +69,8 @@ $--color-info: #999998;
$--color-suspended: #9e9c98;
// 监控色
$--color-monitor: #98AEC5;
+// sliences
+$--color-silence: #FFC107;
/* 6.table */
// 表头字色
diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue
index 611c9ea88..ecfedb583 100644
--- a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue
+++ b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue
@@ -19,7 +19,7 @@
-
+
1) {
this.$set(this.searchLabel, 'startAt', this.timezoneToUtcTimeStr(this.searchTimeHeader[0]))
this.$set(this.searchLabel, 'endAt', this.timezoneToUtcTimeStr(this.searchTimeHeader[1]))
@@ -305,10 +309,10 @@ export default {
delete this.searchLabel.endAt
}
this.tools.loading = true
- if (state) {
- delete this.searchLabel.startAt
- delete this.searchLabel.endAt
- }
+ // if (state) {
+ // delete this.searchLabel.startAt
+ // delete this.searchLabel.endAt
+ // }
if (this.from === fromRoute.module) {
this.searchLabel.moduleIds = this.obj.id
} else if (this.from === fromRoute.endpoint) {
@@ -401,6 +405,15 @@ export default {
this.currentMsg = { ...row, alertRule: { ...res.data } }
this.$nextTick(() => {
this.searchTime = [bus.computeTimezoneTime(new Date().getTime() - 1 * 60 * 60 * 1000), bus.computeTimezoneTime(new Date().getTime())]
+ this.$store.dispatch('dispatchPanelTime', {
+ time: this.searchTime ,
+ nowTimeType: {
+ id: 4,
+ text: this.$t('dashboard.panel.lastOneHour'),
+ type: 'hour',
+ value: 1
+ }
+ })
this.queryDate()
})
})
diff --git a/nezha-fronted/src/components/common/js/constants.js b/nezha-fronted/src/components/common/js/constants.js
index 7538d06fc..7601557a2 100644
--- a/nezha-fronted/src/components/common/js/constants.js
+++ b/nezha-fronted/src/components/common/js/constants.js
@@ -202,6 +202,7 @@ export const alertMessage = {
{ value: 'P3', label: i18n.t('alert.config.P3') }
],
states: [
+ { value: '', label: i18n.t('overall.all') },
{ value: '1', label: i18n.t('overall.active') },
{ value: '2', label: i18n.t('overall.silence') },
{ value: '3', label: i18n.t('alert.list.expired') }
diff --git a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue
index 14ba44e12..a95329d85 100644
--- a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue
+++ b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue
@@ -83,10 +83,11 @@
-
- {{scope.row['state'] == 1 ? "Pending" : ""}}
- {{scope.row['state'] == 2 ? "Expired" : ""}}
-
+
+
+ {{$t(stateOptions.find(state=>state.value == scope.row['state']).label)}}
+
+
{{scope.row[item.prop]}}
-
@@ -141,6 +142,7 @@ import chartDataFormat from '../../../charts/chartDataFormat'
import alertRuleInfo from '../../alert/alertRuleInfo'
import alertLabel from '../../alert/alertLabel'
import { calcDurationByStringTimeB } from '../../js/tools'
+import {alertMessage as alertMessageConstant} from "@/components/common/js/constants";
export default {
name: 'alertMessageTable',
components: {
@@ -166,7 +168,7 @@ export default {
/* 二级列表相关 */
tabList: [], // 二级列表的标签
tabDetailList: [], // 多个详情
-
+ stateOptions: alertMessageConstant.states,
// 详情相关
graphShow: false,
chartDatas: [],
@@ -178,6 +180,7 @@ export default {
chartUnit: 5,
severityData: [],
tableTitle: [
+
{
label: 'ID',
prop: 'id',
@@ -213,6 +216,12 @@ export default {
prop: 'description',
show: true,
minWidth: 200
+ }, {
+ label: this.$t('alert.list.state'),
+ prop: 'state',
+ show: true,
+ width: 100,
+ sortable: 'custom'
}, {
label: this.$t('alert.startAt'),
prop: 'startAt',
diff --git a/nezha-fronted/src/components/common/timePicker.vue b/nezha-fronted/src/components/common/timePicker.vue
index 15a2c5ee3..88d10e969 100644
--- a/nezha-fronted/src/components/common/timePicker.vue
+++ b/nezha-fronted/src/components/common/timePicker.vue
@@ -305,6 +305,7 @@ export default {
const showTime = this.timeData.find(item => item.id == n)
if (showTime) {
this.showTime = Object.assign({}, showTime)
+ this.searchTime = this.$parent.searchTime
}
if (this.showEmpty && this.defaultPick === 12) {
this.searchTime = []
diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue
index 216719baa..d8c8165e8 100644
--- a/nezha-fronted/src/components/page/alert/alertMessage.vue
+++ b/nezha-fronted/src/components/page/alert/alertMessage.vue
@@ -18,7 +18,7 @@
-
+