From b63c136fb5a5b8a6c5bace1e278fde4b9657f7a0 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Thu, 13 Aug 2020 18:48:11 +0800 Subject: [PATCH 1/8] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E5=A4=84=E7=90=86=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/test/components/ApiVariable.vue | 185 ++++++++++++------ .../components/request/ApiHttpRequestForm.vue | 4 +- frontend/src/i18n/en-US.js | 4 +- frontend/src/i18n/zh-CN.js | 4 +- frontend/src/i18n/zh-TW.js | 4 +- 5 files changed, 140 insertions(+), 61 deletions(-) diff --git a/frontend/src/business/components/api/test/components/ApiVariable.vue b/frontend/src/business/components/api/test/components/ApiVariable.vue index 20877c661d..139c596b37 100644 --- a/frontend/src/business/components/api/test/components/ApiVariable.vue +++ b/frontend/src/business/components/api/test/components/ApiVariable.vue @@ -3,7 +3,7 @@ {{ description }} -
+
- + - - - - + + +
+ + +
- +
@@ -75,28 +71,50 @@ - +
- +

{{ $t('api_test.environment.environment') }}

+
- +

{{ $t('api_test.scenario.scenario') }}

+ +
+
+

{{ $t('api_test.request.parameters_pre_request') }}

+ +
+
+ +
+
+ + + +
- + + + + +
{{ $t('commons.save') }} - + {{ $t('api_test.request.parameters_advance_add_func') }} - + {{ $t('api_test.request.parameters_preview') }} @@ -110,8 +128,8 @@ + + From 3783d30d7e5df685e658059b41cee14c05ed18aa Mon Sep 17 00:00:00 2001 From: q4speed Date: Fri, 14 Aug 2020 13:34:18 +0800 Subject: [PATCH 5/8] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E9=85=8D?= =?UTF-8?q?=E9=A2=9D=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/base/domain/Quota.java | 29 + .../metersphere/base/domain/QuotaExample.java | 840 ++++++++++++++++++ .../io/metersphere/base/domain/Schedule.java | 3 +- .../metersphere/base/mapper/QuotaMapper.java | 30 + .../metersphere/base/mapper/QuotaMapper.xml | 291 ++++++ .../base/mapper/ScheduleMapper.xml | 70 +- .../base/mapper/ext/ExtApiTestMapper.xml | 2 +- .../io/metersphere/config/MybatisConfig.java | 2 +- backend/src/main/java/io/metersphere/xpack | 2 +- .../resources/db/migration/V13__add_quota.sql | 15 + .../components/common/router/router.js | 76 +- .../components/settings/SettingMenu.vue | 116 +-- .../components/settings/SettingMenuBackup.vue | 96 ++ .../business/components/settings/router.js | 88 ++ .../components/settings/system/User.vue | 8 +- frontend/src/business/components/xpack | 2 +- frontend/src/common/js/ajax.js | 22 +- frontend/src/i18n/en-US.js | 21 + frontend/src/i18n/zh-CN.js | 21 + frontend/src/i18n/zh-TW.js | 21 + 20 files changed, 1579 insertions(+), 176 deletions(-) create mode 100644 backend/src/main/java/io/metersphere/base/domain/Quota.java create mode 100644 backend/src/main/java/io/metersphere/base/domain/QuotaExample.java create mode 100644 backend/src/main/java/io/metersphere/base/mapper/QuotaMapper.java create mode 100644 backend/src/main/java/io/metersphere/base/mapper/QuotaMapper.xml create mode 100644 backend/src/main/resources/db/migration/V13__add_quota.sql create mode 100644 frontend/src/business/components/settings/SettingMenuBackup.vue create mode 100644 frontend/src/business/components/settings/router.js diff --git a/backend/src/main/java/io/metersphere/base/domain/Quota.java b/backend/src/main/java/io/metersphere/base/domain/Quota.java new file mode 100644 index 0000000000..578d59f8ca --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/Quota.java @@ -0,0 +1,29 @@ +package io.metersphere.base.domain; + +import java.io.Serializable; +import lombok.Data; + +@Data +public class Quota implements Serializable { + private String id; + + private Integer api; + + private Integer performance; + + private Integer maxThreads; + + private Integer duration; + + private String resourcePool; + + private String organizationId; + + private String workspaceId; + + private Boolean useDefault; + + private Long updateTime; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/QuotaExample.java b/backend/src/main/java/io/metersphere/base/domain/QuotaExample.java new file mode 100644 index 0000000000..c9f47fdc7c --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/QuotaExample.java @@ -0,0 +1,840 @@ +package io.metersphere.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class QuotaExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public QuotaExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(String value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(String value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(String value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(String value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(String value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(String value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLike(String value) { + addCriterion("id like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotLike(String value) { + addCriterion("id not like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(String value1, String value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(String value1, String value2) { + addCriterion("id not between", value1, value2, "id"); + 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(Integer value) { + addCriterion("api =", value, "api"); + return (Criteria) this; + } + + public Criteria andApiNotEqualTo(Integer value) { + addCriterion("api <>", value, "api"); + return (Criteria) this; + } + + public Criteria andApiGreaterThan(Integer value) { + addCriterion("api >", value, "api"); + return (Criteria) this; + } + + public Criteria andApiGreaterThanOrEqualTo(Integer value) { + addCriterion("api >=", value, "api"); + return (Criteria) this; + } + + public Criteria andApiLessThan(Integer value) { + addCriterion("api <", value, "api"); + return (Criteria) this; + } + + public Criteria andApiLessThanOrEqualTo(Integer 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(Integer value1, Integer value2) { + addCriterion("api between", value1, value2, "api"); + return (Criteria) this; + } + + public Criteria andApiNotBetween(Integer value1, Integer 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(Integer value) { + addCriterion("performance =", value, "performance"); + return (Criteria) this; + } + + public Criteria andPerformanceNotEqualTo(Integer value) { + addCriterion("performance <>", value, "performance"); + return (Criteria) this; + } + + public Criteria andPerformanceGreaterThan(Integer value) { + addCriterion("performance >", value, "performance"); + return (Criteria) this; + } + + public Criteria andPerformanceGreaterThanOrEqualTo(Integer value) { + addCriterion("performance >=", value, "performance"); + return (Criteria) this; + } + + public Criteria andPerformanceLessThan(Integer value) { + addCriterion("performance <", value, "performance"); + return (Criteria) this; + } + + public Criteria andPerformanceLessThanOrEqualTo(Integer 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(Integer value1, Integer value2) { + addCriterion("performance between", value1, value2, "performance"); + return (Criteria) this; + } + + public Criteria andPerformanceNotBetween(Integer value1, Integer value2) { + addCriterion("performance not between", value1, value2, "performance"); + return (Criteria) this; + } + + public Criteria andMaxThreadsIsNull() { + addCriterion("max_threads is null"); + return (Criteria) this; + } + + public Criteria andMaxThreadsIsNotNull() { + addCriterion("max_threads is not null"); + return (Criteria) this; + } + + public Criteria andMaxThreadsEqualTo(Integer value) { + addCriterion("max_threads =", value, "maxThreads"); + return (Criteria) this; + } + + public Criteria andMaxThreadsNotEqualTo(Integer value) { + addCriterion("max_threads <>", value, "maxThreads"); + return (Criteria) this; + } + + public Criteria andMaxThreadsGreaterThan(Integer value) { + addCriterion("max_threads >", value, "maxThreads"); + return (Criteria) this; + } + + public Criteria andMaxThreadsGreaterThanOrEqualTo(Integer value) { + addCriterion("max_threads >=", value, "maxThreads"); + return (Criteria) this; + } + + public Criteria andMaxThreadsLessThan(Integer value) { + addCriterion("max_threads <", value, "maxThreads"); + return (Criteria) this; + } + + public Criteria andMaxThreadsLessThanOrEqualTo(Integer value) { + addCriterion("max_threads <=", value, "maxThreads"); + return (Criteria) this; + } + + public Criteria andMaxThreadsIn(List values) { + addCriterion("max_threads in", values, "maxThreads"); + return (Criteria) this; + } + + public Criteria andMaxThreadsNotIn(List values) { + addCriterion("max_threads not in", values, "maxThreads"); + return (Criteria) this; + } + + public Criteria andMaxThreadsBetween(Integer value1, Integer value2) { + addCriterion("max_threads between", value1, value2, "maxThreads"); + return (Criteria) this; + } + + public Criteria andMaxThreadsNotBetween(Integer value1, Integer value2) { + addCriterion("max_threads not between", value1, value2, "maxThreads"); + return (Criteria) this; + } + + public Criteria andDurationIsNull() { + addCriterion("duration is null"); + return (Criteria) this; + } + + public Criteria andDurationIsNotNull() { + addCriterion("duration is not null"); + return (Criteria) this; + } + + public Criteria andDurationEqualTo(Integer value) { + addCriterion("duration =", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationNotEqualTo(Integer value) { + addCriterion("duration <>", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationGreaterThan(Integer value) { + addCriterion("duration >", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationGreaterThanOrEqualTo(Integer value) { + addCriterion("duration >=", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationLessThan(Integer value) { + addCriterion("duration <", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationLessThanOrEqualTo(Integer value) { + addCriterion("duration <=", value, "duration"); + return (Criteria) this; + } + + public Criteria andDurationIn(List values) { + addCriterion("duration in", values, "duration"); + return (Criteria) this; + } + + public Criteria andDurationNotIn(List values) { + addCriterion("duration not in", values, "duration"); + return (Criteria) this; + } + + public Criteria andDurationBetween(Integer value1, Integer value2) { + addCriterion("duration between", value1, value2, "duration"); + return (Criteria) this; + } + + public Criteria andDurationNotBetween(Integer value1, Integer value2) { + addCriterion("duration not between", value1, value2, "duration"); + return (Criteria) this; + } + + public Criteria andResourcePoolIsNull() { + addCriterion("resource_pool is null"); + return (Criteria) this; + } + + public Criteria andResourcePoolIsNotNull() { + addCriterion("resource_pool is not null"); + return (Criteria) this; + } + + public Criteria andResourcePoolEqualTo(String value) { + addCriterion("resource_pool =", value, "resourcePool"); + return (Criteria) this; + } + + public Criteria andResourcePoolNotEqualTo(String value) { + addCriterion("resource_pool <>", value, "resourcePool"); + return (Criteria) this; + } + + public Criteria andResourcePoolGreaterThan(String value) { + addCriterion("resource_pool >", value, "resourcePool"); + return (Criteria) this; + } + + public Criteria andResourcePoolGreaterThanOrEqualTo(String value) { + addCriterion("resource_pool >=", value, "resourcePool"); + return (Criteria) this; + } + + public Criteria andResourcePoolLessThan(String value) { + addCriterion("resource_pool <", value, "resourcePool"); + return (Criteria) this; + } + + public Criteria andResourcePoolLessThanOrEqualTo(String value) { + addCriterion("resource_pool <=", value, "resourcePool"); + return (Criteria) this; + } + + public Criteria andResourcePoolLike(String value) { + addCriterion("resource_pool like", value, "resourcePool"); + return (Criteria) this; + } + + public Criteria andResourcePoolNotLike(String value) { + addCriterion("resource_pool not like", value, "resourcePool"); + return (Criteria) this; + } + + public Criteria andResourcePoolIn(List values) { + addCriterion("resource_pool in", values, "resourcePool"); + return (Criteria) this; + } + + public Criteria andResourcePoolNotIn(List values) { + addCriterion("resource_pool not in", values, "resourcePool"); + return (Criteria) this; + } + + public Criteria andResourcePoolBetween(String value1, String value2) { + addCriterion("resource_pool between", value1, value2, "resourcePool"); + return (Criteria) this; + } + + public Criteria andResourcePoolNotBetween(String value1, String value2) { + addCriterion("resource_pool not between", value1, value2, "resourcePool"); + return (Criteria) this; + } + + public Criteria andOrganizationIdIsNull() { + addCriterion("organization_id is null"); + return (Criteria) this; + } + + public Criteria andOrganizationIdIsNotNull() { + addCriterion("organization_id is not null"); + return (Criteria) this; + } + + public Criteria andOrganizationIdEqualTo(String value) { + addCriterion("organization_id =", value, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdNotEqualTo(String value) { + addCriterion("organization_id <>", value, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdGreaterThan(String value) { + addCriterion("organization_id >", value, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdGreaterThanOrEqualTo(String value) { + addCriterion("organization_id >=", value, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdLessThan(String value) { + addCriterion("organization_id <", value, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdLessThanOrEqualTo(String value) { + addCriterion("organization_id <=", value, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdLike(String value) { + addCriterion("organization_id like", value, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdNotLike(String value) { + addCriterion("organization_id not like", value, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdIn(List values) { + addCriterion("organization_id in", values, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdNotIn(List values) { + addCriterion("organization_id not in", values, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdBetween(String value1, String value2) { + addCriterion("organization_id between", value1, value2, "organizationId"); + return (Criteria) this; + } + + public Criteria andOrganizationIdNotBetween(String value1, String value2) { + addCriterion("organization_id not between", value1, value2, "organizationId"); + return (Criteria) this; + } + + public Criteria andWorkspaceIdIsNull() { + addCriterion("workspace_id is null"); + return (Criteria) this; + } + + public Criteria andWorkspaceIdIsNotNull() { + addCriterion("workspace_id is not null"); + return (Criteria) this; + } + + public Criteria andWorkspaceIdEqualTo(String value) { + addCriterion("workspace_id =", value, "workspaceId"); + return (Criteria) this; + } + + public Criteria andWorkspaceIdNotEqualTo(String value) { + addCriterion("workspace_id <>", value, "workspaceId"); + return (Criteria) this; + } + + public Criteria andWorkspaceIdGreaterThan(String value) { + addCriterion("workspace_id >", value, "workspaceId"); + return (Criteria) this; + } + + public Criteria andWorkspaceIdGreaterThanOrEqualTo(String value) { + addCriterion("workspace_id >=", value, "workspaceId"); + return (Criteria) this; + } + + public Criteria andWorkspaceIdLessThan(String value) { + addCriterion("workspace_id <", value, "workspaceId"); + return (Criteria) this; + } + + public Criteria andWorkspaceIdLessThanOrEqualTo(String value) { + addCriterion("workspace_id <=", value, "workspaceId"); + return (Criteria) this; + } + + public Criteria andWorkspaceIdLike(String value) { + addCriterion("workspace_id like", value, "workspaceId"); + return (Criteria) this; + } + + public Criteria andWorkspaceIdNotLike(String value) { + addCriterion("workspace_id not like", value, "workspaceId"); + return (Criteria) this; + } + + public Criteria andWorkspaceIdIn(List values) { + addCriterion("workspace_id in", values, "workspaceId"); + return (Criteria) this; + } + + public Criteria andWorkspaceIdNotIn(List values) { + addCriterion("workspace_id not in", values, "workspaceId"); + return (Criteria) this; + } + + public Criteria andWorkspaceIdBetween(String value1, String value2) { + addCriterion("workspace_id between", value1, value2, "workspaceId"); + return (Criteria) this; + } + + public Criteria andWorkspaceIdNotBetween(String value1, String value2) { + addCriterion("workspace_id not between", value1, value2, "workspaceId"); + return (Criteria) this; + } + + public Criteria andUseDefaultIsNull() { + addCriterion("use_default is null"); + return (Criteria) this; + } + + public Criteria andUseDefaultIsNotNull() { + addCriterion("use_default is not null"); + return (Criteria) this; + } + + public Criteria andUseDefaultEqualTo(Boolean value) { + addCriterion("use_default =", value, "useDefault"); + return (Criteria) this; + } + + public Criteria andUseDefaultNotEqualTo(Boolean value) { + addCriterion("use_default <>", value, "useDefault"); + return (Criteria) this; + } + + public Criteria andUseDefaultGreaterThan(Boolean value) { + addCriterion("use_default >", value, "useDefault"); + return (Criteria) this; + } + + public Criteria andUseDefaultGreaterThanOrEqualTo(Boolean value) { + addCriterion("use_default >=", value, "useDefault"); + return (Criteria) this; + } + + public Criteria andUseDefaultLessThan(Boolean value) { + addCriterion("use_default <", value, "useDefault"); + return (Criteria) this; + } + + public Criteria andUseDefaultLessThanOrEqualTo(Boolean value) { + addCriterion("use_default <=", value, "useDefault"); + return (Criteria) this; + } + + public Criteria andUseDefaultIn(List values) { + addCriterion("use_default in", values, "useDefault"); + return (Criteria) this; + } + + public Criteria andUseDefaultNotIn(List values) { + addCriterion("use_default not in", values, "useDefault"); + return (Criteria) this; + } + + public Criteria andUseDefaultBetween(Boolean value1, Boolean value2) { + addCriterion("use_default between", value1, value2, "useDefault"); + return (Criteria) this; + } + + public Criteria andUseDefaultNotBetween(Boolean value1, Boolean value2) { + addCriterion("use_default not between", value1, value2, "useDefault"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Long value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Long value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Long value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Long value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Long value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Long value1, Long value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Long value1, Long value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/Schedule.java b/backend/src/main/java/io/metersphere/base/domain/Schedule.java index c92c80d081..d38b68ed63 100644 --- a/backend/src/main/java/io/metersphere/base/domain/Schedule.java +++ b/backend/src/main/java/io/metersphere/base/domain/Schedule.java @@ -1,8 +1,7 @@ package io.metersphere.base.domain; -import lombok.Data; - import java.io.Serializable; +import lombok.Data; @Data public class Schedule implements Serializable { diff --git a/backend/src/main/java/io/metersphere/base/mapper/QuotaMapper.java b/backend/src/main/java/io/metersphere/base/mapper/QuotaMapper.java new file mode 100644 index 0000000000..c9e190c9c2 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/QuotaMapper.java @@ -0,0 +1,30 @@ +package io.metersphere.base.mapper; + +import io.metersphere.base.domain.Quota; +import io.metersphere.base.domain.QuotaExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface QuotaMapper { + long countByExample(QuotaExample example); + + int deleteByExample(QuotaExample example); + + int deleteByPrimaryKey(String id); + + int insert(Quota record); + + int insertSelective(Quota record); + + List selectByExample(QuotaExample example); + + Quota selectByPrimaryKey(String id); + + int updateByExampleSelective(@Param("record") Quota record, @Param("example") QuotaExample example); + + int updateByExample(@Param("record") Quota record, @Param("example") QuotaExample example); + + int updateByPrimaryKeySelective(Quota record); + + int updateByPrimaryKey(Quota record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/QuotaMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/QuotaMapper.xml new file mode 100644 index 0000000000..72ab941079 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/QuotaMapper.xml @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, api, performance, max_threads, duration, resource_pool, organization_id, workspace_id, + use_default, update_time + + + + + delete from quota + where id = #{id,jdbcType=VARCHAR} + + + delete from quota + + + + + + insert into quota (id, api, performance, + max_threads, duration, resource_pool, + organization_id, workspace_id, use_default, + update_time) + values (#{id,jdbcType=VARCHAR}, #{api,jdbcType=INTEGER}, #{performance,jdbcType=INTEGER}, + #{maxThreads,jdbcType=INTEGER}, #{duration,jdbcType=INTEGER}, #{resourcePool,jdbcType=VARCHAR}, + #{organizationId,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, #{useDefault,jdbcType=BIT}, + #{updateTime,jdbcType=BIGINT}) + + + insert into quota + + + id, + + + api, + + + performance, + + + max_threads, + + + duration, + + + resource_pool, + + + organization_id, + + + workspace_id, + + + use_default, + + + update_time, + + + + + #{id,jdbcType=VARCHAR}, + + + #{api,jdbcType=INTEGER}, + + + #{performance,jdbcType=INTEGER}, + + + #{maxThreads,jdbcType=INTEGER}, + + + #{duration,jdbcType=INTEGER}, + + + #{resourcePool,jdbcType=VARCHAR}, + + + #{organizationId,jdbcType=VARCHAR}, + + + #{workspaceId,jdbcType=VARCHAR}, + + + #{useDefault,jdbcType=BIT}, + + + #{updateTime,jdbcType=BIGINT}, + + + + + + update quota + + + id = #{record.id,jdbcType=VARCHAR}, + + + api = #{record.api,jdbcType=INTEGER}, + + + performance = #{record.performance,jdbcType=INTEGER}, + + + max_threads = #{record.maxThreads,jdbcType=INTEGER}, + + + duration = #{record.duration,jdbcType=INTEGER}, + + + resource_pool = #{record.resourcePool,jdbcType=VARCHAR}, + + + organization_id = #{record.organizationId,jdbcType=VARCHAR}, + + + workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, + + + use_default = #{record.useDefault,jdbcType=BIT}, + + + update_time = #{record.updateTime,jdbcType=BIGINT}, + + + + + + + + update quota + set id = #{record.id,jdbcType=VARCHAR}, + api = #{record.api,jdbcType=INTEGER}, + performance = #{record.performance,jdbcType=INTEGER}, + max_threads = #{record.maxThreads,jdbcType=INTEGER}, + duration = #{record.duration,jdbcType=INTEGER}, + resource_pool = #{record.resourcePool,jdbcType=VARCHAR}, + organization_id = #{record.organizationId,jdbcType=VARCHAR}, + workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, + use_default = #{record.useDefault,jdbcType=BIT}, + update_time = #{record.updateTime,jdbcType=BIGINT} + + + + + + update quota + + + api = #{api,jdbcType=INTEGER}, + + + performance = #{performance,jdbcType=INTEGER}, + + + max_threads = #{maxThreads,jdbcType=INTEGER}, + + + duration = #{duration,jdbcType=INTEGER}, + + + resource_pool = #{resourcePool,jdbcType=VARCHAR}, + + + organization_id = #{organizationId,jdbcType=VARCHAR}, + + + workspace_id = #{workspaceId,jdbcType=VARCHAR}, + + + use_default = #{useDefault,jdbcType=BIT}, + + + update_time = #{updateTime,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=VARCHAR} + + + update quota + set api = #{api,jdbcType=INTEGER}, + performance = #{performance,jdbcType=INTEGER}, + max_threads = #{maxThreads,jdbcType=INTEGER}, + duration = #{duration,jdbcType=INTEGER}, + resource_pool = #{resourcePool,jdbcType=VARCHAR}, + organization_id = #{organizationId,jdbcType=VARCHAR}, + workspace_id = #{workspaceId,jdbcType=VARCHAR}, + use_default = #{useDefault,jdbcType=BIT}, + update_time = #{updateTime,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ScheduleMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ScheduleMapper.xml index 4e76ebcaea..8718a9b47f 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ScheduleMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ScheduleMapper.xml @@ -2,18 +2,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + @@ -284,18 +284,18 @@ update schedule set id = #{record.id,jdbcType=VARCHAR}, - `key` = #{record.key,jdbcType=VARCHAR}, - `type` = #{record.type,jdbcType=VARCHAR}, - `value` = #{record.value,jdbcType=VARCHAR}, - `group` = #{record.group,jdbcType=VARCHAR}, - job = #{record.job,jdbcType=VARCHAR}, - `enable` = #{record.enable,jdbcType=BIT}, - resource_id = #{record.resourceId,jdbcType=VARCHAR}, - user_id = #{record.userId,jdbcType=VARCHAR}, - workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, - create_time = #{record.createTime,jdbcType=BIGINT}, - update_time = #{record.updateTime,jdbcType=BIGINT}, - custom_data = #{record.customData,jdbcType=LONGVARCHAR} + `key` = #{record.key,jdbcType=VARCHAR}, + `type` = #{record.type,jdbcType=VARCHAR}, + `value` = #{record.value,jdbcType=VARCHAR}, + `group` = #{record.group,jdbcType=VARCHAR}, + job = #{record.job,jdbcType=VARCHAR}, + `enable` = #{record.enable,jdbcType=BIT}, + resource_id = #{record.resourceId,jdbcType=VARCHAR}, + user_id = #{record.userId,jdbcType=VARCHAR}, + workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT}, + custom_data = #{record.customData,jdbcType=LONGVARCHAR} @@ -303,17 +303,17 @@ update schedule set id = #{record.id,jdbcType=VARCHAR}, - `key` = #{record.key,jdbcType=VARCHAR}, - `type` = #{record.type,jdbcType=VARCHAR}, - `value` = #{record.value,jdbcType=VARCHAR}, - `group` = #{record.group,jdbcType=VARCHAR}, - job = #{record.job,jdbcType=VARCHAR}, - `enable` = #{record.enable,jdbcType=BIT}, - resource_id = #{record.resourceId,jdbcType=VARCHAR}, - user_id = #{record.userId,jdbcType=VARCHAR}, - workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, - create_time = #{record.createTime,jdbcType=BIGINT}, - update_time = #{record.updateTime,jdbcType=BIGINT} + `key` = #{record.key,jdbcType=VARCHAR}, + `type` = #{record.type,jdbcType=VARCHAR}, + `value` = #{record.value,jdbcType=VARCHAR}, + `group` = #{record.group,jdbcType=VARCHAR}, + job = #{record.job,jdbcType=VARCHAR}, + `enable` = #{record.enable,jdbcType=BIT}, + resource_id = #{record.resourceId,jdbcType=VARCHAR}, + user_id = #{record.userId,jdbcType=VARCHAR}, + workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT} diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestMapper.xml index 20f2afaa73..c1895316ff 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestMapper.xml @@ -91,7 +91,7 @@ - select api_test.*, project.name as project_name, user.name as user_name from api_test left join project on api_test.project_id = project.id diff --git a/backend/src/main/java/io/metersphere/config/MybatisConfig.java b/backend/src/main/java/io/metersphere/config/MybatisConfig.java index 05b825e6ee..691dd6c976 100644 --- a/backend/src/main/java/io/metersphere/config/MybatisConfig.java +++ b/backend/src/main/java/io/metersphere/config/MybatisConfig.java @@ -18,7 +18,7 @@ import java.util.List; import java.util.Properties; @Configuration -@MapperScan(basePackages = "io.metersphere.base.mapper", sqlSessionFactoryRef = "sqlSessionFactory") +@MapperScan(basePackages = {"io.metersphere.base.mapper", "io.metersphere.xpack.mapper"}, sqlSessionFactoryRef = "sqlSessionFactory") @EnableTransactionManagement public class MybatisConfig { diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index 85f7879c49..fadab72bb6 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit 85f7879c49d2d3b2444d8dc250fa007da4fc8181 +Subproject commit fadab72bb656a3a2644e43bf46783c1f6cd96d4f diff --git a/backend/src/main/resources/db/migration/V13__add_quota.sql b/backend/src/main/resources/db/migration/V13__add_quota.sql new file mode 100644 index 0000000000..bc1d5c4f45 --- /dev/null +++ b/backend/src/main/resources/db/migration/V13__add_quota.sql @@ -0,0 +1,15 @@ +CREATE TABLE IF NOT EXISTS `quota` +( + `id` varchar(50) NOT NULL, + `api` int(10) DEFAULT NULL, + `performance` int(10) DEFAULT NULL, + `max_threads` int(10) DEFAULT NULL, + `duration` int(10) DEFAULT NULL, + `resource_pool` varchar(1000) DEFAULT NULL, + `organization_id` varchar(50) DEFAULT NULL, + `workspace_id` varchar(50) DEFAULT NULL, + `use_default` tinyint(1) DEFAULT NULL, + `update_time` bigint(13) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 \ No newline at end of file diff --git a/frontend/src/business/components/common/router/router.js b/frontend/src/business/components/common/router/router.js index 831b68821e..3686cd64ff 100644 --- a/frontend/src/business/components/common/router/router.js +++ b/frontend/src/business/components/common/router/router.js @@ -1,20 +1,9 @@ import Vue from "vue"; import VueRouter from 'vue-router' import RouterSidebar from "./RouterSidebar"; -import Setting from "../../settings/Setting"; -import User from "../../settings/system/User"; import EditPerformanceTestPlan from "../../performance/test/EditPerformanceTestPlan"; import PerformanceTestPlan from "../../performance/test/PerformanceTestPlan"; -import Organization from "../../settings/system/Organization"; -import OrganizationMember from "../../settings/organization/OrganizationMember"; -import Member from "../../settings/workspace/WorkspaceMember"; -import TestCaseReportTemplate from "../../settings/workspace/TestCaseReportTemplate"; -import TestResourcePool from "../../settings/system/TestResourcePool"; -import SystemParameterSetting from "../../settings/system/SystemParameterSetting"; import MsProject from "../../project/MsProject"; -import OrganizationWorkspace from "../../settings/organization/OrganizationWorkspace"; -import PersonSetting from "../../settings/personal/PersonSetting"; -import SystemWorkspace from "../../settings/system/SystemWorkspace"; import PerformanceChart from "../../performance/report/components/PerformanceChart"; import PerformanceTestReport from "../../performance/report/PerformanceTestReport"; import ApiTest from "../../api/ApiTest"; @@ -32,10 +21,7 @@ import TestCase from "../../track/case/TestCase"; import TestTrack from "../../track/TestTrack"; import ApiReportList from "../../api/report/ApiReportList"; import axios from "axios"; -import ApiKeys from "../../settings/personal/ApiKeys"; -import ServiceIntegration from "../../settings/organization/ServiceIntegration"; - -const requireContext = require.context('@/business/components/xpack/', true, /router\.js$/) +import Setting from "@/business/components/settings/router"; Vue.use(VueRouter); @@ -48,65 +34,7 @@ const router = new VueRouter({ sidebar: RouterSidebar } }, - ...requireContext.keys().map(key => requireContext(key).default), - { - path: "/setting", - components: { - content: Setting - }, - children: [ - { - path: 'user', - component: User, - }, - { - path: 'organization', - component: Organization, - }, - { - path: 'organizationmember', - component: OrganizationMember, - }, - { - path: 'organizationworkspace', - component: OrganizationWorkspace, - }, - { - path: 'serviceintegration', - component: ServiceIntegration, - }, - { - path: 'personsetting', - component: PersonSetting - }, - { - path: 'apikeys', - component: ApiKeys - }, - { - path: 'member', - component: Member - }, - { - path: 'systemworkspace', - component: SystemWorkspace - }, - { - path: 'testresourcepool', - component: TestResourcePool - }, - { - path: 'systemparametersetting', - component: SystemParameterSetting - }, - { - path: 'testcase/report/template', - name: 'testCaseReportTemplate', - component: TestCaseReportTemplate - }, - - ] - }, + Setting, { path: "/api", name: "api", diff --git a/frontend/src/business/components/settings/SettingMenu.vue b/frontend/src/business/components/settings/SettingMenu.vue index fd8b5b3603..33edf1924b 100644 --- a/frontend/src/business/components/settings/SettingMenu.vue +++ b/frontend/src/business/components/settings/SettingMenu.vue @@ -1,48 +1,42 @@ diff --git a/frontend/src/business/components/settings/SettingMenuBackup.vue b/frontend/src/business/components/settings/SettingMenuBackup.vue new file mode 100644 index 0000000000..f161626a7f --- /dev/null +++ b/frontend/src/business/components/settings/SettingMenuBackup.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/frontend/src/business/components/settings/router.js b/frontend/src/business/components/settings/router.js new file mode 100644 index 0000000000..91feff501f --- /dev/null +++ b/frontend/src/business/components/settings/router.js @@ -0,0 +1,88 @@ +import Setting from "@/business/components/settings/Setting"; +import User from "@/business/components/settings/system/User"; +import Organization from "@/business/components/settings/system/Organization"; +import OrganizationMember from "@/business/components/settings/organization/OrganizationMember"; +import OrganizationWorkspace from "@/business/components/settings/organization/OrganizationWorkspace"; +import ServiceIntegration from "@/business/components/settings/organization/ServiceIntegration"; +import PersonSetting from "@/business/components/settings/personal/PersonSetting"; +import ApiKeys from "@/business/components/settings/personal/ApiKeys"; +import Member from "@/business/components/settings/workspace/WorkspaceMember"; +import SystemWorkspace from "@/business/components/settings/system/SystemWorkspace"; +import TestResourcePool from "@/business/components/settings/system/TestResourcePool"; +import SystemParameterSetting from "@/business/components/settings/system/SystemParameterSetting"; +import TestCaseReportTemplate from "@/business/components/settings/workspace/TestCaseReportTemplate"; + +const requireContext = require.context('@/business/components/xpack/', true, /router\.js$/) + +export default { + path: "/setting", + name: "Setting", + components: { + content: Setting + }, + children: [ + { + path: 'user', + component: User, + meta: {system: true, title: 'commons.user'} + }, + { + path: 'organization', + component: Organization, + meta: {system: true, title: 'commons.organization'} + }, + { + path: 'systemworkspace', + component: SystemWorkspace, + meta: {system: true, title: 'commons.workspace'} + }, + { + path: 'testresourcepool', + component: TestResourcePool, + meta: {system: true, title: 'commons.test_resource_pool'} + }, + { + path: 'systemparametersetting', + component: SystemParameterSetting, + meta: {system: true, title: 'commons.system_parameter_setting'} + }, + ...requireContext.keys().map(key => requireContext(key).system), + { + path: 'organizationmember', + component: OrganizationMember, + meta: {organization: true, title: 'commons.member'} + }, + { + path: 'organizationworkspace', + component: OrganizationWorkspace, + meta: {organization: true, title: 'commons.workspace'} + }, + { + path: 'serviceintegration', + component: ServiceIntegration, + meta: {organization: true, title: 'organization.service_integration'} + }, + { + path: 'member', + component: Member, + meta: {workspace: true, title: 'commons.member'} + }, + { + path: 'testcase/report/template', + name: 'testCaseReportTemplate', + component: TestCaseReportTemplate, + meta: {workspace: true, title: 'test_track.plan_view.report_template'} + }, + { + path: 'personsetting', + component: PersonSetting, + meta: {person: true, title: 'commons.personal_setting'} + }, + { + path: 'apikeys', + component: ApiKeys, + meta: {person: true, title: 'commons.api_keys'} + }, + + ] +} diff --git a/frontend/src/business/components/settings/system/User.vue b/frontend/src/business/components/settings/system/User.vue index 8f78c666f5..292511d927 100644 --- a/frontend/src/business/components/settings/system/User.vue +++ b/frontend/src/business/components/settings/system/User.vue @@ -173,7 +173,7 @@ - + @@ -296,7 +296,7 @@ import MsTableOperator from "../../common/components/MsTableOperator"; import MsDialogFooter from "../../common/components/MsDialogFooter"; import MsTableOperatorButton from "../../common/components/MsTableOperatorButton"; - import {getCurrentUser, listenGoBack, removeGoBackListener} from "../../../../common/js/utils"; + import {listenGoBack, removeGoBackListener} from "@/common/js/utils"; import MsRolesTag from "../../common/components/MsRolesTag"; export default { @@ -469,7 +469,7 @@ editUserPassword(editPasswordForm) { this.$refs[editPasswordForm].validate(valid => { if (valid) { - this.result = this.$post(this.editPasswordPath, this.ruleForm, response => { + this.result = this.$post(this.editPasswordPath, this.ruleForm, () => { this.$success(this.$t('commons.modify_success')); this.editPasswordVisible = false; this.search(); @@ -492,7 +492,7 @@ let roles = data.roles; // let userRoles = result.userRoles; this.$set(this.tableData[i], "roles", roles); - this.$set(this.tableData[i], "isLdapUser", this.tableData[i].source === 'LDAP' ? true : false); + this.$set(this.tableData[i], "isLdapUser", this.tableData[i].source === 'LDAP'); }); } }) diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index 52adadce7e..7e4d80cc2b 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit 52adadce7eb781fcab20c5e1ab7e83bd03b24b4e +Subproject commit 7e4d80cc2b870a8cac6dbb9fe6711ab6041faf6d diff --git a/frontend/src/common/js/ajax.js b/frontend/src/common/js/ajax.js index f738df0795..8b4545524b 100644 --- a/frontend/src/common/js/ajax.js +++ b/frontend/src/common/js/ajax.js @@ -64,6 +64,20 @@ export default { } } + Vue.prototype.$$get = function (url, data, success) { + let result = {loading: true}; + if (!success) { + return axios.get(url, {params: data}); + } else { + axios.get(url, {params: data}).then(response => { + then(success, response, result); + }).catch(error => { + exception(error, result); + }); + return result; + } + }; + Vue.prototype.$get = function (url, success) { let result = {loading: true}; if (!success) { @@ -117,7 +131,7 @@ export default { axios.all(array).then(axios.spread(callback)); }; - Vue.prototype.$fileDownload = function(url) { + Vue.prototype.$fileDownload = function (url) { axios.get(url, {responseType: 'blob'}) .then(response => { let fileName = window.decodeURI(response.headers['content-disposition'].split('=')[1]); @@ -128,11 +142,11 @@ export default { }); }; - Vue.prototype.$fileUpload = function(url, file, param, success, failure) { + Vue.prototype.$fileUpload = function (url, file, param, success, failure) { let formData = new FormData(); formData.append("file", file); formData.append('request', new Blob([JSON.stringify(param)], {type: "application/json"})); - let axiosRequestConfig = { + let axiosRequestConfig = { method: 'POST', url: url, data: formData, @@ -140,7 +154,7 @@ export default { 'Content-Type': undefined } }; - return Vue.prototype.$request(axiosRequestConfig, success, failure); + return Vue.prototype.$request(axiosRequestConfig, success, failure); } } diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index e4713201c7..f7d4d08543 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -43,6 +43,8 @@ export default { user: 'User', system: 'System', personal_setting: 'Personal Setting', + api_keys: 'API Keys', + quota: 'Quota', test_resource_pool: 'Resource Pool', system_setting: 'Settings', api: 'API', @@ -766,4 +768,23 @@ export default { no_qualifying_results: "No Qualifying Results", } }, + quota: { + default: { + organization: "Organization Default Quota", + workspace: "Workspace Default Quota", + }, + api: "Number of interface tests", + performance: "Number of performance tests", + resource_pool: "Available test resource pool", + max_threads: "Maximum Concurrency", + duration: "Stress test duration", + use_default: "Use default quota", + yes: "Yes", + no: "No", + edit: "Edit", + list: "Quota List", + modify: "Modify Quota", + edit_quota_title: "{0} quota", + workspace_quota_list: "Workspace quota list of {0}", + } }; diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 016cdfe8cf..b4a69a8d4f 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -36,6 +36,8 @@ export default { phone: '电话', role: '角色', personal_info: '个人信息', + api_keys: 'API Keys', + quota: '配额管理', status: '状态', show_all: '显示全部', show: '显示', @@ -769,4 +771,23 @@ export default { no_qualifying_results: "没有达到条件的结果", } }, + quota: { + default: { + organization: "组织默认配额", + workspace: "工作空间默认配额", + }, + api: "接口测试数量", + performance: "性能测试数量", + resource_pool: "可用测试资源池", + max_threads: "最大并发数", + duration: "压测时长", + use_default: "使用默认配额", + yes: "是", + no: "否", + edit: "编辑", + list: "配额列表", + modify: "修改配额", + edit_quota_title: "{0}的配额", + workspace_quota_list: "{0}的工作空间配额列表", + } }; diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 3038392d69..82e73a7167 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -43,6 +43,8 @@ export default { user: '用戶', system: '系統', personal_setting: '個人設置', + api_keys: 'API Keys', + quota: '配額管理', test_resource_pool: '測試資源池', system_setting: '系統設置', api: '接口測試', @@ -765,4 +767,23 @@ export default { no_qualifying_results: "沒有達到條件的結果", } }, + quota: { + default: { + organization: "組織默認配額", + workspace: "工作空間默認配額", + }, + api: "接口測試數量", + performance: "性能測試數量", + resource_pool: "可用測試資源池", + max_threads: "最大並發數", + duration: "壓測時長", + use_default: "使用默認配額", + yes: "是", + no: "否", + edit: "編輯", + list: "配額列表", + modify: "修改配額", + edit_quota_title: "{0}的配額", + workspace_quota_list: "{0}的工作空間配額列表", + } }; From b43c2f4962e6a8e59853c1c4b450fa72b9f8b3a2 Mon Sep 17 00:00:00 2001 From: q4speed Date: Fri, 14 Aug 2020 13:38:41 +0800 Subject: [PATCH 6/8] refactor: merge db.migration --- .../db/migration/{V13__add_quota.sql => V15__add_quota.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename backend/src/main/resources/db/migration/{V13__add_quota.sql => V15__add_quota.sql} (100%) diff --git a/backend/src/main/resources/db/migration/V13__add_quota.sql b/backend/src/main/resources/db/migration/V15__add_quota.sql similarity index 100% rename from backend/src/main/resources/db/migration/V13__add_quota.sql rename to backend/src/main/resources/db/migration/V15__add_quota.sql From 53ba3dd363128f438002c937b4e98826f6942294 Mon Sep 17 00:00:00 2001 From: wangzhen-fit2cloud Date: Fri, 14 Aug 2020 14:05:04 +0800 Subject: [PATCH 7/8] =?UTF-8?q?docs:=20=E5=9C=A8=20readme=20=E4=B8=AD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=B4=E8=B0=A2=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 6c3febbb0b..b187c2dcdd 100755 --- a/README.md +++ b/README.md @@ -187,6 +187,12 @@ v1.1.0 是 v1.0.0 之后的功能版本。 - 基础设施: [Docker](https://www.docker.com/), [Kubernetes](https://kubernetes.io/) - 测试引擎: [JMeter](https://jmeter.apache.org/) +## 致谢 + +- [BlazeMeter](https://www.blazemeter.com/):感谢 BlazeMeter 提供的设计思路 +- [JMeter](https://jmeter.apache.org/):MeterSphere 使用了 JMeter 作为测试引擎 +- [Element](https://element.eleme.cn/#/):感谢 Element 提供的优秀组件库 + ## 加入 MeterSphere 团队 我们正在招聘 MeterSphere 技术布道师,一起打造开源明星项目,请发简历到 metersphere@fit2cloud.com From 7f9d8235942a07ee18ec344f20a8f32928d203ff Mon Sep 17 00:00:00 2001 From: wangzhen-fit2cloud Date: Fri, 14 Aug 2020 14:22:46 +0800 Subject: [PATCH 8/8] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=20readme=20?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b187c2dcdd..245a2a28ca 100755 --- a/README.md +++ b/README.md @@ -189,9 +189,9 @@ v1.1.0 是 v1.0.0 之后的功能版本。 ## 致谢 -- [BlazeMeter](https://www.blazemeter.com/):感谢 BlazeMeter 提供的设计思路 -- [JMeter](https://jmeter.apache.org/):MeterSphere 使用了 JMeter 作为测试引擎 -- [Element](https://element.eleme.cn/#/):感谢 Element 提供的优秀组件库 +- [BlazeMeter](https://www.blazemeter.com/):感谢 BlazeMeter 提供的设计思路 +- [JMeter](https://jmeter.apache.org/):MeterSphere 使用了 JMeter 作为测试引擎 +- [Element](https://element.eleme.cn/#/):感谢 Element 提供的优秀组件库 ## 加入 MeterSphere 团队