From b7bdb210bcbc40b2b9549ecd54304493c4017c92 Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Thu, 17 Jun 2021 18:11:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20NEZ-715=20=E4=BF=AE=E5=A4=8DAlert->Alert?= =?UTF-8?q?=20silence=E9=A1=B5=E9=9D=A2=E4=B8=8B=EF=BC=8Coperation?= =?UTF-8?q?=E4=B8=8B=E5=BE=97expired=E6=8C=89=E9=92=AE=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=98=AF=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/language/cn.js | 3 ++- .../src/components/common/language/en.js | 1 + .../src/components/page/alert/alertSilence.vue | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index 437a8454e..5bc0cb2b5 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -533,7 +533,8 @@ const cn = { }, tip: { confirmDelete: '确认删除吗?', - confirmOvertime: '确定关闭吗?', // Are you sure you want to delete? + confirmExpired: '确认失效吗?', + confirmOvertime: '确定关闭吗?', // Are you sure you want to delete? killTerm: '确认关闭 terminal 吗?', confirmBatchDelete: '确定删除这{0}条数据吗?', assetConfirmDelete: '关联的Endpoint和告警将会被删除,确认删除吗?', diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 97bd7c9bf..93edef8c4 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -540,6 +540,7 @@ const en = { }, tip: { confirmDelete: 'Are you sure you want to delete?', // Are you sure you want to delete? + confirmExpired: 'Are you sure you want to expired?', confirmOvertime: "Are you sure it's off?", killTerm: 'Are you sure you want to kill terminal?', confirmBatchDelete: 'Are you sure to delete these {0} pieces of data', diff --git a/nezha-fronted/src/components/page/alert/alertSilence.vue b/nezha-fronted/src/components/page/alert/alertSilence.vue index 72c8c743d..8e5bd13e3 100644 --- a/nezha-fronted/src/components/page/alert/alertSilence.vue +++ b/nezha-fronted/src/components/page/alert/alertSilence.vue @@ -194,6 +194,23 @@ export default { } }) }, + del (row) { + this.$confirm(this.$t('tip.confirmExpired'), { + confirmButtonText: this.$t('tip.yes'), + cancelButtonText: this.$t('tip.no'), + type: 'warning' + }).then(() => { + this.$delete(this.url + '?ids=' + row.id + '&state=' + this.state).then(response => { + if (response.code === 200) { + this.delFlag = true + this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') }) + this.getTableData() + } else { + this.$message.error(response.msg) + } + }) + }) + }, } }