diff --git a/nezha-fronted/src/components/common/rightBox/alertSilenceBox.vue b/nezha-fronted/src/components/common/rightBox/alertSilenceBox.vue index 2adb2daec..bc942a08a 100644 --- a/nezha-fronted/src/components/common/rightBox/alertSilenceBox.vue +++ b/nezha-fronted/src/components/common/rightBox/alertSilenceBox.vue @@ -225,6 +225,8 @@ export default { } const params = { ...this.editAlertSilence, matchers: JSON.stringify(this.editAlertSilence.matchers) } if (valid) { + params.startAt = bus.timeFormate(new Date(this.timezoneToUtcTime(params.startAt))) + params.endAt = bus.timeFormate(new Date(this.timezoneToUtcTime(params.endAt))) if (this.editAlertSilence.id) { this.$put('/alert/silence', params).then(response => { this.prevent_opt.save = false diff --git a/nezha-fronted/src/components/common/table/alert/alertSilenceTable.vue b/nezha-fronted/src/components/common/table/alert/alertSilenceTable.vue index f488e46c2..aedddca24 100644 --- a/nezha-fronted/src/components/common/table/alert/alertSilenceTable.vue +++ b/nezha-fronted/src/components/common/table/alert/alertSilenceTable.vue @@ -38,7 +38,7 @@
{{$t('config.terminallog.endTime')}}
- {{scope.row.endAt}} + {{utcTimeToTimezoneStr(scope.row.endAt)}}
{{getDuration(scope.row)}}
@@ -76,6 +76,9 @@ + {{scope.row[item.prop] || '-'}} diff --git a/nezha-fronted/src/components/page/alert/alertSilence.vue b/nezha-fronted/src/components/page/alert/alertSilence.vue index 6b1a4b638..ec3fddeb8 100644 --- a/nezha-fronted/src/components/page/alert/alertSilence.vue +++ b/nezha-fronted/src/components/page/alert/alertSilence.vue @@ -147,6 +147,34 @@ export default { this.importBox.show = false this.deleteBox.show = false }, + getTableData (params) { + if (params && Object.keys(params).length > 0) { + for (const key in params) { + this.$set(this.searchLabel, key, params[key]) + } + } + this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) + this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) + this.tools.loading = true + this.$get(this.url, { ...this.searchLabel, ...this.searchCheckBox }).then(response => { + this.tools.loading = false + if (response.code === 200) { + for (let i = 0; i < response.data.list.length; i++) { + response.data.list[i].status = response.data.list[i].status + '' + // response.data.list[i].startAt = bus.UTCTimeToConfigTimezone(response.data.list[i].startAt) + // response.data.list[i].endAt = bus.UTCTimeToConfigTimezone(response.data.list[i].endAt) + } + this.tableData = response.data.list + this.pageObj.total = response.data.total + if (!this.scrollbarWrap) { + this.$nextTick(() => { + this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper + this.toTopBtnHandler(this.scrollbarWrap) + }) + } + } + }) + }, add () { this.blackObject.startAt = bus.timeFormate(bus.getOffsetTimezoneData(), 'yyyy-MM-dd hh:mm:ss') this.blackObject.endAt = bus.timeFormate(bus.getOffsetTimezoneData(1), 'yyyy-MM-dd hh:mm:ss') @@ -158,7 +186,9 @@ export default { if (response.code === 200) { this.object = { ...response.data, - matchers: JSON.parse(response.data.matchers) + matchers: JSON.parse(response.data.matchers), + startAt: bus.UTCTimeToConfigTimezone(response.data.startAt), + endAt: bus.UTCTimeToConfigTimezone(response.data.endAt) } this.rightBox.show = true }