diff --git a/hippo4j-ui/src/locale/lang/en.js b/hippo4j-ui/src/locale/lang/en.js
index 5ea48ce2..303bdf9a 100644
--- a/hippo4j-ui/src/locale/lang/en.js
+++ b/hippo4j-ui/src/locale/lang/en.js
@@ -9,16 +9,20 @@ export default {
// 信息
message: {
+ requiredError: 'this is required',
success: 'Success',
createdSuccess: 'Created Successfully',
- deleteMessage: 'This action will delete {name}, Do you want to continue?'
+ updateSuccess: 'Update Successfully',
+ deleteSuccess: 'Delete Successfully',
+ deleteMessage: 'This action will delete {name}, Do you want to continue?',
+ selectMessage: 'Please select a {target}',
+ NoDeletionPermissionTip: 'Contact the administrator to delete it'
},
// 公共
common: {
query: 'Query',
insert: 'Insert',
- serialNumber: 'Serial Number',
operation: 'Operation',
create: 'Create',
edit: 'Edit',
@@ -26,12 +30,10 @@ export default {
cancel: 'Cancel',
confirm: 'Confirm',
ok: 'Ok',
- threadPool: 'Thread Pool',
num: 'Num',
createTime: 'Create Time',
updateTime: 'Update Time',
- requiredError: 'this is required',
- hint: 'Warning'
+ hint: 'Warning',
},
// 运行报表
@@ -58,10 +60,29 @@ export default {
itemIntro: 'Item Intro'
},
- // 线程池
+ // 线程池管理
threadPool: {
- tenant: 'Tenant',
- project: 'Project',
+ threadPool: 'Thread Pool',
+ coreSize: 'Core Size',
+ maximumSize: 'Maximum Size',
+ queueType: 'Queue Type',
+ queueCapacity: 'Queue Capacity',
+ rejectedHandler: 'Rejected Handler',
+ executionTimeout: 'Execution Timeout',
+ executionTimeoutUnit: 'Execution Timeout (ms)',
+ keepAliveTime: 'Keep Alive Time',
+ keepAliveTimeUnit: 'Keep Alive Time(seconds)',
+ isTimeout: 'Is Timeout',
+ timeout: 'Timeout',
+ noTimeout: 'No Timeout',
+ isAlarm: 'Is Alarm',
+ alarm: 'Alarm',
+ noAlarm: 'No Alarm',
+ activeAlarm: 'Active Alarm',
+ capacityAlarm: 'Capacity Alarm',
+ customRejectedHandler: 'Custom Rejected Handler',
+ customRejectedHandlerTip: 'Please enter a custom SPI Deny Policy ID',
+ threadsNumErrorTip: 'The maximum thread must be greater than or equal to the core thread'
}
}
diff --git a/hippo4j-ui/src/locale/lang/zh.js b/hippo4j-ui/src/locale/lang/zh.js
index 324041d1..f64c9bc4 100644
--- a/hippo4j-ui/src/locale/lang/zh.js
+++ b/hippo4j-ui/src/locale/lang/zh.js
@@ -9,16 +9,20 @@ export default {
// 信息
message: {
+ requiredError: '这是必填项',
success: '成功',
createdSuccess: '创建成功',
- deleteMessage: '此操作将删除 {name}, 是否继续?'
+ updateSuccess: '更新成功',
+ deleteSuccess: '删除成功',
+ deleteMessage: '此操作将删除 {name}, 是否继续?',
+ selectMessage: '请选择{target}',
+ NoDeletionPermissionTip: '请联系管理员删除'
},
// 公共
common: {
query: '搜索',
insert: '添加',
- serialNumber: '序号',
operation: '操作',
create: '创建',
edit: '编辑',
@@ -26,11 +30,9 @@ export default {
cancel: '取消',
confirm: '确认',
ok: '确定',
- threadPool: '线程池',
num: '序号',
createTime: '创建时间',
updateTime: '修改时间',
- requiredError: '这是必填项',
hint: '提示'
},
@@ -58,9 +60,28 @@ export default {
itemIntro: '项目简介'
},
- // 线程池
+ // 线程池管理
threadPool: {
- tenant: '租户',
- project: '项目',
+ threadPool: '线程池',
+ coreSize: '核心线程',
+ maximumSize: '最大线程',
+ queueType: '队列类型',
+ queueCapacity: '队列容量',
+ rejectedHandler: '拒绝策略',
+ executionTimeout: '执行超时',
+ executionTimeoutUnit: '执行超时 (毫秒)',
+ keepAliveTime: '空闲回收',
+ keepAliveTimeUnit: '空闲回收(秒)',
+ isTimeout: '是否超时',
+ timeout: '超时',
+ noTimeout: '不超时',
+ isAlarm: '是否报警',
+ alarm: '报警',
+ noAlarm: '不报警',
+ activeAlarm: '活跃报警',
+ capacityAlarm: '容量报警',
+ customRejectedHandler: '自定义拒绝策略',
+ customRejectedHandlerTip: '请输入自定义 SPI 拒绝策略标识',
+ threadsNumErrorTip: '最大线程必须大于等于核心线程'
}
}
diff --git a/hippo4j-ui/src/main.js b/hippo4j-ui/src/main.js
index 44f539b8..0cdc6fb5 100755
--- a/hippo4j-ui/src/main.js
+++ b/hippo4j-ui/src/main.js
@@ -18,6 +18,7 @@ import './permission'; // permission control
// import './utils/error-log' // error log
import i18n from '@/locale'
+import '@/utils/i18n-utils'
import * as filters from './filters'; // global filters
import echarts from 'echarts';
Vue.prototype.$echarts = echarts;
diff --git a/hippo4j-ui/src/utils/i18n-utils.js b/hippo4j-ui/src/utils/i18n-utils.js
new file mode 100644
index 00000000..59998340
--- /dev/null
+++ b/hippo4j-ui/src/utils/i18n-utils.js
@@ -0,0 +1,20 @@
+import Vue from 'vue'
+import i18n from '@/locale'
+
+
+/**
+ * @param langMap {[lang]: any} object
+ * @param [defaultText] any
+ * @returns any
+ */
+export function langMatch(langMap, defaultText = undefined) {
+ if (Object.prototype.toString.call(langMap) !== '[object Object]') {
+ throw Error('The first argument to the langMatch method must be the object type')
+ }
+ const lang = i18n.locale
+ return Object.prototype.hasOwnProperty.call(langMap, lang) ? langMap[lang] : defaultText
+}
+
+
+Vue.prototype.$langMatch = langMatch
+
diff --git a/hippo4j-ui/src/views/dashboard/admin/components/PanelGroup.vue b/hippo4j-ui/src/views/dashboard/admin/components/PanelGroup.vue
index c2629a0c..48cbcf51 100644
--- a/hippo4j-ui/src/views/dashboard/admin/components/PanelGroup.vue
+++ b/hippo4j-ui/src/views/dashboard/admin/components/PanelGroup.vue
@@ -33,7 +33,7 @@
- {{ $t('common.threadPool') }}
+ {{ $t('threadPool.threadPool') }}
diff --git a/hippo4j-ui/src/views/hippo4j/item/index.vue b/hippo4j-ui/src/views/hippo4j/item/index.vue
index be8e0398..7ee9844b 100755
--- a/hippo4j-ui/src/views/hippo4j/item/index.vue
+++ b/hippo4j-ui/src/views/hippo4j/item/index.vue
@@ -204,11 +204,11 @@ export default {
create: 'Create',
},
rules: {
- tenantId: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
- itemId: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
- itemName: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
- owner: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
- itemDesc: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
+ tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ itemId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ itemName: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ owner: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ itemDesc: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
},
temp: {
id: undefined,
diff --git a/hippo4j-ui/src/views/hippo4j/tenant/index.vue b/hippo4j-ui/src/views/hippo4j/tenant/index.vue
index 9ce4b2ac..c484bc62 100755
--- a/hippo4j-ui/src/views/hippo4j/tenant/index.vue
+++ b/hippo4j-ui/src/views/hippo4j/tenant/index.vue
@@ -174,10 +174,10 @@ export default {
create: this.$t('common.create'),
},
rules: {
- tenantId: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
- tenantName: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
- owner: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
- tenantDesc: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }],
+ tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ tenantName: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ owner: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ tenantDesc: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
},
temp: {
id: undefined,
diff --git a/hippo4j-ui/src/views/hippo4j/threadpool/index.vue b/hippo4j-ui/src/views/hippo4j/threadpool/index.vue
index 9eac9d3a..ffdd51b2 100755
--- a/hippo4j-ui/src/views/hippo4j/threadpool/index.vue
+++ b/hippo4j-ui/src/views/hippo4j/threadpool/index.vue
@@ -3,7 +3,7 @@
- {{ $t('common.search') }}
+ {{ $t('common.query') }}
- {{ $t('common.addition') }}
+ {{ $t('common.insert') }}
-
+
{{ scope.$index + 1 }}
-
+
{{ scope.row.tenantId }}
-
+
{{ scope.row.itemId }}
-
+
{{ scope.row.tpId }}
-
+
{{ scope.row.coreSize }}
-
+
{{ scope.row.maxSize }}
-
+
{{ scope.row.queueType | queueFilter }}
-
+
{{ scope.row.capacity }}
-
+
{{ scope.row.rejectedType | rejectedTypeFilter }}
-
+
{{
scope.row.executeTimeOut | defaultExecuteTimeoutValue
}}
-
+
-
+
{{ scope.row.gmtCreate }}
-
+
{{ scope.row.gmtModified }}
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
-
+
-
+
@@ -234,57 +237,57 @@
/>
-
+
-
+
-
+
-
+
- 超时
- 不超时
+ {{ $t('threadPool.timeout') }}
+ {{ $t('threadPool.noTimeout') }}
-
+
- 报警
- 不报警
+ {{ $t('threadPool.alarm') }}
+ {{ $t('threadPool.noAlarm') }}
-
+
- 不报警
+ {{ $t('threadPool.noAlarm') }}
60%
80%
90%
@@ -293,11 +296,11 @@
-
+
- 不报警
+ {{ $t('threadPool.noAlarm') }}
60%
80%
90%
@@ -305,11 +308,11 @@
-
+
-
+
@@ -341,7 +344,7 @@
@@ -460,16 +463,16 @@ export default {
size: 500,
dialogStatus: '',
textMap: {
- update: 'Edit',
- create: 'Create',
+ update: this.$t('common.edit'),
+ create: this.$t('common.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' }],
- coreSize: [{ 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' }],
+ coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
maxSize: [
- { required: true, message: 'this is required', trigger: 'blur' },
+ { required: true, message: this.$t('message.requiredError'), trigger: 'blur' },
// {
// validator: (rule, value, callback) => {
// if (parseInt(value) < parseInt(this.temp.coreSize)) {
@@ -481,15 +484,15 @@ export default {
// },
// },
],
- queueType: [{ required: true, message: 'this is required', trigger: 'blur' }],
- allowCoreThreadTimeOut: [{ required: true, message: 'this is required', trigger: 'blur' }],
- keepAliveTime: [{ required: true, message: 'this is required', trigger: 'blur' }],
- isAlarm: [{ required: true, message: 'this is required', trigger: 'blur' }],
- capacityAlarm: [{ required: true, message: 'this is required', trigger: 'blur' }],
- livenessAlarm: [{ required: true, message: 'this is required', trigger: 'blur' }],
- rejectedType: [{ required: true, message: 'this is required', trigger: 'blur' }],
- capacity: [{ required: true, message: 'this is required', trigger: 'blur' }],
- executeTimeOut: [{ required: true, message: 'this is required', trigger: 'blur' }],
+ queueType: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ allowCoreThreadTimeOut: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ keepAliveTime: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ isAlarm: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ capacityAlarm: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ livenessAlarm: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ rejectedType: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ capacity: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
+ executeTimeOut: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
},
temp: {
id: undefined,
@@ -531,8 +534,8 @@ export default {
threadPoolApi.alarmEnable(row).then(() => {
this.fetchData();
this.$notify({
- title: 'Success',
- message: 'Update Successfully',
+ title: this.$t('message.success'),
+ message: this.$t('message.updateSuccess'),
type: 'success',
duration: 2000,
});
@@ -589,7 +592,7 @@ export default {
this.$refs['dataForm'].validate((valid) => {
if (parseInt(this.temp.maxSize) < parseInt(this.temp.coreSize)) {
this.$message({
- message: '最大线程必须大于等于核心线程',
+ message: this.$t('threadPool.threadsNumErrorTip'),
type: 'warning',
});
return;
@@ -606,8 +609,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,
});
@@ -645,7 +648,7 @@ export default {
if (valid) {
if (parseInt(this.temp.maxSize) < parseInt(this.temp.coreSize)) {
this.$message({
- message: '最大线程必须大于等于核心线程',
+ message: this.$t('threadPool.threadsNumErrorTip'),
type: 'warning',
});
return;
@@ -668,8 +671,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,
});
@@ -678,16 +681,16 @@ 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',
});
},
handleDelete(row) {
const role = localStorage.getItem('USER_ROLE') === 'ROLE_ADMIN' ? true : false;
if (!role) {
- this.$message.error('请联系管理员删除');
+ this.$message.error(this.$t('message.NoDeletionPermissionTip'));
return;
}
@@ -695,8 +698,8 @@ export default {
threadPoolApi.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,
});