diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue index 332219f2c..dfdd4129e 100644 --- a/nezha-fronted/src/components/page/alert/alertMessage.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -82,6 +82,7 @@ { + this.searchTimeDialog = [bus.computeTimezoneTime(new Date().getTime() - 1 * 30 * 60 * 1000), bus.computeTimezoneTime(new Date().getTime())] this.queryChartDate() }) }) @@ -298,8 +300,8 @@ export default { }, queryChartDate () { const $temp = this - const start = this.searchTime[0] ? this.searchTime[0] : bus.computeTimezoneTime(new Date().getTime() - 1 * 30 * 60 * 1000) - const end = this.searchTime[1] ? this.searchTime[1] : bus.computeTimezoneTime(new Date().getTime()) + const start = this.searchTimeDialog[0] ? this.searchTimeDialog[0] : bus.computeTimezoneTime(new Date().getTime() - 1 * 30 * 60 * 1000) + const end = this.searchTimeDialog[1] ? this.searchTimeDialog[1] : bus.computeTimezoneTime(new Date().getTime()) this.searchTimeDialog = [start, end] const timeDiff = (new Date(end).getTime() - new Date(start).getTime()) / 1000 / (24 * 60 * 60) let step = '15s' @@ -463,7 +465,8 @@ export default { } }) }, - promQueryParamConvert (obj) { + promQueryParamConvert (alert) { + const obj = { ...alert } let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'') + ')' let intoLabels = false obj.labels = JSON.parse(obj.labels)