fix(系统设置): 修复资源池社区版添加并发数最大为10
--bug=1037715 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001037715
This commit is contained in:
parent
ab5b4b355f
commit
f14aad9472
|
@ -2,11 +2,13 @@ package io.metersphere.system.service;
|
|||
|
||||
|
||||
import io.metersphere.sdk.exception.MSException;
|
||||
import io.metersphere.sdk.util.CommonBeanFactory;
|
||||
import io.metersphere.sdk.util.LogUtils;
|
||||
import io.metersphere.sdk.util.Translator;
|
||||
import io.metersphere.system.controller.handler.ResultHolder;
|
||||
import io.metersphere.system.dto.pool.TestResourceDTO;
|
||||
import io.metersphere.system.dto.pool.TestResourceNodeDTO;
|
||||
import io.metersphere.system.dto.sdk.LicenseDTO;
|
||||
import io.metersphere.system.utils.TaskRunnerClient;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
@ -39,6 +41,11 @@ public class NodeResourcePoolService {
|
|||
if (testResourceNodeDTO.getConcurrentNumber() == null) {
|
||||
throw new MSException(Translator.get("concurrent_number_is_null"));
|
||||
}
|
||||
if (!licenseValidate()) {
|
||||
if (testResourceNodeDTO.getConcurrentNumber() > 10) {
|
||||
testResourceNodeDTO.setConcurrentNumber(10);
|
||||
}
|
||||
}
|
||||
if (!usedApiType) {
|
||||
if (StringUtils.isBlank(testResourceNodeDTO.getMonitor())) {
|
||||
throw new MSException(Translator.get("monitor_is_null"));
|
||||
|
@ -62,6 +69,16 @@ public class NodeResourcePoolService {
|
|||
return isValid;
|
||||
}
|
||||
|
||||
private boolean licenseValidate() {
|
||||
LicenseService licenseService = CommonBeanFactory.getBean(LicenseService.class);
|
||||
if (licenseService != null) {
|
||||
LicenseDTO licenseDTO = licenseService.validate();
|
||||
return (licenseDTO != null && StringUtils.equals(licenseDTO.getStatus(), "valid"));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean validateNode(TestResourceNodeDTO node) {
|
||||
try {
|
||||
ResultHolder body = TaskRunnerClient.get(String.format(nodeControllerUrl, node.getIp(), node.getPort()));
|
||||
|
|
|
@ -157,7 +157,7 @@
|
|||
</div>
|
||||
</VueDraggable>
|
||||
</a-scrollbar>
|
||||
<div v-if="props.formMode === 'create'" v-xpack class="w-full">
|
||||
<div v-if="props.formMode === 'create' && !props.hideAdd" class="w-full">
|
||||
<a-button class="px-0" type="text" @click="addField">
|
||||
<template #icon>
|
||||
<icon-plus class="text-[14px]" />
|
||||
|
|
|
@ -310,7 +310,7 @@
|
|||
<a-input-number
|
||||
v-model:model-value="form.testResourceDTO.concurrentNumber"
|
||||
:min="1"
|
||||
:max="9999999"
|
||||
:max="isXpack ? 9999999 : 10"
|
||||
:step="1"
|
||||
mode="button"
|
||||
class="w-[160px]"
|
||||
|
|
Loading…
Reference in New Issue