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 de2a5800a1..bf7ee5fcc7 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestResourcePool.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestResourcePool.java @@ -20,5 +20,7 @@ public class TestResourcePool implements Serializable { private Long updateTime; + private String image; + 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 84edf600e9..6cc15d65d4 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestResourcePoolExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestResourcePoolExample.java @@ -175,142 +175,142 @@ public class TestResourcePoolExample { } public Criteria andNameIsNull() { - addCriterion("name is null"); + addCriterion("`name` is null"); return (Criteria) this; } public Criteria andNameIsNotNull() { - addCriterion("name is not null"); + addCriterion("`name` is not null"); return (Criteria) this; } public Criteria andNameEqualTo(String value) { - addCriterion("name =", value, "name"); + addCriterion("`name` =", value, "name"); return (Criteria) this; } public Criteria andNameNotEqualTo(String value) { - addCriterion("name <>", value, "name"); + addCriterion("`name` <>", value, "name"); return (Criteria) this; } public Criteria andNameGreaterThan(String value) { - addCriterion("name >", value, "name"); + addCriterion("`name` >", value, "name"); return (Criteria) this; } public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("name >=", value, "name"); + addCriterion("`name` >=", value, "name"); return (Criteria) this; } public Criteria andNameLessThan(String value) { - addCriterion("name <", value, "name"); + addCriterion("`name` <", value, "name"); return (Criteria) this; } public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("name <=", value, "name"); + addCriterion("`name` <=", value, "name"); return (Criteria) this; } public Criteria andNameLike(String value) { - addCriterion("name like", value, "name"); + addCriterion("`name` like", value, "name"); return (Criteria) this; } public Criteria andNameNotLike(String value) { - addCriterion("name not like", value, "name"); + addCriterion("`name` not like", value, "name"); return (Criteria) this; } public Criteria andNameIn(List values) { - addCriterion("name in", values, "name"); + addCriterion("`name` in", values, "name"); return (Criteria) this; } public Criteria andNameNotIn(List values) { - addCriterion("name not in", values, "name"); + addCriterion("`name` not in", values, "name"); return (Criteria) this; } public Criteria andNameBetween(String value1, String value2) { - addCriterion("name between", value1, value2, "name"); + addCriterion("`name` between", value1, value2, "name"); return (Criteria) this; } public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("name not between", value1, value2, "name"); + addCriterion("`name` not between", value1, value2, "name"); return (Criteria) this; } public Criteria andTypeIsNull() { - addCriterion("type is null"); + addCriterion("`type` is null"); return (Criteria) this; } public Criteria andTypeIsNotNull() { - addCriterion("type is not null"); + addCriterion("`type` is not null"); return (Criteria) this; } public Criteria andTypeEqualTo(String value) { - addCriterion("type =", value, "type"); + addCriterion("`type` =", value, "type"); return (Criteria) this; } public Criteria andTypeNotEqualTo(String value) { - addCriterion("type <>", value, "type"); + addCriterion("`type` <>", value, "type"); return (Criteria) this; } public Criteria andTypeGreaterThan(String value) { - addCriterion("type >", value, "type"); + addCriterion("`type` >", value, "type"); return (Criteria) this; } public Criteria andTypeGreaterThanOrEqualTo(String value) { - addCriterion("type >=", value, "type"); + addCriterion("`type` >=", value, "type"); return (Criteria) this; } public Criteria andTypeLessThan(String value) { - addCriterion("type <", value, "type"); + addCriterion("`type` <", value, "type"); return (Criteria) this; } public Criteria andTypeLessThanOrEqualTo(String value) { - addCriterion("type <=", value, "type"); + addCriterion("`type` <=", value, "type"); return (Criteria) this; } public Criteria andTypeLike(String value) { - addCriterion("type like", value, "type"); + addCriterion("`type` like", value, "type"); return (Criteria) this; } public Criteria andTypeNotLike(String value) { - addCriterion("type not like", value, "type"); + addCriterion("`type` not like", value, "type"); return (Criteria) this; } public Criteria andTypeIn(List values) { - addCriterion("type in", values, "type"); + addCriterion("`type` in", values, "type"); return (Criteria) this; } public Criteria andTypeNotIn(List values) { - addCriterion("type not in", values, "type"); + addCriterion("`type` not in", values, "type"); return (Criteria) this; } public Criteria andTypeBetween(String value1, String value2) { - addCriterion("type between", value1, value2, "type"); + addCriterion("`type` between", value1, value2, "type"); return (Criteria) this; } public Criteria andTypeNotBetween(String value1, String value2) { - addCriterion("type not between", value1, value2, "type"); + addCriterion("`type` not between", value1, value2, "type"); return (Criteria) this; } @@ -385,72 +385,72 @@ public class TestResourcePoolExample { } public Criteria andStatusIsNull() { - addCriterion("status is null"); + addCriterion("`status` is null"); return (Criteria) this; } public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); + addCriterion("`status` is not null"); return (Criteria) this; } public Criteria andStatusEqualTo(String value) { - addCriterion("status =", value, "status"); + addCriterion("`status` =", value, "status"); return (Criteria) this; } public Criteria andStatusNotEqualTo(String value) { - addCriterion("status <>", value, "status"); + addCriterion("`status` <>", value, "status"); return (Criteria) this; } public Criteria andStatusGreaterThan(String value) { - addCriterion("status >", value, "status"); + addCriterion("`status` >", value, "status"); return (Criteria) this; } public Criteria andStatusGreaterThanOrEqualTo(String value) { - addCriterion("status >=", value, "status"); + addCriterion("`status` >=", value, "status"); return (Criteria) this; } public Criteria andStatusLessThan(String value) { - addCriterion("status <", value, "status"); + addCriterion("`status` <", value, "status"); return (Criteria) this; } public Criteria andStatusLessThanOrEqualTo(String value) { - addCriterion("status <=", value, "status"); + addCriterion("`status` <=", value, "status"); return (Criteria) this; } public Criteria andStatusLike(String value) { - addCriterion("status like", value, "status"); + addCriterion("`status` like", value, "status"); return (Criteria) this; } public Criteria andStatusNotLike(String value) { - addCriterion("status not like", value, "status"); + addCriterion("`status` not like", value, "status"); return (Criteria) this; } public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); + addCriterion("`status` in", values, "status"); return (Criteria) this; } public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); + addCriterion("`status` not in", values, "status"); return (Criteria) this; } public Criteria andStatusBetween(String value1, String value2) { - addCriterion("status between", value1, value2, "status"); + addCriterion("`status` between", value1, value2, "status"); return (Criteria) this; } public Criteria andStatusNotBetween(String value1, String value2) { - addCriterion("status not between", value1, value2, "status"); + addCriterion("`status` not between", value1, value2, "status"); return (Criteria) this; } @@ -573,6 +573,76 @@ public class TestResourcePoolExample { addCriterion("update_time not between", value1, value2, "updateTime"); return (Criteria) this; } + + public Criteria andImageIsNull() { + addCriterion("image is null"); + return (Criteria) this; + } + + public Criteria andImageIsNotNull() { + addCriterion("image is not null"); + return (Criteria) this; + } + + public Criteria andImageEqualTo(String value) { + addCriterion("image =", value, "image"); + return (Criteria) this; + } + + public Criteria andImageNotEqualTo(String value) { + addCriterion("image <>", value, "image"); + return (Criteria) this; + } + + public Criteria andImageGreaterThan(String value) { + addCriterion("image >", value, "image"); + return (Criteria) this; + } + + public Criteria andImageGreaterThanOrEqualTo(String value) { + addCriterion("image >=", value, "image"); + return (Criteria) this; + } + + public Criteria andImageLessThan(String value) { + addCriterion("image <", value, "image"); + return (Criteria) this; + } + + public Criteria andImageLessThanOrEqualTo(String value) { + addCriterion("image <=", value, "image"); + return (Criteria) this; + } + + public Criteria andImageLike(String value) { + addCriterion("image like", value, "image"); + return (Criteria) this; + } + + public Criteria andImageNotLike(String value) { + addCriterion("image not like", value, "image"); + return (Criteria) this; + } + + public Criteria andImageIn(List values) { + addCriterion("image in", values, "image"); + return (Criteria) this; + } + + public Criteria andImageNotIn(List values) { + addCriterion("image not in", values, "image"); + return (Criteria) this; + } + + public Criteria andImageBetween(String value1, String value2) { + addCriterion("image between", value1, value2, "image"); + return (Criteria) this; + } + + public Criteria andImageNotBetween(String value1, String value2) { + addCriterion("image not between", value1, value2, "image"); + 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 071918ef1f..23969480f4 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestResourcePoolMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestResourcePoolMapper.xml @@ -9,6 +9,7 @@ + @@ -69,7 +70,7 @@ - id, name, type, description, status, create_time, update_time + id, `name`, `type`, description, `status`, create_time, update_time, image @@ -171,16 +178,16 @@ id = #{record.id,jdbcType=VARCHAR}, - name = #{record.name,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=VARCHAR}, + `type` = #{record.type,jdbcType=VARCHAR}, description = #{record.description,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=VARCHAR}, + `status` = #{record.status,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=BIGINT}, @@ -188,6 +195,9 @@ update_time = #{record.updateTime,jdbcType=BIGINT}, + + image = #{record.image,jdbcType=VARCHAR}, + @@ -196,12 +206,13 @@ update test_resource_pool set id = #{record.id,jdbcType=VARCHAR}, - name = #{record.name,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + `type` = #{record.type,jdbcType=VARCHAR}, description = #{record.description,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=VARCHAR}, + `status` = #{record.status,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=BIGINT}, - update_time = #{record.updateTime,jdbcType=BIGINT} + update_time = #{record.updateTime,jdbcType=BIGINT}, + image = #{record.image,jdbcType=VARCHAR} @@ -210,16 +221,16 @@ update test_resource_pool - name = #{name,jdbcType=VARCHAR}, + `name` = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, + `type` = #{type,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, + `status` = #{status,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=BIGINT}, @@ -227,17 +238,21 @@ update_time = #{updateTime,jdbcType=BIGINT}, + + image = #{image,jdbcType=VARCHAR}, + where id = #{id,jdbcType=VARCHAR} update test_resource_pool - set name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, + set `name` = #{name,jdbcType=VARCHAR}, + `type` = #{type,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR}, - status = #{status,jdbcType=VARCHAR}, + `status` = #{status,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=BIGINT}, - update_time = #{updateTime,jdbcType=BIGINT} + update_time = #{updateTime,jdbcType=BIGINT}, + image = #{image,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/performance/engine/AbstractEngine.java b/backend/src/main/java/io/metersphere/performance/engine/AbstractEngine.java index a2fec3c680..f6eda2e823 100644 --- a/backend/src/main/java/io/metersphere/performance/engine/AbstractEngine.java +++ b/backend/src/main/java/io/metersphere/performance/engine/AbstractEngine.java @@ -30,8 +30,8 @@ public abstract class AbstractEngine implements Engine { protected Integer threadNum; protected List resourceList; - private TestResourcePoolService testResourcePoolService; - private TestResourceService testResourceService; + private final TestResourcePoolService testResourcePoolService; + private final TestResourceService testResourceService; public AbstractEngine() { testResourcePoolService = CommonBeanFactory.getBean(TestResourcePoolService.class); @@ -62,6 +62,11 @@ public abstract class AbstractEngine implements Engine { && !ResourcePoolTypeEnum.NODE.name().equals(resourcePool.getType())) { MSException.throwException("Invalid Resource Pool type."); } + // image + String image = resourcePool.getImage(); + if (StringUtils.isNotEmpty(image)) { + JMETER_IMAGE = image; + } this.resourceList = testResourceService.getResourcesByPoolId(resourcePool.getId()); if (CollectionUtils.isEmpty(this.resourceList)) { MSException.throwException("Test Resource is empty"); diff --git a/backend/src/main/resources/db/migration/V54__test_resource_pool_image.sql b/backend/src/main/resources/db/migration/V54__test_resource_pool_image.sql new file mode 100644 index 0000000000..f81852c814 --- /dev/null +++ b/backend/src/main/resources/db/migration/V54__test_resource_pool_image.sql @@ -0,0 +1,2 @@ +ALTER TABLE test_resource_pool + ADD image VARCHAR(100) NULL; \ No newline at end of file diff --git a/frontend/src/business/components/settings/system/TestResourcePool.vue b/frontend/src/business/components/settings/system/TestResourcePool.vue index ff03c1addb..02871ad832 100644 --- a/frontend/src/business/components/settings/system/TestResourcePool.vue +++ b/frontend/src/business/components/settings/system/TestResourcePool.vue @@ -61,6 +61,9 @@ + + + @@ -148,6 +151,9 @@ + + + diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 5c4b537269..5187d54e45 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -171,7 +171,8 @@ export default { all_label: { case: "all", review: "all" - } + }, + image: 'Image' }, license: { title: 'Authorization management', @@ -795,88 +796,88 @@ export default { suffixFormatErr: "The file format does not meet the requirements", swagger_url_import: "Import using URL", }, - home_page:{ - unit_of_measurement:"", - api_count_card:{ + home_page: { + unit_of_measurement: "", + api_count_card: { title: "API count", }, - test_case_count_card:{ + test_case_count_card: { title: "Api test case count", }, - test_scene_count_card:{ + test_scene_count_card: { title: "Scene test case count", }, - schedule_task_count_card:{ + schedule_task_count_card: { title: "Schedule task count", }, - detail_card:{ - running:"Running", - not_started:"Not started", - finished:"Finished", - uncoverage:"Uncoverage", - coverage:"Coverage", - unexecute:"Unexecute", - execution_failed:"Execution failed", - execution_pass:"Execution passed", - failed:"Failure", - success:"Success", - rate:{ - completion:"Completion rate", - coverage:"Coverage rate", - pass:"Pass rate", - success:"Success rate", + detail_card: { + running: "Running", + not_started: "Not started", + finished: "Finished", + uncoverage: "Uncoverage", + coverage: "Coverage", + unexecute: "Unexecute", + execution_failed: "Execution failed", + execution_pass: "Execution passed", + failed: "Failure", + success: "Success", + rate: { + completion: "Completion rate", + coverage: "Coverage rate", + pass: "Pass rate", + success: "Success rate", }, }, - api_details_card:{ + api_details_card: { title: "API", - this_week_add:"Added {0} this week", + this_week_add: "Added {0} this week", }, - test_case_details_card:{ + test_case_details_card: { title: "Test case", - this_week_add:"Added {0} this week", - this_week_execute:"Executed {0} this week", - executed:"Executed {0} in history", - this_week_add_sm:"Added {0}
this week", - this_week_execute_sm:"Executed {0}
this week", - executed_sm:"Executed {0}
in history", + this_week_add: "Added {0} this week", + this_week_execute: "Executed {0} this week", + executed: "Executed {0} in history", + this_week_add_sm: "Added {0}
this week", + this_week_execute_sm: "Executed {0}
this week", + executed_sm: "Executed {0}
in history", }, - test_scene_details_card:{ + test_scene_details_card: { title: "Scene", - this_week_add:"Added {0} this week", - this_week_execute:"Executed {0} this week", - executed:"Executed {0} in history", - this_week_add_sm:"Added {0}
this week", - this_week_execute_sm:"Executed {0}
this week", - executed_sm:"Executed {0}
in history", + this_week_add: "Added {0} this week", + this_week_execute: "Executed {0} this week", + executed: "Executed {0} in history", + this_week_add_sm: "Added {0}
this week", + this_week_execute_sm: "Executed {0}
this week", + executed_sm: "Executed {0}
in history", }, - schedule_task_details_card:{ + schedule_task_details_card: { title: "Schedule task", - this_week_add:"Added {0} this week", - this_week_execute:"Executed {0} this week", - executed:"Executed {0} in history", - this_week_add_sm:"Added {0}
this week", - this_week_execute_sm:"Executed {0}
this week", - executed_sm:"Executed {0}
in history", + this_week_add: "Added {0} this week", + this_week_execute: "Executed {0} this week", + executed: "Executed {0} in history", + this_week_add_sm: "Added {0}
this week", + this_week_execute_sm: "Executed {0}
this week", + executed_sm: "Executed {0}
in history", }, - failed_case_list:{ + failed_case_list: { title: "Top 10 failure cases about test plan in the past 7 days", - table_coloum:{ + table_coloum: { index: "Ranking", case_name: "Case name", case_type: "Case Type", test_plan: "Test plan", failure_times: "Failure times", }, - table_value:{ - case_type:{ + table_value: { + case_type: { api: "Api case", scene: "Scenario case", } } }, - running_task_list:{ + running_task_list: { title: "Running schedule task", - table_coloum:{ + table_coloum: { index: "Index", scenario: "Scene", run_rule: "Rule", @@ -885,7 +886,7 @@ export default { create_user: "Creator", update_time: "Update time", }, - confirm:{ + confirm: { close_title: "Do you want to close this scheduled task?", } } diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index d1baa2e574..062f3a0b36 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -171,7 +171,8 @@ export default { all_label: { case: "全部用例", review: "全部评审" - } + }, + image: '镜像' }, license: { title: '授权管理', @@ -796,88 +797,88 @@ export default { suffixFormatErr: "文件格式不符合要求", swagger_url_import: "使用URL导入", }, - home_page:{ - unit_of_measurement:"个", - api_count_card:{ + home_page: { + unit_of_measurement: "个", + api_count_card: { title: "接口数量统计", }, - test_case_count_card:{ + test_case_count_card: { title: "接口用例数量统计", }, - test_scene_count_card:{ + test_scene_count_card: { title: "场景用例数量统计", }, - schedule_task_count_card:{ + schedule_task_count_card: { title: "定时任务数量统计", }, - detail_card:{ - running:"进行中", - not_started:"未开始", - finished:"已完成", - uncoverage:"未覆盖", - coverage:"已覆盖", - unexecute:"未执行", - execution_failed:"未通过", - execution_pass:"已通过", - failed:"失败", - success:"成功", - rate:{ - completion:"完成率", - coverage:"覆盖率", - pass:"通过率", - success:"成功率", + detail_card: { + running: "进行中", + not_started: "未开始", + finished: "已完成", + uncoverage: "未覆盖", + coverage: "已覆盖", + unexecute: "未执行", + execution_failed: "未通过", + execution_pass: "已通过", + failed: "失败", + success: "成功", + rate: { + completion: "完成率", + coverage: "覆盖率", + pass: "通过率", + success: "成功率", }, }, - api_details_card:{ + api_details_card: { title: "接口", - this_week_add:"本周新增: {0}个", + this_week_add: "本周新增: {0}个", }, - test_case_details_card:{ + test_case_details_card: { title: "用例", - this_week_add:"本周新增: {0}个", - this_week_execute:"本周执行: {0}次", - executed:"历史总执行: {0}次", - this_week_add_sm:"本周新增:
{0}个", - this_week_execute_sm:"本周执行:
{0}次", - executed_sm:"历史总执行:
{0}次", + this_week_add: "本周新增: {0}个", + this_week_execute: "本周执行: {0}次", + executed: "历史总执行: {0}次", + this_week_add_sm: "本周新增:
{0}个", + this_week_execute_sm: "本周执行:
{0}次", + executed_sm: "历史总执行:
{0}次", }, - test_scene_details_card:{ + test_scene_details_card: { title: "场景", - this_week_add:"本周新增: {0}个", - this_week_execute:"本周执行: {0}次", - executed:"历史总执行: {0}次", - this_week_add_sm:"本周新增:
{0}个", - this_week_execute_sm:"本周执行:
{0}次", - executed_sm:"历史总执行:
{0}次", + this_week_add: "本周新增: {0}个", + this_week_execute: "本周执行: {0}次", + executed: "历史总执行: {0}次", + this_week_add_sm: "本周新增:
{0}个", + this_week_execute_sm: "本周执行:
{0}次", + executed_sm: "历史总执行:
{0}次", }, - schedule_task_details_card:{ + schedule_task_details_card: { title: "定时任务", - this_week_add:"本周新增: {0}个", - this_week_execute:"本周执行: {0}次", - executed:"历史总执行: {0}次", - this_week_add_sm:"本周新增:
{0}个", - this_week_execute_sm:"本周执行:
{0}次", - executed_sm:"历史总执行:
{0}次", + this_week_add: "本周新增: {0}个", + this_week_execute: "本周执行: {0}次", + executed: "历史总执行: {0}次", + this_week_add_sm: "本周新增:
{0}个", + this_week_execute_sm: "本周执行:
{0}次", + executed_sm: "历史总执行:
{0}次", }, - failed_case_list:{ + failed_case_list: { title: "过去7天测试计划失败用例TOP 10", - table_coloum:{ + table_coloum: { index: "排名", case_name: "用例名称", case_type: "用例类型", test_plan: "所属测试计划", failure_times: "失败次数", }, - table_value:{ - case_type:{ + table_value: { + case_type: { api: "接口用例", scene: "场景用例", } } }, - running_task_list:{ + running_task_list: { title: "运行中的定时任务", - table_coloum:{ + table_coloum: { index: "序号", scenario: "场景名称", run_rule: "运行规则", @@ -886,7 +887,7 @@ export default { create_user: "创建人", update_time: "更新时间", }, - confirm:{ + confirm: { close_title: "要关闭这条定时任务吗?", } } diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 0a4d11a8d3..d5a75e8fd9 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -171,7 +171,8 @@ export default { all_label: { case: "全部用例", review: "全部評審" - } + }, + image: '鏡像' }, license: { title: '授權管理',