diff --git a/backend/src/main/java/io/metersphere/base/domain/TestResourcePool.java b/backend/src/main/java/io/metersphere/base/domain/TestResourcePool.java index f1f57419a3..c614b58d81 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestResourcePool.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestResourcePool.java @@ -1,9 +1,9 @@ package io.metersphere.base.domain; -import lombok.Data; - import java.io.Serializable; +import lombok.Data; + @Data public class TestResourcePool implements Serializable { private String id; @@ -28,5 +28,9 @@ public class TestResourcePool implements Serializable { private String createUser; + private Boolean api; + + private Boolean performance; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestResourcePoolExample.java b/backend/src/main/java/io/metersphere/base/domain/TestResourcePoolExample.java index db24c8b824..fea8212f82 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestResourcePoolExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestResourcePoolExample.java @@ -853,6 +853,126 @@ public class TestResourcePoolExample { addCriterion("create_user not between", value1, value2, "createUser"); return (Criteria) this; } + + public Criteria andApiIsNull() { + addCriterion("api is null"); + return (Criteria) this; + } + + public Criteria andApiIsNotNull() { + addCriterion("api is not null"); + return (Criteria) this; + } + + public Criteria andApiEqualTo(Boolean value) { + addCriterion("api =", value, "api"); + return (Criteria) this; + } + + public Criteria andApiNotEqualTo(Boolean value) { + addCriterion("api <>", value, "api"); + return (Criteria) this; + } + + public Criteria andApiGreaterThan(Boolean value) { + addCriterion("api >", value, "api"); + return (Criteria) this; + } + + public Criteria andApiGreaterThanOrEqualTo(Boolean value) { + addCriterion("api >=", value, "api"); + return (Criteria) this; + } + + public Criteria andApiLessThan(Boolean value) { + addCriterion("api <", value, "api"); + return (Criteria) this; + } + + public Criteria andApiLessThanOrEqualTo(Boolean value) { + addCriterion("api <=", value, "api"); + return (Criteria) this; + } + + public Criteria andApiIn(List values) { + addCriterion("api in", values, "api"); + return (Criteria) this; + } + + public Criteria andApiNotIn(List values) { + addCriterion("api not in", values, "api"); + return (Criteria) this; + } + + public Criteria andApiBetween(Boolean value1, Boolean value2) { + addCriterion("api between", value1, value2, "api"); + return (Criteria) this; + } + + public Criteria andApiNotBetween(Boolean value1, Boolean value2) { + addCriterion("api not between", value1, value2, "api"); + return (Criteria) this; + } + + public Criteria andPerformanceIsNull() { + addCriterion("performance is null"); + return (Criteria) this; + } + + public Criteria andPerformanceIsNotNull() { + addCriterion("performance is not null"); + return (Criteria) this; + } + + public Criteria andPerformanceEqualTo(Boolean value) { + addCriterion("performance =", value, "performance"); + return (Criteria) this; + } + + public Criteria andPerformanceNotEqualTo(Boolean value) { + addCriterion("performance <>", value, "performance"); + return (Criteria) this; + } + + public Criteria andPerformanceGreaterThan(Boolean value) { + addCriterion("performance >", value, "performance"); + return (Criteria) this; + } + + public Criteria andPerformanceGreaterThanOrEqualTo(Boolean value) { + addCriterion("performance >=", value, "performance"); + return (Criteria) this; + } + + public Criteria andPerformanceLessThan(Boolean value) { + addCriterion("performance <", value, "performance"); + return (Criteria) this; + } + + public Criteria andPerformanceLessThanOrEqualTo(Boolean value) { + addCriterion("performance <=", value, "performance"); + return (Criteria) this; + } + + public Criteria andPerformanceIn(List values) { + addCriterion("performance in", values, "performance"); + return (Criteria) this; + } + + public Criteria andPerformanceNotIn(List values) { + addCriterion("performance not in", values, "performance"); + return (Criteria) this; + } + + public Criteria andPerformanceBetween(Boolean value1, Boolean value2) { + addCriterion("performance between", value1, value2, "performance"); + return (Criteria) this; + } + + public Criteria andPerformanceNotBetween(Boolean value1, Boolean value2) { + addCriterion("performance not between", value1, value2, "performance"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestResourcePoolMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestResourcePoolMapper.xml index f1ae2981d3..7809f174ce 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestResourcePoolMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestResourcePoolMapper.xml @@ -13,6 +13,8 @@ + + @@ -74,7 +76,7 @@ id, `name`, `type`, description, `status`, create_time, update_time, image, `heap`, - gc_algo, create_user + gc_algo, create_user, api, performance @@ -231,6 +247,12 @@ create_user = #{record.createUser,jdbcType=VARCHAR}, + + api = #{record.api,jdbcType=BIT}, + + + performance = #{record.performance,jdbcType=BIT}, + @@ -248,7 +270,9 @@ image = #{record.image,jdbcType=VARCHAR}, `heap` = #{record.heap,jdbcType=VARCHAR}, gc_algo = #{record.gcAlgo,jdbcType=VARCHAR}, - create_user = #{record.createUser,jdbcType=VARCHAR} + create_user = #{record.createUser,jdbcType=VARCHAR}, + api = #{record.api,jdbcType=BIT}, + performance = #{record.performance,jdbcType=BIT} @@ -286,6 +310,12 @@ create_user = #{createUser,jdbcType=VARCHAR}, + + api = #{api,jdbcType=BIT}, + + + performance = #{performance,jdbcType=BIT}, + where id = #{id,jdbcType=VARCHAR} @@ -300,7 +330,9 @@ image = #{image,jdbcType=VARCHAR}, `heap` = #{heap,jdbcType=VARCHAR}, gc_algo = #{gcAlgo,jdbcType=VARCHAR}, - create_user = #{createUser,jdbcType=VARCHAR} + create_user = #{createUser,jdbcType=VARCHAR}, + api = #{api,jdbcType=BIT}, + performance = #{performance,jdbcType=BIT} where id = #{id,jdbcType=VARCHAR} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index 80165a0457..d11666333d 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit 80165a0457ca9678bf54dd1541e8c35a3e154019 +Subproject commit d11666333d38e3204e98e916802c47ddc331abd0 diff --git a/backend/src/main/resources/db/migration/V88__v1.11_release.sql b/backend/src/main/resources/db/migration/V88__v1.11_release.sql new file mode 100644 index 0000000000..c160c59fcd --- /dev/null +++ b/backend/src/main/resources/db/migration/V88__v1.11_release.sql @@ -0,0 +1,16 @@ +-- test resource pool +ALTER TABLE test_resource_pool + ADD api TINYINT(1) NULL; + +ALTER TABLE test_resource_pool + ADD performance TINYINT(1) NULL; + +UPDATE test_resource_pool +SET api = TRUE, + performance = TRUE +WHERE type = 'NODE'; + +UPDATE test_resource_pool +SET api = FALSE, + performance = TRUE +WHERE type = 'K8S'; diff --git a/frontend/src/business/components/api/automation/scenario/common/RunMode.vue b/frontend/src/business/components/api/automation/scenario/common/RunMode.vue index 84eb90efbb..467ff53c55 100644 --- a/frontend/src/business/components/api/automation/scenario/common/RunMode.vue +++ b/frontend/src/business/components/api/automation/scenario/common/RunMode.vue @@ -33,6 +33,7 @@ v-for="item in resourcePools" :key="item.id" :label="item.name" + :disabled="!item.api" :value="item.id"> @@ -134,7 +135,7 @@ export default { }, getResourcePools() { this.result = this.$get('/testresourcepool/list/quota/valid', response => { - this.resourcePools = response.data.filter(p => p.type === 'NODE'); + this.resourcePools = response.data; }); }, }, diff --git a/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue b/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue index 5e9a2f4942..85618b6a20 100644 --- a/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue +++ b/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue @@ -9,6 +9,7 @@ v-for="item in resourcePools" :key="item.id" :label="item.name" + :disabled="!item.performance" :value="item.id"> diff --git a/frontend/src/business/components/settings/system/TestResourcePool.vue b/frontend/src/business/components/settings/system/TestResourcePool.vue index 8d39c50751..249532ed18 100644 --- a/frontend/src/business/components/settings/system/TestResourcePool.vue +++ b/frontend/src/business/components/settings/system/TestResourcePool.vue @@ -2,7 +2,8 @@
@@ -70,6 +71,10 @@ + + + + @@ -109,6 +114,13 @@ + + + + + + + { this.updatePool = result.data; resolve(); - }) + }); }); }, updatePoolStatus(row) { diff --git a/frontend/src/business/components/track/plan/common/PlanRunMode.vue b/frontend/src/business/components/track/plan/common/PlanRunMode.vue index 4b09032bcb..410de82f4d 100644 --- a/frontend/src/business/components/track/plan/common/PlanRunMode.vue +++ b/frontend/src/business/components/track/plan/common/PlanRunMode.vue @@ -52,6 +52,7 @@ v-for="item in resourcePools" :key="item.id" :label="item.name" + :disabled="!item.api" :value="item.id"> @@ -112,7 +113,7 @@ export default { }, getResourcePools() { this.result = this.$get('/testresourcepool/list/quota/valid', response => { - this.resourcePools = response.data.filter(p => p.type === 'NODE'); + this.resourcePools = response.data; }); }, }, diff --git a/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue b/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue index cb6500f1ee..49b66c16e6 100644 --- a/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue +++ b/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue @@ -70,6 +70,7 @@ v-for="item in resourcePools" :key="item.id" :label="item.name" + :disabled="!item.api" :value="item.id"> @@ -364,7 +365,7 @@ export default { }, getResourcePools() { this.result = this.$get('/testresourcepool/list/quota/valid', response => { - this.resourcePools = response.data.filter(p => p.type === 'NODE'); + this.resourcePools = response.data; }); }, }, diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index e66371da21..c5ffc730ec 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -1645,7 +1645,8 @@ export default { status_change_failed: 'Failed to change the status, resource pool is invalid!', check_in: 'Check in', node_selector_invalid: 'nodeSelector must be JSON', - pod_thread_limit: 'Maximum number of threads per POD' + pod_thread_limit: 'Maximum number of threads per POD', + usage: 'Usage', }, system_parameter_setting: { mailbox_service_settings: 'Mailbox Settings', diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index a3e10fbb52..7868067ba9 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -1653,7 +1653,8 @@ export default { status_change_failed: '状态修改失败, 校验不通过!', check_in: '校验中', node_selector_invalid: 'nodeSelector 必须是有效的JSON', - pod_thread_limit: '单POD最大线程数' + pod_thread_limit: '单POD最大线程数', + usage: '用途', }, system_parameter_setting: { mailbox_service_settings: '邮件设置', diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 1cf0c9d9c8..a2d254a160 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -1653,7 +1653,8 @@ export default { status_change_failed: '狀態修改失敗, 校驗不通過!', check_in: '校驗中', node_selector_invalid: 'nodeSelector 必須是有效的JSON', - pod_thread_limit: '單POD最大線程數' + pod_thread_limit: '單POD最大線程數', + usage: '用途', }, system_parameter_setting: { mailbox_service_settings: '郵件設置',