From 45289532a6c6f92beb4c94d5e197cd84a3dee991 Mon Sep 17 00:00:00 2001
From: Svamei <41992090+Svamei@users.noreply.github.com>
Date: Sat, 1 Apr 2023 13:11:47 +0800
Subject: [PATCH] Complete the text translation of the 'Notify Alarm' page
(#1142)
---
hippo4j-ui/src/locale/lang/en.js | 21 ++-
hippo4j-ui/src/locale/lang/zh.js | 21 ++-
hippo4j-ui/src/views/hippo4j/notify/index.vue | 121 +++++++++---------
3 files changed, 97 insertions(+), 66 deletions(-)
diff --git a/hippo4j-ui/src/locale/lang/en.js b/hippo4j-ui/src/locale/lang/en.js
index 47aa5147..cefc21c1 100644
--- a/hippo4j-ui/src/locale/lang/en.js
+++ b/hippo4j-ui/src/locale/lang/en.js
@@ -21,7 +21,8 @@ export default {
queryFailure: 'The query fails. Please refresh the page',
updateFailure:'Failed to modify thread pool',
auditApprovedMessage: 'This operation will accept thread pool change requests. Do you want to continue?',
- auditRejectionMessage: 'This operation will reject the thread pool change request. Do you want to continue?'
+ auditRejectionMessage: 'This operation will reject the thread pool change request. Do you want to continue?',
+ inputMessage: 'Please input {target}',
},
// 公共
@@ -168,5 +169,21 @@ export default {
threadPoolInstance: 'ThreadPool Instance',
containerThreadPool: 'Container ThreadPool',
frameworkThreadPool: 'Framework ThreadPool',
- }
+ },
+
+ //通知报警
+ notifyAlarm: {
+ platform: 'Platform',
+ type: 'Type',
+ enabled: 'Enabled',
+ interval: 'Interval',
+ receiver: 'Receiver',
+ enabling: 'Enabling',
+ disabling: 'Disabling',
+ token: 'Token',
+ receiverTip: 'Use English commas for multiple recipients and separate them (be careful not to have spaces)\n' +
+ '-Ding: Fill in the phone number\n' +
+ '-WeChat: Fill in \'userid\' and it will be sent to the user as a @ message, otherwise fill in the name, such as: XiaomaGe\n' +
+ '-Lark: Fill in with \'ou_\' the unique user ID at the beginning will be sent to the user as a @ message, and filling in the phone number is normal@'
+ },
}
diff --git a/hippo4j-ui/src/locale/lang/zh.js b/hippo4j-ui/src/locale/lang/zh.js
index d2a5c331..b1220121 100644
--- a/hippo4j-ui/src/locale/lang/zh.js
+++ b/hippo4j-ui/src/locale/lang/zh.js
@@ -21,7 +21,8 @@ export default {
queryFailure: '查询失败,请尝试刷新页面',
updateFailure:'修改线程池失败',
auditApprovedMessage: '此操作将接受线程池变更申请, 是否继续?',
- auditRejectionMessage: '此操作将拒绝线程池变更申请, 是否继续?'
+ auditRejectionMessage: '此操作将拒绝线程池变更申请, 是否继续?',
+ inputMessage: '请输入{target}',
},
// 公共
@@ -168,5 +169,21 @@ export default {
threadPoolInstance: '线程池实例',
containerThreadPool: '容器线程池',
frameworkThreadPool: '框架线程池',
- }
+ },
+
+ //通知报警
+ notifyAlarm: {
+ platform: '通知平台',
+ type: '通知类型',
+ enabled: '是否启用',
+ interval: '通知间隔',
+ receiver: '接收者',
+ enabling: '启用',
+ disabling: '禁用',
+ token: 'Token',
+ receiverTip: '多个接收者使用英文逗号 , 分割 (注意不要有空格)\n' +
+ '- 钉钉:填写手机号\n' +
+ '- 企微:填写user_id会以@的消息发给用户,否则填写姓名,如:小马哥\n' +
+ '- 飞书:填写ou_开头用户唯一标识会以@的消息发给用户,填写手机号则是普通的@"'
+ },
}
diff --git a/hippo4j-ui/src/views/hippo4j/notify/index.vue b/hippo4j-ui/src/views/hippo4j/notify/index.vue
index 12eb972c..8ceb3a60 100755
--- a/hippo4j-ui/src/views/hippo4j/notify/index.vue
+++ b/hippo4j-ui/src/views/hippo4j/notify/index.vue
@@ -3,7 +3,7 @@
- 搜索
+ {{ $t('common.query') }}
- 添加
+ {{ $t('common.insert') }}
-
+
{{ scope.$index + 1 }}
-
+
{{ scope.row.tenantId }}
-
+
{{ scope.row.itemId }}
-
+
{{ scope.row.tpId }}
-
+
{{ scope.row.platform }}
-
+
{{ scope.row.type }}
-
+
-
+
{{ scope.row.interval | intervals }}
-
+
{{ scope.row.receives | ellipsis }}
-
+
{{ scope.row.gmtCreate }}
-
+
{{ scope.row.gmtModified }}
- 编辑
+ {{$t('common.edit')}}
- 删除
+ {{$t('common.delete')}}
@@ -157,10 +157,10 @@
:model="temp"
label-width="80px"
>
-
+
-
+
-
+
@@ -205,7 +205,7 @@
-
+
@@ -216,18 +216,18 @@
-
+
- 启用
- 停用
+ {{ $t('notifyAlarm.enabling') }}
+ {{ $t('notifyAlarm.disabling') }}
-
+
@@ -248,10 +248,10 @@
-
+
-
+
-
+
@@ -293,7 +290,7 @@
@@ -380,14 +377,14 @@ export default {
create: 'Create',
},
rules: {
- tenantId: [{ required: true, message: 'this is required', trigger: 'blur' }],
- itemId: [{ required: true, message: 'this is required', trigger: 'blur' }],
- tpId: [{ required: true, message: 'this is required', trigger: 'blur' }],
- receives: [{ required: true, message: 'this is required', trigger: 'blur' }],
- secretKey: [{ required: true, message: 'this is required', trigger: 'blur' }],
- platform: [{ required: true, message: 'this is required', trigger: 'blur' }],
- configType: [{ required: true, message: 'this is required', trigger: 'blur' }],
- enable: [{ required: true, message: 'this is required', trigger: 'blur' }],
+ tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ itemId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ tpId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ receives: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ secretKey: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ platform: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ configType: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ enable: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
},
temp: {
id: undefined,
@@ -479,8 +476,8 @@ export default {
this.fetchData();
this.dialogFormVisible = false;
this.$notify({
- title: 'Success',
- message: 'Created Successfully',
+ title: this.$t('message.success'),
+ message: this.$t('message.createdSuccess'),
type: 'success',
duration: 2000,
});
@@ -509,8 +506,8 @@ export default {
this.fetchData();
this.dialogFormVisible = false;
this.$notify({
- title: 'Success',
- message: 'Update Successfully',
+ title: this.$t('message.success'),
+ message: this.$t('message.updateSuccess'),
type: 'success',
duration: 2000,
});
@@ -519,9 +516,9 @@ export default {
});
},
openDelConfirm(name) {
- return this.$confirm(`此操作将删除 ${name}, 是否继续?`, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
+ return this.$confirm(this.$t('message.deleteMessage', { name }), this.$t('common.hint'), {
+ confirmButtonText: this.$t('common.ok'),
+ cancelButtonText: this.$t('common.cancel'),
type: 'warning',
});
},
@@ -531,8 +528,8 @@ export default {
notifyApi.deleted(row).then((response) => {
this.fetchData();
this.$notify({
- title: 'Success',
- message: 'Delete Successfully',
+ title: this.$t('message.success'),
+ message: this.$t('message.deleteSuccess'),
type: 'success',
duration: 2000,
});
@@ -543,8 +540,8 @@ export default {
notifyApi.enable(row).then((response) => {
this.fetchData();
this.$notify({
- title: 'Success',
- message: 'Delete Successfully',
+ title: this.$t('message.success'),
+ message: this.$t('message.updateSuccess'),
type: 'success',
duration: 2000,
});
@@ -557,7 +554,7 @@ export default {
this.rules['interval'] = [];
}
if (configType != null && configType != undefined && alarmType === true) {
- this.rules['interval'] = [{ required: true, message: 'this is required', trigger: 'blur' }];
+ this.rules['interval'] = [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }];
}
},