From 257011dd32a3608b3973ece1714bee0a18c9411b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E7=A7=B0?= Date: Mon, 20 Mar 2023 22:20:22 +0800 Subject: [PATCH 01/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 475903d4..9ab8732f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -## 动态可观测线程池,通过对 JDK 线程池的增强,以及扩展三方框架底层线程池等功能,为业务系统提高线上运行保障能力 +## 动态可观测线程池,提高系统运行保障能力 [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0) From 1aa04a90575316acd3339872d1b87bd3162ceff6 Mon Sep 17 00:00:00 2001 From: yanrongzhen Date: Fri, 24 Mar 2023 17:32:26 +0800 Subject: [PATCH 02/15] Bruceyan/issue#1134 (#1135) * Fix: Prevent parameter refresh failure during web container startup due to issues with the execution order of the ApplicationRunner. * Use `isContainerStarted` conditional logic when updating parameters. * fix: remove 'isContainerStarted' conditional logic. --- .../hippo4j/adapter/web/AbstractWebThreadPoolService.java | 4 ++++ .../adapter/web/DefaultAbstractWebThreadPoolService.java | 6 ++++++ .../starter/web/AbstractWebThreadPoolService1x.java | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/hippo4j-adapter/hippo4j-adapter-web/src/main/java/cn/hippo4j/adapter/web/AbstractWebThreadPoolService.java b/hippo4j-adapter/hippo4j-adapter-web/src/main/java/cn/hippo4j/adapter/web/AbstractWebThreadPoolService.java index 910ff0f3..03014af3 100644 --- a/hippo4j-adapter/hippo4j-adapter-web/src/main/java/cn/hippo4j/adapter/web/AbstractWebThreadPoolService.java +++ b/hippo4j-adapter/hippo4j-adapter-web/src/main/java/cn/hippo4j/adapter/web/AbstractWebThreadPoolService.java @@ -25,12 +25,16 @@ import cn.hippo4j.common.model.ThreadPoolRunStateInfo; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; + import java.util.concurrent.Executor; /** * Abstract web thread pool service. */ @Slf4j +@Order(Ordered.HIGHEST_PRECEDENCE) public abstract class AbstractWebThreadPoolService implements WebThreadPoolService, ApplicationRunner { private final IWebThreadPoolHandlerSupport support; diff --git a/hippo4j-adapter/hippo4j-adapter-web/src/main/java/cn/hippo4j/adapter/web/DefaultAbstractWebThreadPoolService.java b/hippo4j-adapter/hippo4j-adapter-web/src/main/java/cn/hippo4j/adapter/web/DefaultAbstractWebThreadPoolService.java index ebb98f0e..e519c5b6 100644 --- a/hippo4j-adapter/hippo4j-adapter-web/src/main/java/cn/hippo4j/adapter/web/DefaultAbstractWebThreadPoolService.java +++ b/hippo4j-adapter/hippo4j-adapter-web/src/main/java/cn/hippo4j/adapter/web/DefaultAbstractWebThreadPoolService.java @@ -18,22 +18,28 @@ package cn.hippo4j.adapter.web; import cn.hippo4j.common.config.ApplicationContextHolder; +import lombok.extern.slf4j.Slf4j; import org.springframework.boot.web.context.WebServerApplicationContext; import org.springframework.boot.web.server.WebServer; import org.springframework.context.ApplicationContext; +import org.springframework.util.ReflectionUtils; +import java.lang.reflect.Field; import java.util.concurrent.Executor; /** * Default WebThreadPoolService abstract class, * reuses common capabilities for web container operations. */ +@Slf4j public abstract class DefaultAbstractWebThreadPoolService extends AbstractWebThreadPoolService { public DefaultAbstractWebThreadPoolService(IWebThreadPoolHandlerSupport support) { super(support); } + private static final String STARTED_FIELD_NAME = "started"; + /** * Get the internal abstract method of the web container thread pool, * to be implemented by subclasses. diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-1x-starter/src/main/java/cn/hippo4j/config/springboot1x/starter/web/AbstractWebThreadPoolService1x.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-1x-starter/src/main/java/cn/hippo4j/config/springboot1x/starter/web/AbstractWebThreadPoolService1x.java index 333a4d07..148a5deb 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-1x-starter/src/main/java/cn/hippo4j/config/springboot1x/starter/web/AbstractWebThreadPoolService1x.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-1x-starter/src/main/java/cn/hippo4j/config/springboot1x/starter/web/AbstractWebThreadPoolService1x.java @@ -20,18 +20,25 @@ package cn.hippo4j.config.springboot1x.starter.web; import cn.hippo4j.adapter.web.AbstractWebThreadPoolService; import cn.hippo4j.adapter.web.IWebThreadPoolHandlerSupport; import cn.hippo4j.common.config.ApplicationContextHolder; +import lombok.extern.slf4j.Slf4j; import org.springframework.boot.context.embedded.EmbeddedServletContainer; import org.springframework.boot.context.embedded.EmbeddedWebApplicationContext; +import org.springframework.util.ReflectionUtils; + +import java.lang.reflect.Field; /** * Abstract class for adapting WebThreadPoolService to Spring 1.x version. */ +@Slf4j public abstract class AbstractWebThreadPoolService1x extends AbstractWebThreadPoolService { public AbstractWebThreadPoolService1x(IWebThreadPoolHandlerSupport support) { super(support); } + private static final String STARTED_FIELD_NAME = "started"; + /** * Get the embedded Servlet container from the Spring application context. */ @@ -46,4 +53,5 @@ public abstract class AbstractWebThreadPoolService1x extends AbstractWebThreadPo public Integer getPort() { return getContainer().getPort(); } + } From 2286550250f334980fbff0aa3839972729dfe97e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 Mar 2023 19:41:59 +0800 Subject: [PATCH 03/15] Bump spring-core in /hippo4j-common (#1136) Bumps [spring-core](https://github.com/spring-projects/spring-framework) from 5.2.22.RELEASE to 5.2.23.RELEASE. - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v5.2.22.RELEASE...v5.2.23.RELEASE) --- updated-dependencies: - dependency-name: org.springframework:spring-core dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- hippo4j-common/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hippo4j-common/pom.xml b/hippo4j-common/pom.xml index 5f56c500..efba01a7 100644 --- a/hippo4j-common/pom.xml +++ b/hippo4j-common/pom.xml @@ -13,7 +13,7 @@ 5.2.21.RELEASE 5.2.15.RELEASE 5.2.21.RELEASE - 5.2.22.RELEASE + 5.2.23.RELEASE From 123fb0b168e5424a8f1ca41b228f96a22b09c18f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E7=A7=B0?= Date: Sat, 25 Mar 2023 21:44:47 +0800 Subject: [PATCH 04/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ab8732f..9379a3fd 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ For full documentation & more details, visit: [Docs](https://www.hippo4j.cn) - [[ JavaGuide ]](https://github.com/Snailclimb/JavaGuide):一份涵盖大部分 Java 程序员所需要掌握的核心知识。 - [[ toBeBetterJavaer ]](https://github.com/itwanger/toBeBetterJavaer):一份通俗易懂、风趣幽默的 Java 学习指南。 - [[ Jpom ]](https://gitee.com/dromara/Jpom):简而轻的低侵入式在线构建、自动部署、日常运维、项目监控软件。 -- [[ CongoMall ]](https://sourl.cn/VERS4y):刚果商城基于 DDD 开发,内置分布式锁、分布式事务、分库分表、消息队列、服务监控等功能。 +- [[ CongoMall ]](https://magestack.cn):刚果商城,不一样的 C 端商城系统,包含商城核心业务和基础架构两大模块。 ### 贡献者 From cf6880aca0f5778b4b0a45dfe75501ffd198097e Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Sat, 25 Mar 2023 21:48:17 +0800 Subject: [PATCH 05/15] Changed CongoMall Jump block --- docs/docusaurus.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 7bcb12c3..7bb7d102 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -116,7 +116,7 @@ const config = { position: 'left', }, { - href: 'https://sourl.cn/Fyp7y4', + href: 'https://magestack.cn', label: '👉 刚果商城', position: 'left', }, From 37930e140a30fb6600eda8aed9741b386cc14d72 Mon Sep 17 00:00:00 2001 From: Svamei <41992090+Svamei@users.noreply.github.com> Date: Wed, 29 Mar 2023 17:05:01 +0800 Subject: [PATCH 06/15] Complete the text translation of the 'Thread Pool Monitor' page (#1138) --- hippo4j-ui/src/locale/lang/en.js | 10 ++++++++- hippo4j-ui/src/locale/lang/zh.js | 10 ++++++++- .../src/views/hippo4j/monitor/index.vue | 22 +++++++++---------- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/hippo4j-ui/src/locale/lang/en.js b/hippo4j-ui/src/locale/lang/en.js index 6815cebd..76be45d2 100644 --- a/hippo4j-ui/src/locale/lang/en.js +++ b/hippo4j-ui/src/locale/lang/en.js @@ -40,7 +40,8 @@ export default { createTime: 'Create Time', updateTime: 'Update Time', hint: 'Warning', - info: 'Info' + info: 'Info', + stack: 'Stack' }, // 运行报表 @@ -125,5 +126,12 @@ export default { allowCoreThreadTimeOut: 'Allow Core Thread Time Out', changeAll: 'Change All', stackRequestFail: 'The current thread pool has no stack information' + }, + + //线程池监控 + threadPoolMonitor: { + ipPort: 'IP : Port', + ipPortRequired: 'IP : Port(Required)', + noResultsYet: 'No results yet' } } diff --git a/hippo4j-ui/src/locale/lang/zh.js b/hippo4j-ui/src/locale/lang/zh.js index 5d8394e1..c35c7ebd 100644 --- a/hippo4j-ui/src/locale/lang/zh.js +++ b/hippo4j-ui/src/locale/lang/zh.js @@ -40,7 +40,8 @@ export default { createTime: '创建时间', updateTime: '修改时间', hint: '提示', - info: '详情' + info: '详情', + stack: '堆栈' }, // 运行报表 @@ -126,5 +127,12 @@ export default { allowCoreThreadTimeOut: '线程超时', changeAll: '全部修改', stackRequestFail: '当前线程池暂无堆栈信息' + }, + + //线程池监控 + threadPoolMonitor: { + ipPort: 'IP : Port', + ipPortRequired: 'IP : Port(必填)', + noResultsYet: '暂无结果' } } diff --git a/hippo4j-ui/src/views/hippo4j/monitor/index.vue b/hippo4j-ui/src/views/hippo4j/monitor/index.vue index 58d14f69..4ff000dd 100755 --- a/hippo4j-ui/src/views/hippo4j/monitor/index.vue +++ b/hippo4j-ui/src/views/hippo4j/monitor/index.vue @@ -3,7 +3,7 @@
- 搜索 + {{ $t('common.query') }} - 重置 + {{ $t('common.reset') }}
- +
- + @@ -134,7 +134,7 @@ label-position="left" label-width="110px" > - + - + - + @@ -283,19 +283,19 @@ export default { }, fetchData() { if (!this.listQuery.mark) { - this.$message.warning('线程池类型不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this. $t('frameworkThreadPool.threadPoolType') })); return; } if (!this.listQuery.tenantId) { - this.$message.warning('租户不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') })); return; } if (!this.listQuery.itemId) { - this.$message.warning('项目不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('projectManage.item') })); return; } if (!this.listQuery.threadPoolKey) { - this.$message.warning('线程池标识不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this. $t('frameworkThreadPool.threadPoolID') })); return; } this.listLoading = true; @@ -333,7 +333,7 @@ export default { if (valid) { if (parseInt(this.temp.maximumSize) < parseInt(this.temp.coreSize)) { this.$message({ - message: '最大线程必须大于等于核心线程', + message: this.$t('threadPool.threadsNumErrorTip'), type: 'warning', }); return; @@ -385,13 +385,13 @@ export default { }) .catch((error) => { console.log(error); - this.$message.error('修改线程池失败'); + this.$message.error(this.$t('message.updateFailure')); }); }, 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', }); }, @@ -497,7 +497,7 @@ export default { }) .catch((error) => { console.log(error); - this.$message.error('查询失败,请尝试刷新页面'); + this.$message.error(this.$t('message.queryFailure')); }); }, }, diff --git a/hippo4j-ui/src/views/hippo4j/other/dubbo/index.vue b/hippo4j-ui/src/views/hippo4j/other/dubbo/index.vue index 530275f6..ad3847f0 100755 --- a/hippo4j-ui/src/views/hippo4j/other/dubbo/index.vue +++ b/hippo4j-ui/src/views/hippo4j/other/dubbo/index.vue @@ -3,7 +3,7 @@
- 搜索 + {{ $t('common.query') }} - 重置 + {{ $t('common.reset') }}
- + - + - + - + - + - + @@ -110,7 +110,7 @@ --> - + @@ -134,7 +134,7 @@ label-position="left" label-width="110px" > - + - + - +
@@ -283,19 +283,19 @@ export default { }, fetchData() { if (!this.listQuery.mark) { - this.$message.warning('线程池类型不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this. $t('frameworkThreadPool.threadPoolType') })); return; } if (!this.listQuery.tenantId) { - this.$message.warning('租户不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') })); return; } if (!this.listQuery.itemId) { - this.$message.warning('项目不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('projectManage.item') })); return; } if (!this.listQuery.threadPoolKey) { - this.$message.warning('线程池标识不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this. $t('frameworkThreadPool.threadPoolID') })); return; } this.listLoading = true; @@ -333,7 +333,7 @@ export default { if (valid) { if (parseInt(this.temp.maximumSize) < parseInt(this.temp.coreSize)) { this.$message({ - message: '最大线程必须大于等于核心线程', + message: this.$t('threadPool.threadsNumErrorTip'), type: 'warning', }); return; @@ -385,13 +385,13 @@ export default { }) .catch((error) => { console.log(error); - this.$message.error('修改线程池失败'); + this.$message.error(this.$t('message.updateFailure')); }); }, 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', }); }, @@ -497,7 +497,7 @@ export default { }) .catch((error) => { console.log(error); - this.$message.error('查询失败,请尝试刷新页面'); + this.$message.error(this.$t('message.queryFailure')); }); }, }, diff --git a/hippo4j-ui/src/views/hippo4j/other/hystrix/index.vue b/hippo4j-ui/src/views/hippo4j/other/hystrix/index.vue index 1162ed67..79dc1f2d 100755 --- a/hippo4j-ui/src/views/hippo4j/other/hystrix/index.vue +++ b/hippo4j-ui/src/views/hippo4j/other/hystrix/index.vue @@ -3,7 +3,7 @@
- 搜索 + {{ $t('common.query') }} - 重置 + {{ $t('common.reset') }}
- + - + - + - + - + - + @@ -110,7 +110,7 @@ --> - + @@ -134,7 +134,7 @@ label-position="left" label-width="110px" > - + - + - +
@@ -283,19 +283,19 @@ export default { }, fetchData() { if (!this.listQuery.mark) { - this.$message.warning('线程池类型不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this. $t('frameworkThreadPool.threadPoolType') })); return; } if (!this.listQuery.tenantId) { - this.$message.warning('租户不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') })); return; } if (!this.listQuery.itemId) { - this.$message.warning('项目不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('projectManage.item') })); return; } if (!this.listQuery.threadPoolKey) { - this.$message.warning('线程池标识不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this. $t('frameworkThreadPool.threadPoolID') })); return; } this.listLoading = true; @@ -333,7 +333,7 @@ export default { if (valid) { if (parseInt(this.temp.maximumSize) < parseInt(this.temp.coreSize)) { this.$message({ - message: '最大线程必须大于等于核心线程', + message: this.$t('threadPool.threadsNumErrorTip'), type: 'warning', }); return; @@ -385,13 +385,13 @@ export default { }) .catch((error) => { console.log(error); - this.$message.error('修改线程池失败'); + this.$message.error(this.$t('message.updateFailure')); }); }, 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', }); }, @@ -497,7 +497,7 @@ export default { }) .catch((error) => { console.log(error); - this.$message.error('查询失败,请尝试刷新页面'); + this.$message.error(this.$t('message.queryFailure')); }); }, }, diff --git a/hippo4j-ui/src/views/hippo4j/other/rabbitmq-stream/index.vue b/hippo4j-ui/src/views/hippo4j/other/rabbitmq-stream/index.vue index b2c4918c..14b72fc9 100755 --- a/hippo4j-ui/src/views/hippo4j/other/rabbitmq-stream/index.vue +++ b/hippo4j-ui/src/views/hippo4j/other/rabbitmq-stream/index.vue @@ -3,7 +3,7 @@
- 搜索 + {{ $t('common.query') }} - 重置 + {{ $t('common.reset') }}
- + - + - + - + - + - + @@ -110,7 +110,7 @@ --> - + @@ -133,7 +133,7 @@ label-position="left" label-width="110px" > - + - + - +
@@ -282,19 +282,19 @@ export default { }, fetchData() { if (!this.listQuery.mark) { - this.$message.warning('线程池类型不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this. $t('frameworkThreadPool.threadPoolType') })); return; } if (!this.listQuery.tenantId) { - this.$message.warning('租户不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') })); return; } if (!this.listQuery.itemId) { - this.$message.warning('项目不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('projectManage.item') })); return; } if (!this.listQuery.threadPoolKey) { - this.$message.warning('线程池标识不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this. $t('frameworkThreadPool.threadPoolID') })); return; } this.listLoading = true; @@ -332,7 +332,7 @@ export default { if (valid) { if (parseInt(this.temp.maximumSize) < parseInt(this.temp.coreSize)) { this.$message({ - message: '最大线程必须大于等于核心线程', + message: this.$t('threadPool.threadsNumErrorTip'), type: 'warning', }); return; @@ -384,13 +384,13 @@ export default { }) .catch((error) => { console.log(error); - this.$message.error('修改线程池失败'); + this.$message.error(this.$t('message.updateFailure')); }); }, 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', }); }, @@ -496,7 +496,7 @@ export default { }) .catch((error) => { console.log(error); - this.$message.error('查询失败,请尝试刷新页面'); + this.$message.error(this.$t('message.queryFailure')); }); }, }, diff --git a/hippo4j-ui/src/views/hippo4j/other/rabbitmq/index.vue b/hippo4j-ui/src/views/hippo4j/other/rabbitmq/index.vue index 9dabd398..adf993e9 100755 --- a/hippo4j-ui/src/views/hippo4j/other/rabbitmq/index.vue +++ b/hippo4j-ui/src/views/hippo4j/other/rabbitmq/index.vue @@ -3,7 +3,7 @@
- 搜索 + {{ $t('common.query') }} - 重置 + {{ $t('common.reset') }}
- + - + - + - + - + - + @@ -110,7 +110,7 @@ --> - + @@ -134,7 +134,7 @@ label-position="left" label-width="110px" > - + - + - +
@@ -283,19 +283,19 @@ export default { }, fetchData() { if (!this.listQuery.mark) { - this.$message.warning('线程池类型不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this. $t('frameworkThreadPool.threadPoolType') })); return; } if (!this.listQuery.tenantId) { - this.$message.warning('租户不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') })); return; } if (!this.listQuery.itemId) { - this.$message.warning('项目不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('projectManage.item') })); return; } if (!this.listQuery.threadPoolKey) { - this.$message.warning('线程池标识不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this. $t('frameworkThreadPool.threadPoolID') })); return; } this.listLoading = true; @@ -333,7 +333,7 @@ export default { if (valid) { if (parseInt(this.temp.maximumSize) < parseInt(this.temp.coreSize)) { this.$message({ - message: '最大线程必须大于等于核心线程', + message: this.$t('threadPool.threadsNumErrorTip'), type: 'warning', }); return; @@ -381,13 +381,13 @@ export default { }) .catch((error) => { console.log(error); - this.$message.error('修改线程池失败'); + this.$message.error(this.$t('message.updateFailure')); }); }, 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', }); }, @@ -493,7 +493,7 @@ export default { }) .catch((error) => { console.log(error); - this.$message.error('查询失败,请尝试刷新页面'); + this.$message.error(this.$t('message.queryFailure')); }); }, }, diff --git a/hippo4j-ui/src/views/hippo4j/other/rocketmq-stream/index.vue b/hippo4j-ui/src/views/hippo4j/other/rocketmq-stream/index.vue index f64b9c78..5bea453b 100755 --- a/hippo4j-ui/src/views/hippo4j/other/rocketmq-stream/index.vue +++ b/hippo4j-ui/src/views/hippo4j/other/rocketmq-stream/index.vue @@ -3,7 +3,7 @@
- 搜索 + {{ $t('common.query') }} - 重置 + {{ $t('common.reset') }}
- + - + - + - + - + - + @@ -110,7 +110,7 @@ --> - + @@ -133,7 +133,7 @@ label-position="left" label-width="110px" > - + - + - +
@@ -282,19 +282,19 @@ export default { }, fetchData() { if (!this.listQuery.mark) { - this.$message.warning('线程池类型不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this. $t('frameworkThreadPool.threadPoolType') })); return; } if (!this.listQuery.tenantId) { - this.$message.warning('租户不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') })); return; } if (!this.listQuery.itemId) { - this.$message.warning('项目不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('projectManage.item') })); return; } if (!this.listQuery.threadPoolKey) { - this.$message.warning('线程池标识不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this. $t('frameworkThreadPool.threadPoolID') })); return; } this.listLoading = true; @@ -332,7 +332,7 @@ export default { if (valid) { if (parseInt(this.temp.maximumSize) < parseInt(this.temp.coreSize)) { this.$message({ - message: '最大线程必须大于等于核心线程', + message: this.$t('threadPool.threadsNumErrorTip'), type: 'warning', }); return; @@ -384,13 +384,13 @@ export default { }) .catch((error) => { console.log(error); - this.$message.error('修改线程池失败'); + this.$message.error(this.$t('message.updateFailure')); }); }, 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', }); }, @@ -496,7 +496,7 @@ export default { }) .catch((error) => { console.log(error); - this.$message.error('查询失败,请尝试刷新页面'); + this.$message.error(this.$t('message.queryFailure')); }); }, }, diff --git a/hippo4j-ui/src/views/hippo4j/other/rocketmq/index.vue b/hippo4j-ui/src/views/hippo4j/other/rocketmq/index.vue index 17c4fb9a..a37fd516 100755 --- a/hippo4j-ui/src/views/hippo4j/other/rocketmq/index.vue +++ b/hippo4j-ui/src/views/hippo4j/other/rocketmq/index.vue @@ -3,7 +3,7 @@
- 搜索 + {{ $t('common.query') }} - 重置 + {{ $t('common.reset') }}
- + - + - + - + - + - + @@ -110,7 +110,7 @@ --> - + @@ -134,7 +134,7 @@ label-position="left" label-width="110px" > - + - + - +
@@ -283,19 +283,19 @@ export default { }, fetchData() { if (!this.listQuery.mark) { - this.$message.warning('线程池类型不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this. $t('frameworkThreadPool.threadPoolType') })); return; } if (!this.listQuery.tenantId) { - this.$message.warning('租户不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') })); return; } if (!this.listQuery.itemId) { - this.$message.warning('项目不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('projectManage.item') })); return; } if (!this.listQuery.threadPoolKey) { - this.$message.warning('线程池标识不允许为空'); + this.$message.warning(this.$t('message.emptyWarning', { name: this. $t('frameworkThreadPool.threadPoolID') })); return; } this.listLoading = true; @@ -333,7 +333,7 @@ export default { if (valid) { if (parseInt(this.temp.maximumSize) < parseInt(this.temp.coreSize)) { this.$message({ - message: '最大线程必须大于等于核心线程', + message: this.$t('threadPool.threadsNumErrorTip'), type: 'warning', }); return; @@ -385,13 +385,13 @@ export default { }) .catch((error) => { console.log(error); - this.$message.error('修改线程池失败'); + this.$message.error(this.$t('message.updateFailure')); }); }, 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', }); }, @@ -497,7 +497,7 @@ export default { }) .catch((error) => { console.log(error); - this.$message.error('查询失败,请尝试刷新页面'); + this.$message.error(this.$t('message.queryFailure')); }); }, }, From 8718e1aebd60bff65884bfc04f456209c8c5311e Mon Sep 17 00:00:00 2001 From: Svamei <41992090+Svamei@users.noreply.github.com> Date: Sat, 1 Apr 2023 09:48:09 +0800 Subject: [PATCH 09/15] Complete the text translation of the 'Thread Pool Audit' page (#1141) * Complete the text translation of the 'Thread Pool Audit' page * Fix change types in thread pool auditing Fix change types in thread pool auditing --- 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..d2a5c331 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') }}
- + - + - + - + - - + + - + - + - - + + - + - + - + @@ -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')); }); }, 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 10/15] 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') }}
- + - + - + - + - + - + - + - + - + - + - + @@ -157,10 +157,10 @@ :model="temp" label-width="80px" > - + - + - + @@ -205,7 +205,7 @@ - + - + - + @@ -248,10 +248,10 @@ - + - + - + @@ -293,7 +290,7 @@ - Confirm + {{ $t('common.confirm') }} @@ -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' }]; } }, From 17a5f13ae791b20ee61e865216ab519a135d83d5 Mon Sep 17 00:00:00 2001 From: Svamei <41992090+Svamei@users.noreply.github.com> Date: Sun, 2 Apr 2023 10:52:27 +0800 Subject: [PATCH 11/15] Complete the text translation of the 'User Authority' page (#1143) --- hippo4j-ui/src/locale/lang/en.js | 7 ++ hippo4j-ui/src/locale/lang/zh.js | 7 ++ hippo4j-ui/src/views/hippo4j/user/index.vue | 79 +++++++++++---------- 3 files changed, 57 insertions(+), 36 deletions(-) diff --git a/hippo4j-ui/src/locale/lang/en.js b/hippo4j-ui/src/locale/lang/en.js index cefc21c1..556f35ad 100644 --- a/hippo4j-ui/src/locale/lang/en.js +++ b/hippo4j-ui/src/locale/lang/en.js @@ -186,4 +186,11 @@ export default { '-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@' }, + + //用户权限 + userAuthority: { + userName: 'User Name', + role: 'Role', + password: 'Password' + }, } diff --git a/hippo4j-ui/src/locale/lang/zh.js b/hippo4j-ui/src/locale/lang/zh.js index b1220121..1ef2609a 100644 --- a/hippo4j-ui/src/locale/lang/zh.js +++ b/hippo4j-ui/src/locale/lang/zh.js @@ -186,4 +186,11 @@ export default { '- 企微:填写user_id会以@的消息发给用户,否则填写姓名,如:小马哥\n' + '- 飞书:填写ou_开头用户唯一标识会以@的消息发给用户,填写手机号则是普通的@"' }, + + //用户权限 + userAuthority: { + userName: '用户名', + role: '角色', + password: '密码' + }, } diff --git a/hippo4j-ui/src/views/hippo4j/user/index.vue b/hippo4j-ui/src/views/hippo4j/user/index.vue index a895f205..10171a41 100755 --- a/hippo4j-ui/src/views/hippo4j/user/index.vue +++ b/hippo4j-ui/src/views/hippo4j/user/index.vue @@ -3,7 +3,7 @@
@@ -14,7 +14,7 @@ icon="el-icon-search" @click="fetchData" > - 搜索 + {{ $t('common.query') }} - 添加 + {{ $t('common.insert') }}
- + - + - + - + - + - + @@ -85,38 +85,38 @@ label-width="100px" style="width: 400px; margin-left: 50px" > - + - - + + - + - + {{ - tenantKey - }} + tenantKey + }} @@ -168,10 +168,10 @@ export default { create: 'Create', }, rules: { - role: [{ required: true, message: 'role is required', trigger: 'change' }], - userName: [{ required: true, message: 'userName is required', trigger: 'blur' }], - tenants: [{ required: false, message: 'tenants is required', trigger: 'blur' }], - password: [{ required: false, message: 'password is required', trigger: 'blur' }], + role: [{ required: true, message: this.$t('message.requiredError'), trigger: 'change' }], + userName: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + tenants: [{ required: false, message: this.$t('message.requiredError'), trigger: 'blur' }], + password: [{ required: false, message: this.$t('message.requiredError'), trigger: 'blur' }], }, temp: { id: undefined, @@ -182,7 +182,14 @@ export default { resources: [], }, resetTemp() { - this.temp = this.$options.data().temp; + this.temp = { + id: undefined, + role: '', + userName: '', + password: '', + permission: '', + resources: [], + } }, }; }, @@ -222,8 +229,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, }); @@ -256,8 +263,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, }); @@ -266,9 +273,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', }); }, @@ -277,8 +284,8 @@ export default { user.deleteUser(row.userName).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, }); From 3db4838884bac37bfaf69c3b589a5ecd75be9104 Mon Sep 17 00:00:00 2001 From: Svamei <41992090+Svamei@users.noreply.github.com> Date: Sun, 2 Apr 2023 23:56:34 +0800 Subject: [PATCH 12/15] Complete the text translation of the 'Log Manage' page (#1144) --- hippo4j-ui/src/locale/lang/en.js | 8 ++++ hippo4j-ui/src/locale/lang/zh.js | 8 ++++ hippo4j-ui/src/views/hippo4j/log/index.vue | 56 +++++++++++----------- 3 files changed, 44 insertions(+), 28 deletions(-) diff --git a/hippo4j-ui/src/locale/lang/en.js b/hippo4j-ui/src/locale/lang/en.js index 556f35ad..69edb843 100644 --- a/hippo4j-ui/src/locale/lang/en.js +++ b/hippo4j-ui/src/locale/lang/en.js @@ -193,4 +193,12 @@ export default { role: 'Role', password: 'Password' }, + + //日志管理 + logManage: { + bizType: 'Biz Type', + bizID: 'Biz ID', + operator: 'Operator', + logContent: 'Log Content', + }, } diff --git a/hippo4j-ui/src/locale/lang/zh.js b/hippo4j-ui/src/locale/lang/zh.js index 1ef2609a..930effce 100644 --- a/hippo4j-ui/src/locale/lang/zh.js +++ b/hippo4j-ui/src/locale/lang/zh.js @@ -193,4 +193,12 @@ export default { role: '角色', password: '密码' }, + + //日志管理 + logManage: { + bizType: '业务类型', + bizID: '业务标识', + operator: '操作人', + logContent: '日志内容', + }, } diff --git a/hippo4j-ui/src/views/hippo4j/log/index.vue b/hippo4j-ui/src/views/hippo4j/log/index.vue index a06be2bb..dbe0e3c3 100755 --- a/hippo4j-ui/src/views/hippo4j/log/index.vue +++ b/hippo4j-ui/src/views/hippo4j/log/index.vue @@ -4,21 +4,21 @@ @@ -29,7 +29,7 @@ icon="el-icon-search" @click="fetchData" > - 搜索 + {{ $t('common.query') }} - + - + - + - + - + - + @@ -80,45 +80,45 @@ - + - + - + - + - + @@ -227,8 +227,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, }); @@ -252,8 +252,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, }); @@ -266,8 +266,8 @@ export default { jobProjectApi.deleted(row.tenantId).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, }); From 9676b6a4be1fd6c48b0a85c21ee39eb593994a06 Mon Sep 17 00:00:00 2001 From: Svamei <41992090+Svamei@users.noreply.github.com> Date: Mon, 3 Apr 2023 13:22:15 +0800 Subject: [PATCH 13/15] Complete the text translation of the 'Sidebar Menu' (#1145) --- .../src/components/Breadcrumb/index.vue | 4 +- hippo4j-ui/src/layout/components/Navbar.vue | 2 +- .../layout/components/Sidebar/SidebarItem.vue | 4 +- hippo4j-ui/src/locale/lang/en.js | 28 +++++++++ hippo4j-ui/src/locale/lang/zh.js | 28 +++++++++ hippo4j-ui/src/permission.js | 3 +- hippo4j-ui/src/router/index.js | 60 +++++++++---------- 7 files changed, 93 insertions(+), 36 deletions(-) diff --git a/hippo4j-ui/src/components/Breadcrumb/index.vue b/hippo4j-ui/src/components/Breadcrumb/index.vue index e224ff73..0637e734 100755 --- a/hippo4j-ui/src/components/Breadcrumb/index.vue +++ b/hippo4j-ui/src/components/Breadcrumb/index.vue @@ -2,8 +2,8 @@ - {{ item.meta.title }} - {{ item.meta.title }} + {{ $t(item.meta.title) }} + {{ $t(item.meta.title) }} diff --git a/hippo4j-ui/src/layout/components/Navbar.vue b/hippo4j-ui/src/layout/components/Navbar.vue index 283431ff..57cbb912 100755 --- a/hippo4j-ui/src/layout/components/Navbar.vue +++ b/hippo4j-ui/src/layout/components/Navbar.vue @@ -29,7 +29,7 @@ Profile --> - Dashboard + {{ this.$t('menu.dashboard') }} {{ $t('system.logOut') }} diff --git a/hippo4j-ui/src/layout/components/Sidebar/SidebarItem.vue b/hippo4j-ui/src/layout/components/Sidebar/SidebarItem.vue index 4a3c1a0b..52746998 100755 --- a/hippo4j-ui/src/layout/components/Sidebar/SidebarItem.vue +++ b/hippo4j-ui/src/layout/components/Sidebar/SidebarItem.vue @@ -3,14 +3,14 @@ { NProgress.start(); // set page title - document.title = getPageTitle(to.meta.title); + document.title = getPageTitle(i18n.t(to.meta.title)); // determine whether the user has logged in const hasToken = getToken(); diff --git a/hippo4j-ui/src/router/index.js b/hippo4j-ui/src/router/index.js index 3e1b5c9a..bf3e9fd1 100755 --- a/hippo4j-ui/src/router/index.js +++ b/hippo4j-ui/src/router/index.js @@ -47,7 +47,7 @@ export const constantRoutes = [ path: 'dashboard', component: () => import('@/views/dashboard/admin/index'), name: 'Dashboard', - meta: { title: '运行报表', icon: 'dashboard2', affix: true }, + meta: { title: 'menu.dashboard', icon: 'dashboard2', affix: true }, }, ], }, @@ -107,13 +107,13 @@ export const asyncRoutes = [ component: Layout, redirect: '/hippo4j/tenantList', name: 'tenant', - meta: { title: '租户管理', icon: 'lessee' }, + meta: { title: 'menu.tenantManage', icon: 'lessee' }, children: [ { path: 'index', name: 'index', component: () => import('@/views/hippo4j/tenant/index'), - meta: { title: '租户管理', icon: 'lessee' }, + meta: { title: 'menu.tenantManage', icon: 'lessee' }, }, ], }, @@ -122,13 +122,13 @@ export const asyncRoutes = [ component: Layout, redirect: '/hippo4j/itemList', name: 'item', - meta: { title: '项目管理', icon: 'item' }, + meta: { title: 'menu.itemManage', icon: 'item' }, children: [ { path: 'index', name: 'index', component: () => import('@/views/hippo4j/item/index'), - meta: { title: '项目管理', icon: 'item' }, + meta: { title: 'menu.itemManage', icon: 'item' }, }, ], }, @@ -138,25 +138,25 @@ export const asyncRoutes = [ component: Layout, redirect: '/hippo4j/dynamic/thread-pool', name: 'thread-pool', - meta: { title: '动态线程池', icon: 'pool' }, + meta: { title: 'menu.dynamicThreadPool', icon: 'pool' }, children: [ { path: 'index', name: 'index', component: () => import('@/views/hippo4j/threadpool/index'), - meta: { title: '线程池管理' }, + meta: { title: 'menu.threadPoolManage' }, }, { path: 'instance', name: 'instance', component: () => import('@/views/hippo4j/instance/index'), - meta: { title: '线程池实例' }, + meta: { title: 'menu.threadPoolInstance' }, }, { path: 'monitor', name: 'monitor', component: () => import('@/views/hippo4j/monitor/index'), - meta: { title: '线程池监控' }, + meta: { title: 'menu.threadPoolMonitor' }, }, ], }, @@ -165,25 +165,25 @@ export const asyncRoutes = [ component: Layout, redirect: '/hippo4j/server', name: 'server-thread-pool', - meta: { title: '容器线程池', icon: 'vessel' }, + meta: { title: 'menu.containerThreadPool', icon: 'vessel' }, children: [ { path: 'tomcat', name: 'tomcat', component: () => import('@/views/hippo4j/server/tomcat/index'), - meta: { title: 'Tomcat' }, + meta: { title: 'menu.tomcat' }, }, { path: 'undertow', name: 'undertow', component: () => import('@/views/hippo4j/server/undertow/index'), - meta: { title: 'Undertow' }, + meta: { title: 'menu.undertow' }, }, { path: 'jetty', name: 'jetty', component: () => import('@/views/hippo4j/server/jetty/index'), - meta: { title: 'Jetty' }, + meta: { title: 'menu.jetty' }, }, ], }, @@ -192,49 +192,49 @@ export const asyncRoutes = [ component: Layout, redirect: '/hippo4j/other', name: 'other-thread-pool', - meta: { title: '框架线程池', icon: 'other' }, + meta: { title: 'menu.frameworkThreadPool', icon: 'other' }, children: [ { path: 'dubbo', name: 'dubbo', component: () => import('@/views/hippo4j/other/dubbo/index'), - meta: { title: 'Dubbo' }, + meta: { title: 'menu.dubbo' }, }, { path: 'hystrix', name: 'hystrix', component: () => import('@/views/hippo4j/other/hystrix/index'), - meta: { title: 'Hystrix' }, + meta: { title: 'menu.hystrix' }, }, { path: 'rabbitmq', name: 'rabbitmq', component: () => import('@/views/hippo4j/other/rabbitmq/index'), - meta: { title: 'RabbitMQ' }, + meta: { title: 'menu.rabbitMQ' }, }, { path: 'rocketmq', name: 'rocketmq', component: () => import('@/views/hippo4j/other/rocketmq/index'), - meta: { title: 'RocketMQ' }, + meta: { title: 'menu.rocketMQ' }, }, { path: 'alibaba-dubbo', name: 'alibaba-dubbo', component: () => import('@/views/hippo4j/other/alibaba-dubbo/index'), - meta: { title: 'AlibabaDubbo' }, + meta: { title: 'menu.alibabaDubbo' }, }, { path: 'rabbitmq-stream', name: 'rabbitmq-stream', component: () => import('@/views/hippo4j/other/rabbitmq-stream/index'), - meta: { title: 'RabbitMQStream' }, + meta: { title: 'menu.rabbitMQStream' }, }, { path: 'rocketmq-stream', name: 'rocketmq-stream', component: () => import('@/views/hippo4j/other/rocketmq-stream/index'), - meta: { title: 'RocketMQStream' }, + meta: { title: 'menu.rocketMQStream' }, }, ], }, @@ -243,13 +243,13 @@ export const asyncRoutes = [ component: Layout, redirect: '/hippo4j/verifyList', name: 'config-modification-verify', - meta: { title: '线程池审核', icon: 'audit', roles: ['ROLE_MANAGE', 'ROLE_ADMIN'] }, + meta: { title: 'menu.threadPoolAudit', icon: 'audit', roles: ['ROLE_MANAGE', 'ROLE_ADMIN'] }, children: [ { path: 'index', name: 'index', component: () => import('@/views/hippo4j/verify/index'), - meta: { title: '线程池审核', icon: 'audit' }, + meta: { title: 'menu.threadPoolAudit', icon: 'audit' }, }, ], }, @@ -258,13 +258,13 @@ export const asyncRoutes = [ component: Layout, redirect: '/hippo4j/notifyList', name: 'notify', - meta: { title: '通知报警', icon: 'notify' }, + meta: { title: 'menu.notifyAlarm', icon: 'notify' }, children: [ { path: 'index', name: 'index', component: () => import('@/views/hippo4j/notify/index'), - meta: { title: '通知报警', icon: 'notify' }, + meta: { title: 'menu.notifyAlarm', icon: 'notify' }, }, ], }, @@ -273,13 +273,13 @@ export const asyncRoutes = [ component: Layout, redirect: '/hippo4j/userList', name: 'user', - meta: { title: '用户权限', icon: 'user', roles: ['ROLE_ADMIN'] }, + meta: { title: 'menu.userAuthority', icon: 'user', roles: ['ROLE_ADMIN'] }, children: [ { path: 'index', name: 'index', component: () => import('@/views/hippo4j/user/index'), - meta: { title: '用户权限', icon: 'user' }, + meta: { title: 'menu.userAuthority', icon: 'user' }, }, ], }, @@ -288,13 +288,13 @@ export const asyncRoutes = [ component: Layout, redirect: '/hippo4j/logList', name: 'log', - meta: { title: '日志管理', icon: 'log' }, + meta: { title: 'menu.logManage', icon: 'log' }, children: [ { path: 'index', name: 'index', component: () => import('@/views/hippo4j/log/index'), - meta: { title: '日志管理', icon: 'log' }, + meta: { title: 'menu.logManage', icon: 'log' }, }, ], }, @@ -305,7 +305,7 @@ export const asyncRoutes = [ children: [ { path: 'https://hippo4j.cn', - meta: { title: '官网外链', icon: 'link' }, + meta: { title: 'menu.officialWebsite', icon: 'link' }, }, ], }, From 295085fcfa73cba648bd19552e84989101c52b06 Mon Sep 17 00:00:00 2001 From: "L.J.Ran" Date: Tue, 4 Apr 2023 14:29:32 +0800 Subject: [PATCH 14/15] fix: Support for a minimum timeout value of -1 in thread pool execution(#1069) (#1147) --- hippo4j-ui/src/views/hippo4j/instance/index.vue | 2 +- hippo4j-ui/src/views/hippo4j/threadpool/index.vue | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hippo4j-ui/src/views/hippo4j/instance/index.vue b/hippo4j-ui/src/views/hippo4j/instance/index.vue index 3c750ac4..f88ad0c3 100755 --- a/hippo4j-ui/src/views/hippo4j/instance/index.vue +++ b/hippo4j-ui/src/views/hippo4j/instance/index.vue @@ -358,7 +358,7 @@ v-model="temp.executeTimeOut" :placeholder="$t('threadPool.executionTimeoutUnit')" controls-position="right" - :min="0" + :min="-1" :max="999999" /> diff --git a/hippo4j-ui/src/views/hippo4j/threadpool/index.vue b/hippo4j-ui/src/views/hippo4j/threadpool/index.vue index ffdd51b2..98099c81 100755 --- a/hippo4j-ui/src/views/hippo4j/threadpool/index.vue +++ b/hippo4j-ui/src/views/hippo4j/threadpool/index.vue @@ -252,6 +252,8 @@ v-model="temp.executeTimeOut" :placeholder="$t('threadPool.executionTimeoutUnit')" controls-position="right" + :min="-1" + :max="999999" /> From ffaa4fbd4d0b2547930ac6a00fae52dd545b959a Mon Sep 17 00:00:00 2001 From: Xuhao Wang <1023605039@qq.com> Date: Wed, 5 Apr 2023 21:05:35 +0800 Subject: [PATCH 15/15] Update TaskTimeoutNotifyAlarmPlugin.java (#1149) Optimize the scenario where executeTimeOut is empty or <= 0 --- .../hippo4j/core/plugin/impl/TaskTimeoutNotifyAlarmPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/plugin/impl/TaskTimeoutNotifyAlarmPlugin.java b/hippo4j-core/src/main/java/cn/hippo4j/core/plugin/impl/TaskTimeoutNotifyAlarmPlugin.java index a3026619..be5726d3 100644 --- a/hippo4j-core/src/main/java/cn/hippo4j/core/plugin/impl/TaskTimeoutNotifyAlarmPlugin.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/plugin/impl/TaskTimeoutNotifyAlarmPlugin.java @@ -94,7 +94,7 @@ public class TaskTimeoutNotifyAlarmPlugin extends AbstractTaskTimerPlugin { */ @Override protected void processTaskTime(long taskExecuteTime) { - if (taskExecuteTime <= executeTimeOut) { + if (executeTimeOut <= 0 || taskExecuteTime <= executeTimeOut) { return; } threadPoolCheckAlarm.asyncSendExecuteTimeOutAlarm(threadPoolId, taskExecuteTime, executeTimeOut, threadPoolExecutor);