From 3b82d9b58912598b126b4c37c43226d21e2ccaec Mon Sep 17 00:00:00 2001
From: Svamei <357810508@qq.com>
Date: Thu, 30 Mar 2023 22:14:10 +0800
Subject: [PATCH] Complete the text translation of the 'Thread Pool Audit' page
---
hippo4j-ui/src/locale/lang/en.js | 31 +++-
hippo4j-ui/src/locale/lang/zh.js | 34 +++-
hippo4j-ui/src/views/hippo4j/verify/index.vue | 167 +++++++++---------
3 files changed, 145 insertions(+), 87 deletions(-)
diff --git a/hippo4j-ui/src/locale/lang/en.js b/hippo4j-ui/src/locale/lang/en.js
index 201983ad..47aa5147 100644
--- a/hippo4j-ui/src/locale/lang/en.js
+++ b/hippo4j-ui/src/locale/lang/en.js
@@ -19,7 +19,9 @@ export default {
NoDeletionPermissionTip: 'Contact the administrator to delete it',
emptyWarning: "The '{name}' cannot be empty",
queryFailure: 'The query fails. Please refresh the page',
- updateFailure:'Failed to modify thread pool'
+ 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?'
},
// 公共
@@ -42,7 +44,10 @@ export default {
updateTime: 'Update Time',
hint: 'Warning',
info: 'Info',
- stack: 'Stack'
+ stack: 'Stack',
+ audit: 'audit',
+ yes: 'Yes',
+ no: 'No'
},
// 运行报表
@@ -141,5 +146,27 @@ export default {
threadPoolIDRequired: 'ThreadPool ID(Required)',
threadPoolID: 'ThreadPool ID',
threadPoolType: 'ThreadPool Type'
+ },
+
+ //线程池审核
+ threadPoolAudit: {
+ changeType: 'Change Type',
+ modifiedBy: 'Modified by',
+ auditStatus: 'Audit Status',
+ reviewer: 'Reviewer',
+ submissionTime: 'Submission Time',
+ auditTime: 'Audit Time',
+ unaudited: 'Unaudited',
+ expired: 'Expired',
+ auditApproved: 'Audit Approved',
+ auditRejection: 'Audit Rejection',
+ manage: 'Manage',
+ instance: 'Instance',
+ container: 'Container',
+ framework: 'Framework',
+ threadPoolManage: 'ThreadPool Manage',
+ threadPoolInstance: 'ThreadPool Instance',
+ containerThreadPool: 'Container ThreadPool',
+ frameworkThreadPool: 'Framework ThreadPool',
}
}
diff --git a/hippo4j-ui/src/locale/lang/zh.js b/hippo4j-ui/src/locale/lang/zh.js
index a8b08e83..33d98cf9 100644
--- a/hippo4j-ui/src/locale/lang/zh.js
+++ b/hippo4j-ui/src/locale/lang/zh.js
@@ -19,7 +19,9 @@ export default {
NoDeletionPermissionTip: '请联系管理员删除',
emptyWarning: "{name}不允许为空",
queryFailure: '查询失败,请尝试刷新页面',
- updateFailure:'修改线程池失败'
+ updateFailure:'修改线程池失败',
+ auditApprovedMessage: '此操作将接受线程池变更申请, 是否继续?',
+ auditRejectionMessage: '此操作将拒绝线程池变更申请, 是否继续?'
},
// 公共
@@ -42,7 +44,10 @@ export default {
updateTime: '修改时间',
hint: '提示',
info: '详情',
- stack: '堆栈'
+ stack: '堆栈',
+ audit: '审核',
+ yes: '是',
+ no: '否'
},
// 运行报表
@@ -97,7 +102,6 @@ export default {
threadsNumErrorTip: '最大线程必须大于等于核心线程'
},
-
// 线程池实例
threadPoolInstance: {
instanceID: '实例标识',
@@ -138,9 +142,31 @@ export default {
},
//框架线程池
- frameworkThreadPool : {
+ frameworkThreadPool: {
threadPoolIDRequired: '线程池标识(必填)',
threadPoolID: '线程池标识',
threadPoolType: '线程池类型'
+ },
+
+ //线程池审核
+ threadPoolAudit: {
+ changeType: '变化类型',
+ modifiedBy: '修改人',
+ auditStatus: '审核状态',
+ reviewer: '审核人',
+ submissionTime: '提交时间',
+ auditTime: '审核时间',
+ unaudited: '待审核',
+ expired: '失效',
+ auditApproved: '审核通过',
+ auditRejection: '审核拒绝',
+ manage: '管理',
+ instance: '实例',
+ container: '容器',
+ framework: '框架',
+ threadPoolManage: '线程池管理',
+ threadPoolInstance: '线程池实例',
+ containerThreadPool: '容器线程池',
+ frameworkThreadPool: '框架线程池',
}
}
diff --git a/hippo4j-ui/src/views/hippo4j/verify/index.vue b/hippo4j-ui/src/views/hippo4j/verify/index.vue
index a6b5f697..c9aa7ac1 100644
--- a/hippo4j-ui/src/views/hippo4j/verify/index.vue
+++ b/hippo4j-ui/src/views/hippo4j/verify/index.vue
@@ -3,7 +3,7 @@
- 搜索
+ {{ $t('common.query') }}
- 重置
+ {{ $t('common.reset') }}
-
+
{{ scope.$index + 1 }}
-
+
{{ scope.row.itemId }}
-
+
{{ scope.row.tpId || '-' }}
-
+
{{ scope.row.identify || '-' }}
-
- {{ scope.row.type | modifyTypeFilter }}
+
+ {{ scope.row.type | modifyTypeFilter(that) }}
-
+
{{ scope.row.modifyAll | modifyAllFilter }}
-
+
{{ scope.row.modifyUser }}
-
- {{ scope.row.verifyStatus | verifyStatusFilter }}
+
+ {{ scope.row.verifyStatus | verifyStatusFilter(that) }}
-
+
{{ scope.row.verifyUser }}
-
+
{{ scope.row.gmtCreate }}
-
+
{{ scope.row.gmtVerify }}
- 审核
+ {{$t('common.audit')}}
@@ -126,38 +126,38 @@
:model="temp"
label-width="80px"
>
-
+
{{ detailInfo.corePoolSize }}
-
+
{{ detailInfo.maximumPoolSize }}
-
+
{{ detailInfo.queueType | queueTypeFilter }}
-
+
{{ detailInfo.capacity }}
-
+
{{ detailInfo.executeTimeOut }}
-
+
{{ detailInfo.keepAliveTime }}
-
- {{ detailInfo.allowCoreThreadTimeOut | enableFilter }}
+
+ {{ detailInfo.allowCoreThreadTimeOut | enableFilter(that) }}
-
- {{ detailInfo.isAlarm | enableFilter }}
+
+ {{ detailInfo.isAlarm | enableFilter(that) }}
-
+
{{ detailInfo.livenessAlarm }}
-
+
{{ detailInfo.capacityAlarm }}
-
+
{{ detailInfo.rejectedType | rejectedTypeFilter }}
-
+
{{ detailInfo.corePoolSize }}
-
+
{{ detailInfo.maximumPoolSize }}
-
+
{{ detailInfo.keepAliveTime }}
-
+
@@ -268,26 +268,26 @@
{{ detailInfo.mark }}
-
+
{{ detailInfo.corePoolSize }}
-
+
{{ detailInfo.maximumPoolSize }}
-
+
@@ -310,6 +310,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as verifyApi from '@/api/verify';
import waves from '@/directive/waves';
import Pagination from '@/components/Pagination';
+import * as threadPoolApi from '@/api/hippo4j-threadPool';
+import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
export default {
name: 'JobProject',
@@ -329,11 +331,11 @@ export default {
}
return value;
},
- enableFilter(type) {
+ enableFilter(type, that) {
if (1 == type) {
- return '是';
+ return that.$t('common.yes');
} else if (0 == type) {
- return '否';
+ return that.$t('common.no')
}
},
alarmFilter(type) {
@@ -377,26 +379,27 @@ export default {
return 'CustomRejectedPolicy_' + type;
}
},
- modifyTypeFilter(type) {
+ modifyTypeFilter(type, that) {
+ console.log(that)
if (1 == type) {
- return '管理';
+ return that.$t('threadPoolAudit.manage')
} else if (2 == type) {
- return '实例';
+ return that.$t('threadPoolAudit.instance');
} else if (3 == type) {
- return '容器';
+ return that.$t('threadPoolAudit.container');
} else if (4 == type) {
- return '框架';
+ return that.$t('threadPoolAudit.framework');
}
},
- verifyStatusFilter(type) {
+ verifyStatusFilter(type, that) {
if (0 == type) {
- return '待审核';
+ return that.$t('threadPoolAudit.unaudited')
} else if (1 == type) {
- return '审核通过';
+ return that.$t('threadPoolAudit.auditApproved');
} else if (2 == type) {
- return '审核拒绝';
+ return that.$t('threadPoolAudit.auditRejection');
} else if (3 == type) {
- return '失效';
+ return that.$t('threadPoolAudit.expired');
}
},
modifyAllFilter(type) {
@@ -463,10 +466,10 @@ export default {
size: 500,
dialogStatus: '',
textMap: {
- 1: '线程池管理',
- 2: '线程池实例',
- 3: '容器线程池',
- 4: '框架线程池',
+ 1: this.$t('threadPoolAudit.threadPoolManage'),
+ 2: this.$t('threadPoolAudit.threadPoolInstance'),
+ 3: this.$t('threadPoolAudit.containerThreadPool'),
+ 4: this.$t('threadPoolAudit.frameworkThreadPool'),
},
temp: {
id: undefined,
@@ -478,6 +481,8 @@ export default {
maxSize: 8,
},
visible: true,
+ // filters中无法使用this来调用$t,通过参数that传入filters中
+ that: this
};
},
created() {
@@ -565,16 +570,16 @@ export default {
});
},
openAcceptConfitm() {
- return this.$confirm(`此操作将接受线程池变更申请, 是否继续?`, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
+ return this.$confirm(this.$t('message.auditApprovedMessage'), this.$t('common.hint'), {
+ confirmButtonText: this.$t('common.ok'),
+ cancelButtonText: this.$t('common.cancel'),
type: 'warning',
});
},
openRejectConfirm() {
- return this.$confirm(`此操作将拒绝线程池变更申请, 是否继续?`, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
+ return this.$confirm(this.$t('message.auditRejectionMessage'), this.$t('common.hint'), {
+ confirmButtonText: this.$t('common.ok'),
+ cancelButtonText: this.$t('common.cancel'),
type: 'warning',
});
},
@@ -631,7 +636,7 @@ export default {
})
.catch((error) => {
console.log(error);
- this.$message.error('查询失败,请尝试刷新页面');
+ this.$message.error(this.$t('message.queryFailure'));
});
},