Merge branch 'develop' of https://github.com/road2master/hippo4j into develop

pull/1016/head
Li 3 years ago
commit 099b6789b6

@ -21,7 +21,11 @@
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
<version>1.5.1.RELEASE</version> <version>1.5.1.RELEASE</version>
</dependency> </dependency>
<!-- <dependency>-->
<!-- <groupId>com.alibaba.boot</groupId>-->
<!-- <artifactId>nacos-config-spring-boot-starter</artifactId>-->
<!-- <version>0.1.4</version>-->
<!-- </dependency>-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId> <artifactId>spring-boot-starter</artifactId>

@ -0,0 +1,66 @@
#debug=true
server.port=8089
server.servlet.context-path=/example
management.security.enabled=false
management.context-path=/actuator
spring.profiles.active=dev
spring.application.name=hippo4j-config-nacos-spring-boot-1x-starter-example
## nacos spring-boot
nacos.config.server-addr=127.0.0.1:8848
nacos.config.ext-config[0].data-id=hippo4j-nacos.yaml
nacos.config.ext-config[0].group=DEFAULT_GROUP
nacos.config.ext-config[0].auto-refresh=true
spring.dynamic.thread-pool.enable=true
spring.dynamic.thread-pool.banner=true
spring.dynamic.thread-pool.check-state-interval=5
spring.dynamic.thread-pool.monitor.enable=true
spring.dynamic.thread-pool.monitor.collect-types=micrometer
spring.dynamic.thread-pool.monitor.thread-pool-types=dynamic,web
spring.dynamic.thread-pool.monitor.initial-delay=10000
spring.dynamic.thread-pool.monitor.collect-interval=5000
spring.dynamic.thread-pool.notify-platforms[0].platform=WECHAT
spring.dynamic.thread-pool.notify-platforms[0].token=ac0426a5-c712-474c-9bff-72b8b8f5caff
spring.dynamic.thread-pool.notify-platforms[1].platform=DING
spring.dynamic.thread-pool.notify-platforms[1].token=56417ebba6a27ca352f0de77a2ae9da66d01f39610b5ee8a6033c60ef9071c55
spring.dynamic.thread-pool.notify-platforms[2].platform=LARK
spring.dynamic.thread-pool.notify-platforms[2].token=2cbf2808-3839-4c26-a04d-fd201dd51f9e
spring.dynamic.thread-pool.nacos.data-id=hippo4j-nacos.yaml
spring.dynamic.thread-pool.nacos.group=DEFAULT_GROUP
spring.dynamic.thread-pool.config-file-type=yaml
spring.dynamic.thread-pool.executors[0].thread-pool-id=message-consume
spring.dynamic.thread-pool.executors[0].thread-name-prefix=message-consume
spring.dynamic.thread-pool.executors[0].core-pool-size=2
spring.dynamic.thread-pool.executors[0].maximum-pool-size=4
spring.dynamic.thread-pool.executors[0].queue-capacity=1024
spring.dynamic.thread-pool.executors[0].blocking-queue=ResizableCapacityLinkedBlockingQueue
spring.dynamic.thread-pool.executors[0].execute-time-out=800
spring.dynamic.thread-pool.executors[0].rejected-handler=AbortPolicy
spring.dynamic.thread-pool.executors[0].keep-alive-time=6691
spring.dynamic.thread-pool.executors[0].allow-core-thread-time-out=true
spring.dynamic.thread-pool.executors[0].alarm=true
spring.dynamic.thread-pool.executors[0].active-alarm=80
spring.dynamic.thread-pool.executors[0].capacity-alarm=80
spring.dynamic.thread-pool.executors[0].notify.interval=8
spring.dynamic.thread-pool.executors[0].notify.receives=chen.ma
spring.dynamic.thread-pool.executors[1].thread-pool-id=message-produce
spring.dynamic.thread-pool.executors[1].thread-name-prefix=message-produce
spring.dynamic.thread-pool.executors[1].core-pool-size=2
spring.dynamic.thread-pool.executors[1].maximum-pool-size=4
spring.dynamic.thread-pool.executors[1].queue-capacity=1024
spring.dynamic.thread-pool.executors[1].blocking-queue=ResizableCapacityLinkedBlockingQueue
spring.dynamic.thread-pool.executors[1].execute-time-out=800
spring.dynamic.thread-pool.executors[1].rejected-handler=AbortPolicy
spring.dynamic.thread-pool.executors[1].keep-alive-time=6691
spring.dynamic.thread-pool.executors[1].allow-core-thread-time-out=true
spring.dynamic.thread-pool.executors[1].alarm=true
spring.dynamic.thread-pool.executors[1].active-alarm=80
spring.dynamic.thread-pool.executors[1].capacity-alarm=80
spring.dynamic.thread-pool.executors[1].notify.interval=8
spring.dynamic.thread-pool.executors[1].notify.receives=chen.ma

@ -8,6 +8,7 @@ management.context-path=/actuator
spring.profiles.active=dev spring.profiles.active=dev
spring.application.name=hippo4j-config-nacos-spring-boot-1x-starter-example spring.application.name=hippo4j-config-nacos-spring-boot-1x-starter-example
# nacos spring-cloud
spring.cloud.nacos.config.server-addr=127.0.0.1:8848 spring.cloud.nacos.config.server-addr=127.0.0.1:8848
spring.cloud.nacos.config.ext-config[0].data-id=hippo4j-nacos.yaml spring.cloud.nacos.config.ext-config[0].data-id=hippo4j-nacos.yaml
spring.cloud.nacos.config.ext-config[0].group=DEFAULT_GROUP spring.cloud.nacos.config.ext-config[0].group=DEFAULT_GROUP

@ -17,15 +17,21 @@
package cn.hippo4j.config.springboot.starter.config; package cn.hippo4j.config.springboot.starter.config;
import cn.hippo4j.config.springboot.starter.refresher.*; import cn.hippo4j.config.springboot.starter.refresher.ApolloRefresherHandler;
import com.alibaba.cloud.nacos.NacosConfigManager; import cn.hippo4j.config.springboot.starter.refresher.BootstrapConfigPropertiesBinderAdapt;
import cn.hippo4j.config.springboot.starter.refresher.ConsulRefresherHandler;
import cn.hippo4j.config.springboot.starter.refresher.DefaultBootstrapConfigPropertiesBinderAdapt;
import cn.hippo4j.config.springboot.starter.refresher.EtcdRefresherHandler;
import cn.hippo4j.config.springboot.starter.refresher.NacosCloudRefresherHandler;
import cn.hippo4j.config.springboot.starter.refresher.NacosRefresherHandler;
import cn.hippo4j.config.springboot.starter.refresher.PolarisRefresherHandler;
import cn.hippo4j.config.springboot.starter.refresher.ZookeeperRefresherHandler;
import com.alibaba.cloud.nacos.NacosConfigProperties; import com.alibaba.cloud.nacos.NacosConfigProperties;
import com.alibaba.nacos.api.config.ConfigService; import com.alibaba.nacos.api.config.ConfigService;
import com.tencent.polaris.configuration.api.core.ConfigFileService; import com.tencent.polaris.configuration.api.core.ConfigFileService;
import io.etcd.jetcd.Client; import io.etcd.jetcd.Client;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFramework;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
@ -42,6 +48,8 @@ public class ConfigHandlerConfiguration {
private static final String NACOS_CONFIG_MANAGER_KEY = "com.alibaba.cloud.nacos.NacosConfigManager"; private static final String NACOS_CONFIG_MANAGER_KEY = "com.alibaba.cloud.nacos.NacosConfigManager";
private static final String NACOS_INJECTED_BEAN_NAME = "com.alibaba.nacos.spring.beans.factory.annotation.AnnotationNacosInjectedBeanPostProcessor";
private static final String NACOS_DATA_ID_KEY = "nacos.data-id"; private static final String NACOS_DATA_ID_KEY = "nacos.data-id";
private static final String APOLLO_NAMESPACE_KEY = "apollo.namespace"; private static final String APOLLO_NAMESPACE_KEY = "apollo.namespace";
@ -61,18 +69,18 @@ public class ConfigHandlerConfiguration {
} }
@RequiredArgsConstructor @RequiredArgsConstructor
@ConditionalOnClass(ConfigService.class) @ConditionalOnClass(value = ConfigService.class, name = NACOS_INJECTED_BEAN_NAME)
@ConditionalOnMissingClass(NACOS_CONFIG_MANAGER_KEY) @ConditionalOnMissingClass(NACOS_CONFIG_MANAGER_KEY)
@ConditionalOnProperty(prefix = BootstrapConfigProperties.PREFIX, name = NACOS_DATA_ID_KEY) @ConditionalOnProperty(prefix = BootstrapConfigProperties.PREFIX, name = NACOS_DATA_ID_KEY)
static class EmbeddedNacos { static class EmbeddedNacos {
@Bean @Bean
public NacosRefresherHandler nacosRefresherHandler(NacosConfigProperties nacosConfigProperties) { public NacosRefresherHandler nacosRefresherHandler() {
return new NacosRefresherHandler(nacosConfigProperties); return new NacosRefresherHandler();
} }
} }
@ConditionalOnClass(NacosConfigManager.class) @ConditionalOnClass(NacosConfigProperties.class)
@ConditionalOnProperty(prefix = BootstrapConfigProperties.PREFIX, name = NACOS_DATA_ID_KEY) @ConditionalOnProperty(prefix = BootstrapConfigProperties.PREFIX, name = NACOS_DATA_ID_KEY)
static class EmbeddedNacosCloud { static class EmbeddedNacosCloud {

@ -18,7 +18,8 @@
package cn.hippo4j.config.springboot.starter.refresher; package cn.hippo4j.config.springboot.starter.refresher;
import cn.hippo4j.common.config.ApplicationContextHolder; import cn.hippo4j.common.config.ApplicationContextHolder;
import com.alibaba.cloud.nacos.NacosConfigManager; import com.alibaba.cloud.nacos.NacosConfigProperties;
import com.alibaba.nacos.api.config.ConfigService;
import com.alibaba.nacos.api.config.listener.Listener; import com.alibaba.nacos.api.config.listener.Listener;
import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.api.exception.NacosException;
import lombok.SneakyThrows; import lombok.SneakyThrows;
@ -37,17 +38,17 @@ public class NacosCloudRefresherHandler extends AbstractConfigThreadPoolDynamicR
static final String GROUP = "group"; static final String GROUP = "group";
private final NacosConfigManager nacosConfigManager; private final ConfigService configService;
public NacosCloudRefresherHandler() { public NacosCloudRefresherHandler() {
nacosConfigManager = ApplicationContextHolder.getBean(NacosConfigManager.class); configService = ApplicationContextHolder.getBean(NacosConfigProperties.class).configServiceInstance();
} }
@SneakyThrows(NacosException.class) @SneakyThrows(NacosException.class)
@Override @Override
public void initRegisterListener() { public void initRegisterListener() {
Map<String, String> nacosConfig = bootstrapConfigProperties.getNacos(); Map<String, String> nacosConfig = bootstrapConfigProperties.getNacos();
nacosConfigManager.getConfigService().addListener(nacosConfig.get(DATA_ID), configService.addListener(nacosConfig.get(DATA_ID),
nacosConfig.get(GROUP), new Listener() { nacosConfig.get(GROUP), new Listener() {
@Override @Override

@ -17,7 +17,6 @@
package cn.hippo4j.config.springboot.starter.refresher; package cn.hippo4j.config.springboot.starter.refresher;
import com.alibaba.cloud.nacos.NacosConfigProperties;
import com.alibaba.nacos.api.annotation.NacosInjected; import com.alibaba.nacos.api.annotation.NacosInjected;
import com.alibaba.nacos.api.config.ConfigService; import com.alibaba.nacos.api.config.ConfigService;
import com.alibaba.nacos.api.config.listener.Listener; import com.alibaba.nacos.api.config.listener.Listener;
@ -41,8 +40,8 @@ public class NacosRefresherHandler extends AbstractConfigThreadPoolDynamicRefres
@NacosInjected @NacosInjected
private ConfigService configService; private ConfigService configService;
public NacosRefresherHandler(NacosConfigProperties nacosConfigProperties) { public NacosRefresherHandler() {
this.configService = nacosConfigProperties.configServiceInstance(); super();
} }
@SneakyThrows(NacosException.class) @SneakyThrows(NacosException.class)

@ -17,9 +17,11 @@
package cn.hippo4j.springboot.starter.monitor.local.log; package cn.hippo4j.springboot.starter.monitor.local.log;
import cn.hippo4j.adapter.web.WebThreadPoolService;
import cn.hippo4j.monitor.local.log.AdapterThreadPoolLocalLogMonitorHandler; import cn.hippo4j.monitor.local.log.AdapterThreadPoolLocalLogMonitorHandler;
import cn.hippo4j.monitor.local.log.DynamicThreadPoolLocalLogMonitorHandler; import cn.hippo4j.monitor.local.log.DynamicThreadPoolLocalLogMonitorHandler;
import cn.hippo4j.monitor.local.log.WebThreadPoolLocalLogMonitorHandler; import cn.hippo4j.monitor.local.log.WebThreadPoolLocalLogMonitorHandler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -38,6 +40,7 @@ public class LocalLogMonitorAutoConfiguration {
} }
@Bean @Bean
@ConditionalOnBean(WebThreadPoolService.class)
@ConditionalOnExpression("'${spring.dynamic.thread-pool.monitor.thread-pool-types:}'.contains('web')") @ConditionalOnExpression("'${spring.dynamic.thread-pool.monitor.thread-pool-types:}'.contains('web')")
public WebThreadPoolLocalLogMonitorHandler webThreadPoolLocalLogMonitorHandler() { public WebThreadPoolLocalLogMonitorHandler webThreadPoolLocalLogMonitorHandler() {
return new WebThreadPoolLocalLogMonitorHandler(); return new WebThreadPoolLocalLogMonitorHandler();

@ -17,9 +17,11 @@
package cn.hippo4j.springboot.starter.monitor.micrometer; package cn.hippo4j.springboot.starter.monitor.micrometer;
import cn.hippo4j.adapter.web.WebThreadPoolService;
import cn.hippo4j.monitor.micrometer.AdapterThreadPoolMicrometerMonitorHandler; import cn.hippo4j.monitor.micrometer.AdapterThreadPoolMicrometerMonitorHandler;
import cn.hippo4j.monitor.micrometer.DynamicThreadPoolMicrometerMonitorHandler; import cn.hippo4j.monitor.micrometer.DynamicThreadPoolMicrometerMonitorHandler;
import cn.hippo4j.monitor.micrometer.WebThreadPoolMicrometerMonitorHandler; import cn.hippo4j.monitor.micrometer.WebThreadPoolMicrometerMonitorHandler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -38,6 +40,7 @@ public class MicrometerMonitorAutoConfiguration {
} }
@Bean @Bean
@ConditionalOnBean(WebThreadPoolService.class)
@ConditionalOnExpression("'${spring.dynamic.thread-pool.monitor.thread-pool-types:}'.contains('web')") @ConditionalOnExpression("'${spring.dynamic.thread-pool.monitor.thread-pool-types:}'.contains('web')")
public WebThreadPoolMicrometerMonitorHandler webThreadPoolMicrometerMonitorHandler() { public WebThreadPoolMicrometerMonitorHandler webThreadPoolMicrometerMonitorHandler() {
return new WebThreadPoolMicrometerMonitorHandler(); return new WebThreadPoolMicrometerMonitorHandler();

@ -9,29 +9,38 @@ export default {
// 信息 // 信息
message: { message: {
requiredError: 'this is required',
success: 'Success', success: 'Success',
createdSuccess: 'Created Successfully', 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',
emptyWarning: "The '{name}' cannot be empty",
queryFailure: 'The query fails. Please refresh the page'
}, },
// 公共 // 公共
common: { common: {
query: 'Query', query: 'Query',
insert: 'Insert', insert: 'Insert',
serialNumber: 'Serial Number',
operation: 'Operation', operation: 'Operation',
create: 'Create', create: 'Create',
edit: 'Edit', edit: 'Edit',
delete: 'Delete', delete: 'Delete',
detail: 'Detail',
cancel: 'Cancel', cancel: 'Cancel',
confirm: 'Confirm', confirm: 'Confirm',
reset: 'Reset',
ok: 'Ok', ok: 'Ok',
threadPool: 'Thread Pool',
num: 'Num', num: 'Num',
close: 'Close',
refresh: 'Refresh',
createTime: 'Create Time', createTime: 'Create Time',
updateTime: 'Update Time', updateTime: 'Update Time',
requiredError: 'this is required', hint: 'Warning',
hint: 'Warning' info: 'Info'
}, },
// 运行报表 // 运行报表
@ -45,6 +54,7 @@ export default {
// 租户管理 // 租户管理
tenantManage: { tenantManage: {
tenant: 'Tenant', tenant: 'Tenant',
tenantRequired: 'Tenant(Required)',
tenantName: 'Tenant Name', tenantName: 'Tenant Name',
owner: 'Owner', owner: 'Owner',
tenantIntro: 'Tenant Intro' tenantIntro: 'Tenant Intro'
@ -53,15 +63,67 @@ export default {
// 项目管理 // 项目管理
projectManage: { projectManage: {
item: 'Item', item: 'Item',
itemRequired: 'Item(Required)',
itemName: 'Item Name', itemName: 'Item Name',
owner: 'Owner', owner: 'Owner',
itemIntro: 'Item Intro' itemIntro: 'Item Intro'
}, },
// 线程池 // 线程池管理
threadPool: { threadPool: {
tenant: 'Tenant', threadPool: 'Thread Pool',
project: 'Project', threadPoolRequired: 'ThreadPool(Required)',
} 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 Timeseconds',
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'
},
// 线程池实例
threadPoolInstance: {
instanceID: 'Instance ID',
active: 'Active',
stack: 'Stack',
basicInformation: 'Basic Information',
runningState: 'Running state',
activeID: 'Active',
instanceHost: 'Instance Host',
threadPoolID: 'ThreadPool ID',
LoadInformation: 'Load Information',
CurrentLoad: 'Current Load',
PeakLoad: 'Peak Load',
RemainingMemory: 'Remaining Memory',
MemoryRatio: 'Memory Ratio',
threadInformation: 'Thread Information',
currentSize: 'Current Size',
activeSize: 'Active Size',
largestSize: 'Largest Size',
queueInformation: 'Queue Information',
queueCount: 'Queue Count',
queueRemainingCapacity: 'Queue Remaining Capacity',
queueType: 'Queue Type',
otherInformation: 'Other Information',
totalTask: 'Total Task',
totalRejection: 'Total Rejection',
lastUpdateTime: 'Last update time',
allowCoreThreadTimeOut: 'Allow Core Thread Time Out',
changeAll: 'Change All',
stackRequestFail: 'The current thread pool has no stack information'
}
} }

@ -9,29 +9,38 @@ export default {
// 信息 // 信息
message: { message: {
requiredError: '这是必填项',
success: '成功', success: '成功',
createdSuccess: '创建成功', createdSuccess: '创建成功',
deleteMessage: '此操作将删除 {name}, 是否继续?' updateSuccess: '更新成功',
deleteSuccess: '删除成功',
deleteMessage: '此操作将删除 {name}, 是否继续?',
selectMessage: '请选择{target}',
NoDeletionPermissionTip: '请联系管理员删除',
emptyWarning: "{name}不允许为空",
queryFailure: '查询失败,请尝试刷新页面'
}, },
// 公共 // 公共
common: { common: {
query: '搜索', query: '搜索',
insert: '添加', insert: '添加',
serialNumber: '序号',
operation: '操作', operation: '操作',
create: '创建', create: '创建',
edit: '编辑', edit: '编辑',
delete: '删除', delete: '删除',
detail: '查看',
cancel: '取消', cancel: '取消',
confirm: '确认', confirm: '确认',
reset: '重置',
close: '关闭',
refresh: '刷新',
ok: '确定', ok: '确定',
threadPool: '线程池',
num: '序号', num: '序号',
createTime: '创建时间', createTime: '创建时间',
updateTime: '修改时间', updateTime: '修改时间',
requiredError: '这是必填项', hint: '提示',
hint: '提示' info: '详情'
}, },
// 运行报表 // 运行报表
@ -45,6 +54,7 @@ export default {
// 租户管理 // 租户管理
tenantManage: { tenantManage: {
tenant: '租户', tenant: '租户',
tenantRequired: '租户(必填)',
tenantName: '租户名称', tenantName: '租户名称',
owner: '负责人', owner: '负责人',
tenantIntro: '租户简介' tenantIntro: '租户简介'
@ -53,14 +63,68 @@ export default {
// 项目管理 // 项目管理
projectManage: { projectManage: {
item: '项目', item: '项目',
itemRequired: '项目(必填)',
itemName: '项目名称', itemName: '项目名称',
owner: '负责人', owner: '负责人',
itemIntro: '项目简介' itemIntro: '项目简介'
}, },
// 线程池 // 线程池管理
threadPool: { threadPool: {
tenant: '租户', threadPool: '线程池',
project: '项目', threadPoolRequired: '线程池(必填)',
coreSize: '核心线程',
maximumSize: '最大线程',
queueType: '队列类型',
queueCapacity: '队列容量',
rejectedHandler: '拒绝策略',
executionTimeout: '执行超时',
executionTimeoutUnit: '执行超时 (毫秒)',
keepAliveTime: '空闲回收',
keepAliveTimeUnit: '空闲回收(秒)',
isTimeout: '是否超时',
timeout: '超时',
noTimeout: '不超时',
isAlarm: '是否报警',
alarm: '报警',
noAlarm: '不报警',
activeAlarm: '活跃报警',
capacityAlarm: '容量报警',
customRejectedHandler: '自定义拒绝策略',
customRejectedHandlerTip: '请输入自定义 SPI 拒绝策略标识',
threadsNumErrorTip: '最大线程必须大于等于核心线程'
},
// 线程池实例
threadPoolInstance: {
instanceID: '实例标识',
active: 'Active',
stack: '堆栈',
basicInformation: '基础信息',
runningState: '运行状态',
activeID: '环境标识',
instanceHost: '实例Host',
threadPoolID: '线程池',
LoadInformation: '负载信息',
CurrentLoad: '当前负载',
PeakLoad: '峰值负载',
RemainingMemory: '剩余内存',
MemoryRatio: '内存占比',
threadInformation: '线程信息',
currentSize: '当前线程',
activeSize: '活跃线程',
largestSize: '同存最大线程',
queueInformation: '队列信息',
queueCount: '队列元素',
queueRemainingCapacity: '队列剩余容量',
queueType: '阻塞队列',
otherInformation: '其它信息',
totalTask: '任务总量',
totalRejection: '拒绝次数',
lastUpdateTime: '最后更新时间',
allowCoreThreadTimeOut: '线程超时',
changeAll: '全部修改',
stackRequestFail: '当前线程池暂无堆栈信息'
} }
} }

@ -18,6 +18,7 @@ import './permission'; // permission control
// import './utils/error-log' // error log // import './utils/error-log' // error log
import i18n from '@/locale' import i18n from '@/locale'
import '@/utils/i18n-utils'
import * as filters from './filters'; // global filters import * as filters from './filters'; // global filters
import echarts from 'echarts'; import echarts from 'echarts';
Vue.prototype.$echarts = echarts; Vue.prototype.$echarts = echarts;

@ -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

@ -33,7 +33,7 @@
</div> </div>
<div class="card-panel-description"> <div class="card-panel-description">
<div class="card-panel-text"> <div class="card-panel-text">
{{ $t('common.threadPool') }} {{ $t('threadPool.threadPool') }}
</div> </div>
<count-to :start-val="0" :end-val="runningCount" :duration="3200" class="card-panel-num" /> <count-to :start-val="0" :end-val="runningCount" :duration="3200" class="card-panel-num" />
</div> </div>

@ -3,7 +3,7 @@
<div class="filter-container"> <div class="filter-container">
<el-select <el-select
v-model="listQuery.tenantId" v-model="listQuery.tenantId"
placeholder="租户(必填)" :placeholder="$t('tenantManage.tenantRequired')"
style="width: 220px" style="width: 220px"
filterable filterable
class="filter-item" class="filter-item"
@ -18,7 +18,7 @@
</el-select> </el-select>
<el-select <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
placeholder="项目 (必填)" :placeholder="$t('projectManage.itemRequired')"
style="width: 220px" style="width: 220px"
filterable filterable
class="filter-item" class="filter-item"
@ -33,7 +33,7 @@
</el-select> </el-select>
<el-select <el-select
v-model="listQuery.tpId" v-model="listQuery.tpId"
placeholder="线程池 (必填)" :placeholder="$t('threadPool.threadPoolRequired')"
style="width: 220px" style="width: 220px"
filterable filterable
class="filter-item" class="filter-item"
@ -54,7 +54,7 @@
icon="el-icon-search" icon="el-icon-search"
@click="fetchData" @click="fetchData"
> >
搜索 {{ $t('common.query') }}
</el-button> </el-button>
<el-button <el-button
v-waves v-waves
@ -64,7 +64,7 @@
icon="el-icon-refresh" icon="el-icon-refresh"
@click="refreshData" @click="refreshData"
> >
重置 {{ $t('common.reset') }}
</el-button> </el-button>
</div> </div>
@ -73,51 +73,52 @@
border border
:data="list" :data="list"
element-loading-text="Loading" element-loading-text="Loading"
fit :fit="true"
max-height="714" max-height="714"
highlight-current-row highlight-current-row
header-row-name="headerRowName"
> >
<el-table-column label="序号" fixed width="95"> <el-table-column :label="$t('common.num')" fixed="left" width="95">
<template slot-scope="scope">{{ scope.$index + 1 }}</template> <template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column> </el-table-column>
<el-table-column label="实例标识" width="260"> <el-table-column :label="$t('threadPoolInstance.instanceID')" width="260">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="primary" :underline="false">{{ scope.row.identify }}</el-link> <el-link type="primary" :underline="false">{{ scope.row.identify }}</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="Active" width="120"> <el-table-column :label="$t('threadPoolInstance.active')" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="scope.row.active | statusFilter"> <el-tag :type="scope.row.active | statusFilter">
{{ scope.row.active }} {{ scope.row.active }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="核心线程" width="100"> <el-table-column :label="$t('threadPool.coreSize')" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="success" :underline="false">{{ scope.row.coreSize }}</el-link> <el-link type="success" :underline="false">{{ scope.row.coreSize }}</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="最大线程" width="100"> <el-table-column :label="$t('threadPool.maximumSize')" :width="$langMatch({ zh: '100', en: '150' }, 'auto')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="danger" :underline="false">{{ scope.row.maxSize }}</el-link> <el-link type="danger" :underline="false">{{ scope.row.maxSize }}</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="队列类型" width="260"> <el-table-column :label="$t('threadPool.queueType')" width="260">
<template slot-scope="scope">{{ scope.row.queueType | queueFilter }}</template> <template slot-scope="scope">{{ scope.row.queueType | queueFilter }}</template>
</el-table-column> </el-table-column>
<el-table-column label="队列容量" width="100"> <el-table-column :label="$t('threadPool.queueCapacity')" :width="$langMatch({ zh: '100', en: '160' }, 'auto')">
<template slot-scope="scope">{{ scope.row.capacity }}</template> <template slot-scope="scope">{{ scope.row.capacity }}</template>
</el-table-column> </el-table-column>
<el-table-column label="拒绝策略" width="260"> <el-table-column :label="$t('threadPool.rejectedHandler')" width="260">
<template slot-scope="scope">{{ scope.row.rejectedType | rejectedFilter }}</template> <template slot-scope="scope">{{ scope.row.rejectedType | rejectedFilter }}</template>
</el-table-column> </el-table-column>
<el-table-column label="执行超时" width="100"> <el-table-column :label="$t('threadPool.executionTimeout')" :width="$langMatch({ zh: '100', en: '160' }, 'auto')">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.executeTimeOut }} {{ scope.row.executeTimeOut }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="空闲回收" width="100"> <el-table-column :label="$t('threadPool.keepAliveTime')" :width="$langMatch({ zh: '100', en: '160' }, 'auto')">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.keepAliveTime }} {{ scope.row.keepAliveTime }}
</template> </template>
@ -129,7 +130,7 @@
</template> </template>
</el-table-column>--> </el-table-column>-->
<el-table-column <el-table-column
label="操作" :label="$t('common.operation')"
fixed="right" fixed="right"
width="120" width="120"
align="center" align="center"
@ -148,9 +149,9 @@
</el-dropdown> </el-dropdown>
</template>--> </template>-->
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-button type="text" size="small" @click="handleInfo(row)"> </el-button> <el-button type="text" size="small" @click="handleInfo(row)"> {{ $t('common.detail') }} </el-button>
<el-button type="text" size="small" @click="handleShowStack(row)"> </el-button> <el-button type="text" size="small" @click="handleShowStack(row)"> {{ $t('common.stack') }} </el-button>
<el-button type="text" size="small" @click="handleUpdate(row)"> </el-button> <el-button type="text" size="small" @click="handleUpdate(row)"> {{ $t('common.edit') }} </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -168,111 +169,111 @@
width="1000px" width="1000px"
> >
<template> <template>
<el-descriptions class="margin-top" title="基础信息" :column="3" :size="size" border> <el-descriptions class="margin-top" :title="$t('threadPoolInstance.basicInformation')" :column="3" :size="size" border>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 线程池 </template> <template slot="label"> {{ $t('threadPoolInstance.threadPoolID') }} </template>
{{ runTimeTemp.tpId }} {{ runTimeTemp.tpId }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 环境标识 </template> <template slot="label"> {{ $t('threadPoolInstance.activeID') }} </template>
<el-tag :type="runTimeTemp.active | statusFilter"> <el-tag :type="runTimeTemp.active | statusFilter">
{{ runTimeTemp.active }} {{ runTimeTemp.active }}
</el-tag> </el-tag>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 运行状态 </template> <template slot="label"> {{ $t('threadPoolInstance.runningState') }} </template>
<el-tag>{{ runTimeTemp.state }}</el-tag> <el-tag>{{ runTimeTemp.state }}</el-tag>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 实例Host </template> <template slot="label"> {{ $t('threadPoolInstance.instanceHost') }} </template>
{{ runTimeTemp.host }} {{ runTimeTemp.host }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 实例标识 </template> <template slot="label"> {{ $t('threadPoolInstance.instanceID') }} </template>
{{ runTimeTemp.identify }} {{ runTimeTemp.identify }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<br /> <br />
<br /> <br />
<el-descriptions class="margin-top" title="负载信息" :column="3" :size="size" border> <el-descriptions class="margin-top" :title="$t('threadPoolInstance.LoadInformation')" :column="3" :size="size" border>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 当前负载 </template> <template slot="label"> {{ $t('threadPoolInstance.CurrentLoad') }} </template>
{{ runTimeTemp.currentLoad }} {{ runTimeTemp.currentLoad }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 峰值负载 </template> <template slot="label"> {{ $t('threadPoolInstance.PeakLoad') }} </template>
{{ runTimeTemp.peakLoad }} {{ runTimeTemp.peakLoad }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 剩余内存 </template> <template slot="label"> {{ $t('threadPoolInstance.RemainingMemory') }} </template>
{{ runTimeTemp.freeMemory }} {{ runTimeTemp.freeMemory }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 内存占比 </template> <template slot="label"> {{ $t('threadPoolInstance.MemoryRatio') }} </template>
{{ runTimeTemp.memoryProportion }} {{ runTimeTemp.memoryProportion }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<br /> <br />
<br /> <br />
<el-descriptions class="margin-top" title="线程信息" :column="3" :size="size" border> <el-descriptions class="margin-top" :title="$t('threadPoolInstance.threadInformation')" :column="3" :size="size" border>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 核心线程 </template> <template slot="label"> {{ $t('threadPool.coreSize') }} </template>
{{ runTimeTemp.coreSize }} {{ runTimeTemp.coreSize }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 当前线程 </template> <template slot="label"> {{ $t('threadPoolInstance.currentSize') }} </template>
{{ runTimeTemp.poolSize }} {{ runTimeTemp.poolSize }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 最大线程 </template> <template slot="label"> {{ $t('threadPool.maximumSize') }} </template>
{{ runTimeTemp.maximumSize }} {{ runTimeTemp.maximumSize }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 活跃线程 </template> <template slot="label"> {{ $t('threadPoolInstance.activeSize') }} </template>
{{ runTimeTemp.activeSize }} {{ runTimeTemp.activeSize }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 同存最大线程 </template> <template slot="label"> {{ $t('threadPoolInstance.largestSize') }} </template>
{{ runTimeTemp.largestPoolSize }} {{ runTimeTemp.largestPoolSize }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<br /> <br />
<br /> <br />
<el-descriptions class="margin-top" title="队列信息" :column="3" :size="size" border> <el-descriptions class="margin-top" :title="$t('threadPoolInstance.queueInformation')" :column="3" :size="size" border>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 队列容量 </template> <template slot="label"> {{ $t('threadPool.queueCapacity') }} </template>
{{ runTimeTemp.queueCapacity }} {{ runTimeTemp.queueCapacity }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 队列元素 </template> <template slot="label"> {{ $t('threadPoolInstance.queueCount') }} </template>
{{ runTimeTemp.queueSize }} {{ runTimeTemp.queueSize }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 队列剩余容量 </template> <template slot="label"> {{ $t('threadPoolInstance.queueRemainingCapacity') }} </template>
{{ runTimeTemp.queueRemainingCapacity }} {{ runTimeTemp.queueRemainingCapacity }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 阻塞队列 </template> <template slot="label"> {{ $t('threadPoolInstance.queueType') }} </template>
{{ runTimeTemp.queueType }} {{ runTimeTemp.queueType }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<br /> <br />
<br /> <br />
<el-descriptions class="margin-top" title="其它信息" :column="3" :size="size" border> <el-descriptions class="margin-top" :title="$t('threadPoolInstance.otherInformation')" :column="3" :size="size" border>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 任务总量 </template> <template slot="label"> {{ $t('threadPoolInstance.totalTask') }} </template>
{{ runTimeTemp.completedTaskCount }} {{ runTimeTemp.completedTaskCount }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 拒绝次数 </template> <template slot="label"> {{ $t('threadPoolInstance.totalRejection') }} </template>
<el-link type="danger" :underline="false">{{ runTimeTemp.rejectCount }}</el-link> <el-link type="danger" :underline="false">{{ runTimeTemp.rejectCount }}</el-link>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 最后更新时间 </template> <template slot="label"> {{ $t('threadPoolInstance.lastUpdateTime') }} </template>
{{ runTimeTemp.clientLastRefreshTime }} {{ runTimeTemp.clientLastRefreshTime }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> 拒绝策略 </template> <template slot="label"> {{ $t('threadPool.rejectedHandler') }} </template>
{{ runTimeTemp.rejectedName }} {{ runTimeTemp.rejectedName }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
@ -280,11 +281,11 @@
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="instanceDialogFormVisible = false"> <el-button @click="instanceDialogFormVisible = false">
<i class="el-icon-close" /> <i class="el-icon-close" />
{{ $t('common.close') }}
</el-button> </el-button>
<el-button type="primary" @click="handleInfo()"> <el-button type="primary" @click="handleInfo()">
<i class="el-icon-refresh-right" /> <i class="el-icon-refresh-right" />
{{ $t('common.refresh') }}
</el-button> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -295,31 +296,31 @@
style="width: 500px; margin-left: 50px" style="width: 500px; margin-left: 50px"
:rules="rules" :rules="rules"
:model="temp" :model="temp"
label-width="80px" :label-width="$langMatch({ zh: '80px', en: '150px' })"
> >
<el-form-item label="核心线程" prop="coreSize"> <el-form-item :label="$t('threadPool.coreSize')" prop="coreSize">
<el-input-number <el-input-number
v-model="temp.coreSize" v-model="temp.coreSize"
placeholder="核心线程" :placeholder="$t('threadPool.coreSize')"
controls-position="right" controls-position="right"
:min="1" :min="1"
:max="9999" :max="9999"
></el-input-number> ></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="最大线程" prop="maxSize"> <el-form-item :label="$t('threadPool.maximumSize')" prop="maxSize">
<el-input-number <el-input-number
v-model="temp.maxSize" v-model="temp.maxSize"
placeholder="最大线程" :placeholder="$t('threadPool.maximumSize')"
controls-position="right" controls-position="right"
:min="1" :min="1"
:max="9999" :max="9999"
/> />
</el-form-item> </el-form-item>
<el-form-item label="队列类型" prop="queueType"> <el-form-item :label="$t('threadPool.queueType')" prop="queueType">
<el-select <el-select
v-model="temp.queueType" v-model="temp.queueType"
placeholder="队列类型" :placeholder="$t('threadPool.queueType')"
:disabled="true" :disabled="true"
style="display: block" style="display: block"
@change="selectQueueType" @change="selectQueueType"
@ -332,49 +333,49 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="队列容量" prop="capacity"> <el-form-item :label="$t('threadPool.queueCapacity')" prop="capacity">
<el-input-number <el-input-number
v-model="temp.capacity" v-model="temp.capacity"
placeholder="队列容量" :placeholder="$t('threadPool.queueCapacity')"
controls-position="right" controls-position="right"
:min="0" :min="0"
:max="2147483647" :max="2147483647"
:disabled="temp.queueType === 9 ? false : true" :disabled="temp.queueType === 9 ? false : true"
/> />
</el-form-item> </el-form-item>
<el-form-item label="线程超时" prop="isAlarm"> <el-form-item :label="$t('threadPoolInstance.allowCoreThreadTimeOut')" prop="isAlarm">
<template> <template>
<div> <div>
<el-radio-group v-model="temp.allowCoreThreadTimeOut"> <el-radio-group v-model="temp.allowCoreThreadTimeOut">
<el-radio-button :label="1">超时</el-radio-button> <el-radio-button :label="1">{{ $t('threadPool.timeout') }}</el-radio-button>
<el-radio-button :label="0">不超时</el-radio-button> <el-radio-button :label="0">{{ $t('threadPool.noTimeout') }}</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
</template> </template>
</el-form-item> </el-form-item>
<el-form-item label="执行超时" prop="executeTimeOut"> <el-form-item :label="$t('threadPool.executionTimeout')" prop="executeTimeOut">
<el-input-number <el-input-number
v-model="temp.executeTimeOut" v-model="temp.executeTimeOut"
placeholder="执行超时(毫秒)" :placeholder="$t('threadPool.executionTimeoutUnit')"
controls-position="right" controls-position="right"
:min="0" :min="0"
:max="999999" :max="999999"
/> />
</el-form-item> </el-form-item>
<el-form-item label="空闲回收" prop="keepAliveTime"> <el-form-item :label="$t('threadPool.keepAliveTime')" prop="keepAliveTime">
<el-input-number <el-input-number
v-model="temp.keepAliveTime" v-model="temp.keepAliveTime"
placeholder="空闲回收(秒)" :placeholder="$t('threadPool.keepAliveTimeUnit')"
controls-position="right" controls-position="right"
:min="1" :min="1"
:max="999999" :max="999999"
/> />
</el-form-item> </el-form-item>
<el-form-item label="拒绝策略" prop="rejectedType"> <el-form-item :label="$t('threadPool.rejectedHandler')" prop="rejectedType">
<el-select <el-select
v-model="temp.rejectedType" v-model="temp.rejectedType"
style="display: block" style="display: block"
placeholder="拒绝策略" :placeholder="$t('threadPool.rejectedHandler')"
@change="selectRejectedType" @change="selectRejectedType"
> >
<el-option <el-option
@ -385,21 +386,21 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="isRejectShow" label="自定义拒绝策略" prop="customRejectedType"> <el-form-item v-if="isRejectShow" :label="$t('threadPool.customRejectedHandler')" prop="customRejectedType">
<el-input <el-input
v-model="temp.customRejectedType" v-model="temp.customRejectedType"
placeholder="请输入自定义 SPI 拒绝策略标识" :placeholder="$t('threadPool.customRejectedHandlerTip')"
@input="onInput()" @input="onInput()"
/> />
</el-form-item> </el-form-item>
<el-form-item label="全部修改" prop="allUpdate"> <el-form-item :label="$t('threadPoolInstance.changeAll')" prop="allUpdate">
<el-switch v-model="allUpdate"> </el-switch> <el-switch v-model="allUpdate"> </el-switch>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> 取消 </el-button> <el-button @click="dialogFormVisible = false"> {{ $t('common.cancel') }} </el-button>
<el-button type="primary" @click="dialogStatus === 'create' ? createData() : updateData()"> <el-button type="primary" @click="dialogStatus === 'create' ? createData() : updateData()">
确认 {{ $t('common.confirm') }}
</el-button> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -409,7 +410,7 @@
<el-table-column prop="pv" label="Pv" /> <el-table-column prop="pv" label="Pv" />
</el-table> </el-table>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogPvVisible = false"> Confirm </el-button> <el-button type="primary" @click="dialogPvVisible = false"> {{ $t('common.confirm') }} </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="Stack Info" :visible.sync="isStackShow" width="60%"> <el-dialog title="Stack Info" :visible.sync="isStackShow" width="60%">
@ -425,10 +426,10 @@
</li> </li>
</ul> </ul>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="isStackShow = false"> <i class="el-icon-close" /> </el-button> <el-button @click="isStackShow = false"> <i class="el-icon-close" />{{ $t('common.close') }}</el-button>
<el-button type="primary" @click="handleStackInfo"> <el-button type="primary" @click="handleStackInfo">
<i class="el-icon-refresh-right" /> <i class="el-icon-refresh-right" />
{{ $t('common.refresh') }}
</el-button> </el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -564,9 +565,9 @@ export default {
}, },
dialogStatus: '', dialogStatus: '',
textMap: { textMap: {
update: 'Edit', update: this.$t('common.edit'),
create: 'Create', create: this.$t('common.create'),
info: 'Info', info: this.$t('common.info'),
}, },
allUpdate: false, allUpdate: false,
temp: { temp: {
@ -592,15 +593,15 @@ export default {
}, },
fetchData() { fetchData() {
if (!this.listQuery.tenantId) { if (!this.listQuery.tenantId) {
this.$message.warning('租户不允许为空'); this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') }));
return; return;
} }
if (!this.listQuery.itemId) { if (!this.listQuery.itemId) {
this.$message.warning('项目不允许为空'); this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('projectManage.item') }));
return; return;
} }
if (!this.listQuery.tpId) { if (!this.listQuery.tpId) {
this.$message.warning('线程池不允许为空'); this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('threadPool.threadPool') }));
return; return;
} }
this.listLoading = true; this.listLoading = true;
@ -658,8 +659,8 @@ export default {
this.fetchData(); this.fetchData();
this.dialogFormVisible = false; this.dialogFormVisible = false;
this.$notify({ this.$notify({
title: 'Success', title: this.$t('message.success'),
message: 'Created Successfully', message: this.$t('message.createdSuccess'),
type: 'success', type: 'success',
duration: 2000, duration: 2000,
}); });
@ -728,7 +729,7 @@ export default {
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
this.$message.error('查询失败,请尝试刷新页面'); this.$message.error(this.$t('message.queryFailure'));
}); });
}, },
handleShowStack(row) { handleShowStack(row) {
@ -748,12 +749,12 @@ export default {
this.stackInfo = data; this.stackInfo = data;
this.isStackShow = true; this.isStackShow = true;
} else { } else {
this.$message.warning('当前线程池暂无堆栈信息'); this.$message.warning(this.$t('threadPoolInstance.stackRequestFail'));
} }
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
this.$message.error('查询失败,请尝试刷新页面'); this.$message.error(this.$t('message.queryFailure'));
}); });
}, },
// //
@ -762,7 +763,7 @@ export default {
if (valid) { if (valid) {
if (parseInt(this.temp.maxSize) < parseInt(this.temp.coreSize)) { if (parseInt(this.temp.maxSize) < parseInt(this.temp.coreSize)) {
this.$message({ this.$message({
message: '最大线程必须大于等于核心线程', message: this.$t('threadPool.threadsNumErrorTip'),
type: 'warning', type: 'warning',
}); });
return; return;
@ -783,8 +784,8 @@ export default {
.then(() => { .then(() => {
this.dialogFormVisible = false; this.dialogFormVisible = false;
this.$notify({ this.$notify({
title: 'Success', title: this.$t('message.success'),
message: 'Update Successfully', message: this.$t('message.updateSuccess'),
type: 'success', type: 'success',
duration: 2000, duration: 2000,
}); });
@ -853,6 +854,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.headerRowName{
}
/* 滚动槽 */ /* 滚动槽 */
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 8px; width: 8px;

@ -204,11 +204,11 @@ export default {
create: 'Create', create: 'Create',
}, },
rules: { rules: {
tenantId: [{ 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('common.requiredError'), trigger: 'blur' }], itemId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
itemName: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }], itemName: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
owner: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }], owner: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
itemDesc: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }], itemDesc: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
}, },
temp: { temp: {
id: undefined, id: undefined,

@ -174,10 +174,10 @@ export default {
create: this.$t('common.create'), create: this.$t('common.create'),
}, },
rules: { rules: {
tenantId: [{ 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('common.requiredError'), trigger: 'blur' }], tenantName: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
owner: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }], owner: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
tenantDesc: [{ required: true, message: this.$t('common.requiredError'), trigger: 'blur' }], tenantDesc: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
}, },
temp: { temp: {
id: undefined, id: undefined,

@ -3,7 +3,7 @@
<div class="filter-container"> <div class="filter-container">
<el-select <el-select
v-model="listQuery.tenantId" v-model="listQuery.tenantId"
:placeholder="$t('threadPool.tenant')" :placeholder="$t('tenantManage.tenant')"
style="width: 220px" style="width: 220px"
filterable filterable
class="filter-item" class="filter-item"
@ -18,7 +18,7 @@
</el-select> </el-select>
<el-select <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
:placeholder="$t('threadPool.project')" :placeholder="$t('projectManage.item')"
style="width: 220px" style="width: 220px"
filterable filterable
class="filter-item" class="filter-item"
@ -33,7 +33,7 @@
</el-select> </el-select>
<el-select <el-select
v-model="listQuery.tpId" v-model="listQuery.tpId"
:placeholder="$t('common.threadPool')" :placeholder="$t('threadPool.threadPool')"
style="width: 220px" style="width: 220px"
filterable filterable
class="filter-item" class="filter-item"
@ -53,7 +53,7 @@
icon="el-icon-search" icon="el-icon-search"
@click="fetchData" @click="fetchData"
> >
{{ $t('common.search') }} {{ $t('common.query') }}
</el-button> </el-button>
<el-button <el-button
class="filter-item" class="filter-item"
@ -63,7 +63,7 @@
@click="handleCreate" @click="handleCreate"
:disabled="isEditDisabled" :disabled="isEditDisabled"
> >
{{ $t('common.addition') }} {{ $t('common.insert') }}
</el-button> </el-button>
</div> </div>
<el-table <el-table
@ -74,43 +74,43 @@
fit fit
highlight-current-row highlight-current-row
> >
<el-table-column fixed :label="$t('common.serialNumber')" width="80"> <el-table-column fixed :label="$t('common.num')" width="80">
<template slot-scope="scope">{{ scope.$index + 1 }}</template> <template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column> </el-table-column>
<el-table-column label="租户" width="150"> <el-table-column :label="$t('tenantManage.tenant')" width="150">
<template slot-scope="scope">{{ scope.row.tenantId }}</template> <template slot-scope="scope">{{ scope.row.tenantId }}</template>
</el-table-column> </el-table-column>
<el-table-column label="项目" width="260"> <el-table-column :label="$t('projectManage.item')" width="260">
<template slot-scope="scope">{{ scope.row.itemId }}</template> <template slot-scope="scope">{{ scope.row.itemId }}</template>
</el-table-column> </el-table-column>
<el-table-column label="线程池" width="260"> <el-table-column :label="$t('threadPool.threadPool')" width="260">
<template slot-scope="scope">{{ scope.row.tpId }}</template> <template slot-scope="scope">{{ scope.row.tpId }}</template>
</el-table-column> </el-table-column>
<el-table-column label="核心线程" width="100"> <el-table-column :label="$t('threadPool.coreSize')" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="success" :underline="false">{{ scope.row.coreSize }}</el-link> <el-link type="success" :underline="false">{{ scope.row.coreSize }}</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="最大线程" width="100"> <el-table-column :label="$t('threadPool.maximumSize')" :width="$langMatch({ zh: '100', en: '120' })">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="danger" :underline="false">{{ scope.row.maxSize }}</el-link> <el-link type="danger" :underline="false">{{ scope.row.maxSize }}</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="队列类型" width="260"> <el-table-column :label="$t('threadPool.queueType')" width="260">
<template slot-scope="scope">{{ scope.row.queueType | queueFilter }}</template> <template slot-scope="scope">{{ scope.row.queueType | queueFilter }}</template>
</el-table-column> </el-table-column>
<el-table-column label="队列容量" width="100"> <el-table-column :label="$t('threadPool.queueCapacity')" :width="$langMatch({ zh: '100', en: '120' })">
<template slot-scope="scope">{{ scope.row.capacity }}</template> <template slot-scope="scope">{{ scope.row.capacity }}</template>
</el-table-column> </el-table-column>
<el-table-column label="拒绝策略" width="200"> <el-table-column :label="$t('threadPool.rejectedHandler')" width="200">
<template slot-scope="scope">{{ scope.row.rejectedType | rejectedTypeFilter }}</template> <template slot-scope="scope">{{ scope.row.rejectedType | rejectedTypeFilter }}</template>
</el-table-column> </el-table-column>
<el-table-column label="执行超时" width="100"> <el-table-column :label="$t('threadPool.executionTimeout')" :width="$langMatch({ zh: '100', en: '150' })">
<template slot-scope="scope">{{ <template slot-scope="scope">{{
scope.row.executeTimeOut | defaultExecuteTimeoutValue scope.row.executeTimeOut | defaultExecuteTimeoutValue
}}</template> }}</template>
</el-table-column> </el-table-column>
<el-table-column label="是否报警" width="100"> <el-table-column :label="$t('threadPool.isAlarm')" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.isAlarm" v-model="scope.row.isAlarm"
@ -122,10 +122,10 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" width="200"> <el-table-column :label="$t('common.createTime')" width="200">
<template slot-scope="scope">{{ scope.row.gmtCreate }}</template> <template slot-scope="scope">{{ scope.row.gmtCreate }}</template>
</el-table-column> </el-table-column>
<el-table-column label="修改时间" width="200"> <el-table-column :label="$t('common.updateTime')" width="200">
<template slot-scope="scope">{{ scope.row.gmtModified }}</template> <template slot-scope="scope">{{ scope.row.gmtModified }}</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -159,12 +159,13 @@
style="width: 500px; margin-left: 50px" style="width: 500px; margin-left: 50px"
:rules="rules" :rules="rules"
:model="temp" :model="temp"
label-width="80px" :label-width="$langMatch({ zh: '100px', en: '150px' })"
> >
<el-form-item v-if="isEdit" label="租户" prop="tenantId"> <template v-if="isEdit">
<el-form-item :label="$t('tenantManage.tenant')" prop="tenantId">
<el-select <el-select
v-model="temp.tenantId" v-model="temp.tenantId"
placeholder="请选择租户" :placeholder="$t('message.selectMessage', { target: $t('tenantManage.tenant') })"
style="display: block" style="display: block"
:disabled="dialogStatus === 'create' ? false : true" :disabled="dialogStatus === 'create' ? false : true"
@change="tenantTempSelectList()" @change="tenantTempSelectList()"
@ -177,10 +178,10 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="isEdit" label="项目" prop="itemId"> <el-form-item :label="$t('projectManage.item')" prop="itemId">
<el-select <el-select
v-model="temp.itemId" v-model="temp.itemId"
placeholder="请选择项目" :placeholder="$t('message.selectMessage', { target: $t('projectManage.item') })"
style="display: block" style="display: block"
:disabled="dialogStatus === 'create' ? false : true" :disabled="dialogStatus === 'create' ? false : true"
> >
@ -193,36 +194,38 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="isEdit" label="线程池" prop="tpId"> <el-form-item :label="$t('threadPool.threadPool')" prop="tpId">
<el-input <el-input
v-model="temp.tpId" v-model="temp.tpId"
size="medium" size="medium"
placeholder="请输入线程池 " :placeholder="$t('message.selectMessage', { target: $t('threadPool.threadPool') }) "
:disabled="dialogStatus === 'create' ? false : true" :disabled="dialogStatus === 'create' ? false : true"
/> />
</el-form-item> </el-form-item>
<el-form-item label="核心线程" prop="coreSize"> </template>
<el-form-item :label="$t('threadPool.coreSize')" prop="coreSize">
<el-input-number <el-input-number
v-model="temp.coreSize" v-model="temp.coreSize"
placeholder="核心线程" :placeholder="$t('threadPool.coreSize')"
controls-position="right" controls-position="right"
:min="1" :min="1"
:max="9999" :max="9999"
/> />
</el-form-item> </el-form-item>
<el-form-item label="最大线程" prop="maxSize"> <el-form-item :label="$t('threadPool.maximumSize')" prop="maxSize">
<el-input-number <el-input-number
v-model="temp.maxSize" v-model="temp.maxSize"
placeholder="最大线程" :placeholder="$t('threadPool.maximumSize')"
controls-position="right" controls-position="right"
:min="1" :min="1"
:max="9999" :max="9999"
/> />
</el-form-item> </el-form-item>
<el-form-item label="队列类型" prop="queueType"> <el-form-item :label="$t('threadPool.queueType')" prop="queueType">
<el-select <el-select
v-model="temp.queueType" v-model="temp.queueType"
placeholder="队列类型" :placeholder="$t('threadPool.queueType')"
style="display: block" style="display: block"
@change="selectQueueType" @change="selectQueueType"
> >
@ -234,57 +237,57 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="队列容量" prop="capacity"> <el-form-item :label="$t('threadPool.queueCapacity')" prop="capacity">
<el-input-number <el-input-number
v-model="temp.capacity" v-model="temp.capacity"
placeholder="队列容量" :placeholder="$t('threadPool.queueCapacity')"
controls-position="right" controls-position="right"
:min="0" :min="0"
:max="2147483647" :max="2147483647"
:disabled="temp.queueType === 4 || temp.queueType === 5 ? true : false" :disabled="temp.queueType === 4 || temp.queueType === 5 ? true : false"
/> />
</el-form-item> </el-form-item>
<el-form-item label="执行超时" prop="executeTimeOut"> <el-form-item :label="$t('threadPool.executionTimeout')" prop="executeTimeOut">
<el-input-number <el-input-number
v-model="temp.executeTimeOut" v-model="temp.executeTimeOut"
placeholder="执行超时(毫秒)" :placeholder="$t('threadPool.executionTimeoutUnit')"
controls-position="right" controls-position="right"
/> />
</el-form-item> </el-form-item>
<el-form-item label="空闲回收" prop="keepAliveTime"> <el-form-item :label="$t('threadPool.keepAliveTime')" prop="keepAliveTime">
<el-input-number <el-input-number
v-model="temp.keepAliveTime" v-model="temp.keepAliveTime"
placeholder="空闲回收(秒)" :placeholder="$t('threadPool.keepAliveTimeUnit')"
controls-position="right" controls-position="right"
:min="1" :min="1"
:max="999999" :max="999999"
/> />
</el-form-item> </el-form-item>
<el-form-item label="是否超时" prop="allowCoreThreadTimeOut"> <el-form-item :label="$t('threadPool.isTimeout')" prop="allowCoreThreadTimeOut">
<template> <template>
<div> <div>
<el-radio-group v-model="temp.allowCoreThreadTimeOut"> <el-radio-group v-model="temp.allowCoreThreadTimeOut">
<el-radio-button :label="1">超时</el-radio-button> <el-radio-button :label="1">{{ $t('threadPool.timeout') }}</el-radio-button>
<el-radio-button :label="0">不超时</el-radio-button> <el-radio-button :label="0">{{ $t('threadPool.noTimeout') }}</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
</template> </template>
</el-form-item> </el-form-item>
<el-form-item label="是否报警" prop="isAlarm"> <el-form-item :label="$t('threadPool.isAlarm')" prop="isAlarm">
<template> <template>
<div> <div>
<el-radio-group v-model="temp.isAlarm"> <el-radio-group v-model="temp.isAlarm">
<el-radio-button label="1">报警</el-radio-button> <el-radio-button label="1">{{ $t('threadPool.alarm') }}</el-radio-button>
<el-radio-button label="0">不报警</el-radio-button> <el-radio-button label="0">{{ $t('threadPool.noAlarm') }}</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
</template> </template>
</el-form-item> </el-form-item>
<el-form-item label="活跃报警" prop="livenessAlarm"> <el-form-item :label="$t('threadPool.activeAlarm')" prop="livenessAlarm">
<template> <template>
<div> <div>
<el-radio-group v-model="temp.livenessAlarm"> <el-radio-group v-model="temp.livenessAlarm">
<el-radio-button label="0">不报警</el-radio-button> <el-radio-button label="0">{{ $t('threadPool.noAlarm') }}</el-radio-button>
<el-radio-button label="60">60%</el-radio-button> <el-radio-button label="60">60%</el-radio-button>
<el-radio-button label="80">80%</el-radio-button> <el-radio-button label="80">80%</el-radio-button>
<el-radio-button label="90">90%</el-radio-button> <el-radio-button label="90">90%</el-radio-button>
@ -293,11 +296,11 @@
</template> </template>
</el-form-item> </el-form-item>
<el-form-item label="容量报警" prop="capacityAlarm"> <el-form-item :label="$t('threadPool.capacityAlarm')" prop="capacityAlarm">
<template> <template>
<div> <div>
<el-radio-group v-model="temp.capacityAlarm"> <el-radio-group v-model="temp.capacityAlarm">
<el-radio-button label="0">不报警</el-radio-button> <el-radio-button label="0">{{ $t('threadPool.noAlarm') }}</el-radio-button>
<el-radio-button label="60">60%</el-radio-button> <el-radio-button label="60">60%</el-radio-button>
<el-radio-button label="80">80%</el-radio-button> <el-radio-button label="80">80%</el-radio-button>
<el-radio-button label="90">90%</el-radio-button> <el-radio-button label="90">90%</el-radio-button>
@ -305,11 +308,11 @@
</div> </div>
</template> </template>
</el-form-item> </el-form-item>
<el-form-item label="拒绝策略" prop="rejectedType"> <el-form-item :label="$t('threadPool.rejectedHandler')" prop="rejectedType">
<el-select <el-select
v-model="temp.rejectedType" v-model="temp.rejectedType"
style="display: block" style="display: block"
placeholder="拒绝策略" :placeholder="$t('threadPool.rejectedHandler')"
@change="selectRejectedType" @change="selectRejectedType"
> >
<el-option <el-option
@ -320,10 +323,10 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="isRejectShow" label="自定义拒绝策略" prop="customRejectedType"> <el-form-item v-if="isRejectShow" :label="$t('threadPool.customRejectedHandler')" prop="customRejectedType">
<el-input <el-input
v-model="temp.customRejectedType" v-model="temp.customRejectedType"
placeholder="请输入自定义 SPI 拒绝策略标识" :placeholder="$t('threadPool.customRejectedHandlerTip')"
@input="onInput()" @input="onInput()"
/> />
</el-form-item> </el-form-item>
@ -341,7 +344,7 @@
<el-table-column prop="pv" label="Pv" /> <el-table-column prop="pv" label="Pv" />
</el-table> </el-table>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogPvVisible = false">Confirm</el-button> <el-button type="primary" @click="dialogPvVisible = false">{{ $t('common.confirm') }}</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -460,16 +463,16 @@ export default {
size: 500, size: 500,
dialogStatus: '', dialogStatus: '',
textMap: { textMap: {
update: 'Edit', update: this.$t('common.edit'),
create: 'Create', create: this.$t('common.create'),
}, },
rules: { rules: {
tenantId: [{ required: true, message: 'this is required', trigger: 'blur' }], tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
itemId: [{ required: true, message: 'this is required', trigger: 'blur' }], itemId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
tpId: [{ required: true, message: 'this is required', trigger: 'blur' }], tpId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
coreSize: [{ required: true, message: 'this is required', trigger: 'blur' }], coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
maxSize: [ maxSize: [
{ required: true, message: 'this is required', trigger: 'blur' }, { required: true, message: this.$t('message.requiredError'), trigger: 'blur' },
// { // {
// validator: (rule, value, callback) => { // validator: (rule, value, callback) => {
// if (parseInt(value) < parseInt(this.temp.coreSize)) { // if (parseInt(value) < parseInt(this.temp.coreSize)) {
@ -481,15 +484,15 @@ export default {
// }, // },
// }, // },
], ],
queueType: [{ required: true, message: 'this is required', trigger: 'blur' }], queueType: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
allowCoreThreadTimeOut: [{ required: true, message: 'this is required', trigger: 'blur' }], allowCoreThreadTimeOut: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
keepAliveTime: [{ required: true, message: 'this is required', trigger: 'blur' }], keepAliveTime: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
isAlarm: [{ required: true, message: 'this is required', trigger: 'blur' }], isAlarm: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
capacityAlarm: [{ required: true, message: 'this is required', trigger: 'blur' }], capacityAlarm: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
livenessAlarm: [{ required: true, message: 'this is required', trigger: 'blur' }], livenessAlarm: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
rejectedType: [{ required: true, message: 'this is required', trigger: 'blur' }], rejectedType: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
capacity: [{ required: true, message: 'this is required', trigger: 'blur' }], capacity: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
executeTimeOut: [{ required: true, message: 'this is required', trigger: 'blur' }], executeTimeOut: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
}, },
temp: { temp: {
id: undefined, id: undefined,
@ -531,8 +534,8 @@ export default {
threadPoolApi.alarmEnable(row).then(() => { threadPoolApi.alarmEnable(row).then(() => {
this.fetchData(); this.fetchData();
this.$notify({ this.$notify({
title: 'Success', title: this.$t('message.success'),
message: 'Update Successfully', message: this.$t('message.updateSuccess'),
type: 'success', type: 'success',
duration: 2000, duration: 2000,
}); });
@ -589,7 +592,7 @@ export default {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (parseInt(this.temp.maxSize) < parseInt(this.temp.coreSize)) { if (parseInt(this.temp.maxSize) < parseInt(this.temp.coreSize)) {
this.$message({ this.$message({
message: '最大线程必须大于等于核心线程', message: this.$t('threadPool.threadsNumErrorTip'),
type: 'warning', type: 'warning',
}); });
return; return;
@ -606,8 +609,8 @@ export default {
this.fetchData(); this.fetchData();
this.dialogFormVisible = false; this.dialogFormVisible = false;
this.$notify({ this.$notify({
title: 'Success', title: this.$t('message.success'),
message: 'Created Successfully', message: this.$t('message.createdSuccess'),
type: 'success', type: 'success',
duration: 2000, duration: 2000,
}); });
@ -645,7 +648,7 @@ export default {
if (valid) { if (valid) {
if (parseInt(this.temp.maxSize) < parseInt(this.temp.coreSize)) { if (parseInt(this.temp.maxSize) < parseInt(this.temp.coreSize)) {
this.$message({ this.$message({
message: '最大线程必须大于等于核心线程', message: this.$t('threadPool.threadsNumErrorTip'),
type: 'warning', type: 'warning',
}); });
return; return;
@ -668,8 +671,8 @@ export default {
this.fetchData(); this.fetchData();
this.dialogFormVisible = false; this.dialogFormVisible = false;
this.$notify({ this.$notify({
title: 'Success', title: this.$t('message.success'),
message: 'Update Successfully', message: this.$t('message.updateSuccess'),
type: 'success', type: 'success',
duration: 2000, duration: 2000,
}); });
@ -678,16 +681,16 @@ export default {
}); });
}, },
openDelConfirm(name) { openDelConfirm(name) {
return this.$confirm(`此操作将删除 ${name}, 是否继续?`, '提示', { return this.$confirm(this.$t('message.deleteMessage', { name }), this.$t('common.hint'), {
confirmButtonText: '确定', confirmButtonText: this.$t('common.ok'),
cancelButtonText: '取消', cancelButtonText: this.$t('common.cancel'),
type: 'warning', type: 'warning',
}); });
}, },
handleDelete(row) { handleDelete(row) {
const role = localStorage.getItem('USER_ROLE') === 'ROLE_ADMIN' ? true : false; const role = localStorage.getItem('USER_ROLE') === 'ROLE_ADMIN' ? true : false;
if (!role) { if (!role) {
this.$message.error('请联系管理员删除'); this.$message.error(this.$t('message.NoDeletionPermissionTip'));
return; return;
} }
@ -695,8 +698,8 @@ export default {
threadPoolApi.deleted(row).then((response) => { threadPoolApi.deleted(row).then((response) => {
this.fetchData(); this.fetchData();
this.$notify({ this.$notify({
title: 'Success', title: this.$t('message.success'),
message: 'Delete Successfully', message: this.$t('message.deleteSuccess'),
type: 'success', type: 'success',
duration: 2000, duration: 2000,
}); });

Loading…
Cancel
Save