Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	backend/src/main/java/io/metersphere/controller/SystemParameterController.java
#	backend/src/main/java/io/metersphere/service/SystemParameterService.java
This commit is contained in:
wenyann 2020-06-04 18:34:32 +08:00
commit 285037e475
21 changed files with 215 additions and 89 deletions

View File

@ -31,6 +31,7 @@
AND u.email like CONCAT('%', #{userRequest.email},'%')
</if>
</where>
order by u.update_time desc
</select>
<!--修改密码-->

View File

@ -43,6 +43,7 @@
<if test="member.name != null">
AND `user`.name like CONCAT('%', #{member.name},'%')
</if>
order by user_role.update_time desc
</select>
<select id="getOrgMemberList" resultType="io.metersphere.base.domain.User">
@ -51,6 +52,7 @@
<if test="orgMember.name != null">
AND `user`.name like CONCAT('%', #{orgMember.name},'%')
</if>
order by user_role.update_time desc
</select>
<select id="getOrganizationMemberDTO" resultMap="BaseOrganizationMemberDTOMap">

View File

@ -10,6 +10,7 @@
AND w.name LIKE #{request.name,jdbcType=VARCHAR}
</if>
</where>
order by w.update_time desc
</select>
</mapper>

View File

@ -1,10 +1,11 @@
package io.metersphere.controller;
import io.metersphere.base.domain.SystemParameter;
import io.metersphere.commons.constants.ParamConstants;
import io.metersphere.service.SystemParameterService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.HashMap;
@ -25,9 +26,5 @@ public class SystemParameterController {
public void testConnection(@RequestBody HashMap<String, String> hashMap) {
SystemParameterService.testConnection(hashMap);
}
@GetMapping("/mail/info")
public Object mailInfo() {
return SystemParameterService.mailInfo(ParamConstants.Classify.MAIL.getValue());
}
}

View File

@ -63,6 +63,7 @@ public class OrganizationService {
if (StringUtils.isNotBlank(request.getName())) {
criteria.andNameLike(StringUtils.wrapIfMissing(request.getName(), "%"));
}
example.setOrderByClause("update_time desc");
return organizationMapper.selectByExample(example);
}

View File

@ -15,7 +15,9 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.mail.MessagingException;
import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Properties;
@Service
@ -81,30 +83,7 @@ public class SystemParameterService {
} catch (MessagingException e) {
MSException.throwException(Translator.get("connection_failed"));
}
}
public Object mailInfo(String type) {
List<SystemParameter> paramList = this.getParamList(type);
if (CollectionUtils.isEmpty(paramList)) {
paramList = new ArrayList<>();
ParamConstants.MAIL[] values = ParamConstants.MAIL.values();
for (ParamConstants.MAIL value : values) {
SystemParameter systemParameter = new SystemParameter();
if (value.equals(ParamConstants.MAIL.PASSWORD)) {
systemParameter.setType(ParamConstants.Type.PASSWORD.getValue());
} else {
systemParameter.setType(ParamConstants.Type.TEXT.getValue());
}
systemParameter.setParamKey(value.getKey());
systemParameter.setSort(value.getValue());
paramList.add(systemParameter);
}
} else {
paramList.stream().filter(param -> param.getParamKey().equals(ParamConstants.MAIL.PASSWORD.getKey())).forEach(param -> {
String string = EncryptUtils.aesDecrypt(param.getParamValue()).toString();
param.setParamValue(string);
});
}
paramList.sort(Comparator.comparingInt(SystemParameter::getSort));
return paramList;
}
}

View File

@ -125,6 +125,7 @@ public class TestResourcePoolService {
if (StringUtils.isNotBlank(request.getName())) {
criteria.andNameLike(StringUtils.wrapIfMissing(request.getName(), "%"));
}
example.setOrderByClause("update_time desc");
List<TestResourcePool> testResourcePools = testResourcePoolMapper.selectByExample(example);
List<TestResourcePoolDTO> testResourcePoolDTOS = new ArrayList<>();
testResourcePools.forEach(pool -> {

View File

@ -83,6 +83,7 @@ public class WorkspaceService {
if (StringUtils.isNotBlank(request.getName())) {
criteria.andNameLike(StringUtils.wrapIfMissing(request.getName(), "%"));
}
example.setOrderByClause("update_time desc");
return workspaceMapper.selectByExample(example);
}

View File

@ -11,6 +11,7 @@
"@ckeditor/ckeditor5-build-classic": "^18.0.0",
"@ckeditor/ckeditor5-vue": "^1.0.1",
"@fortawesome/fontawesome-svg-core": "^1.2.26",
"@fortawesome/free-brands-svg-icons": "^5.13.0",
"@fortawesome/free-regular-svg-icons": "^5.12.0",
"@fortawesome/free-solid-svg-icons": "^5.12.0",
"@fortawesome/vue-fontawesome": "^0.1.9",

View File

@ -0,0 +1,109 @@
<template>
<el-dialog
:title="$t('commons.about_us')"
:visible.sync="dialogVisible"
width="20%">
<el-row>
<el-col>
<el-link :underline="false" :href="websiteUrl" target="_blank">
<img class="logo" src="../../../../assets/favicon-彩色.png"/>
</el-link>
<el-link class="url" :href="websiteUrl" target="_blank">
<span>{{websiteUrl}}</span>
</el-link>
</el-col>
</el-row>
<el-row>
<el-col>
<div class="github">
<el-link :underline="false" :href="githubUrl" target="_blank">
<font-awesome-icon class="github-icon" :icon="['fab', 'github-square']"/>
</el-link>
</div>
<el-link class="url" :href="githubUrl" target="_blank">
<span>{{githubUrl}}</span>
</el-link>
</el-col>
</el-row>
<el-row>
<el-col class="version">
<span>版本:</span> &nbsp;
<span>{{version}}</span>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
export default {
name: "AboutUs",
data() {
return {
dialogVisible: false,
githubUrl: 'https://github.com/metersphere/metersphere',
websiteUrl: 'https://github.com/metersphere/metersphere',
version: '1.0.1'
}
},
created() {
this.getVersion();
},
methods: {
open() {
this.dialogVisible = true;
},
getVersion() {
this.$get('/system/version', response => {
this.version = response.data;
});
}
}
}
</script>
<style scoped>
.logo {
height: 30px;
line-height: 30px;
vertical-align: middle
}
.version {
height: 30px;
line-height: 30px;
margin-left: 5px;
}
.github-icon {
font-size: 20px;
margin-left: 5px;
}
.github {
height: 30px;
width: 30px;
line-height: 30px;
display: inline-block;
}
.el-row {
margin-bottom: 3%;
}
.logo:hover {
color: deepskyblue;
}
.url {
margin-left: 5px;
}
</style>

View File

@ -7,16 +7,21 @@
<el-dropdown-menu>
<el-dropdown-item command="personal">{{$t('commons.personal_information')}}</el-dropdown-item>
<el-dropdown-item command="logout">{{$t('commons.exit_system')}}</el-dropdown-item>
<el-dropdown-item command="about">{{$t('commons.about_us')}} <i class="el-icon-info"/></el-dropdown-item>
</el-dropdown-menu>
</template>
<about-us ref="aboutUs"/>
</el-dropdown>
</template>
<script>
import {getCurrentUser} from "../../../../common/js/utils";
import AboutUs from "./AboutUs";
export default {
name: "MsUser",
components: {AboutUs},
computed: {
currentUser: () => {
return getCurrentUser();
@ -35,6 +40,9 @@
window.location.href = "/login";
});
break;
case "about":
this.$refs.aboutUs.open();
break;
default:
break;
}

View File

@ -10,7 +10,7 @@
>
<el-table-column
prop="errorType"
label="Type of Error"
label="Type of error"
sortable>
</el-table-column>
<el-table-column
@ -32,7 +32,7 @@
<div style="margin-top: 40px;"></div>
<span class="table-title">Top 5 Errors by sampler </span>
<span class="table-title">Top 5 Errors</span>
<el-table
:data="errorTop5"
border
@ -43,7 +43,7 @@
<el-table-column
prop="sample"
label="Sample"
width="400"
width="200"
>
</el-table-column>
<el-table-column
@ -54,71 +54,72 @@
</el-table-column>
<el-table-column
prop="errorsAllSize"
label="#Errors"
label="All Errors"
width="100"
>
</el-table-column>
<el-table-column
prop="error1"
label="Error"
label="#1 Error"
width="400"
>
</el-table-column>
<el-table-column
prop="error1Size"
label="#Errors"
width="100"
label="#1 Errors Count"
width="150"
>
</el-table-column>
<el-table-column
prop="error2"
label="Error"
label="#2 Error"
width="400"
>
</el-table-column>
<el-table-column
prop="error2Size"
label="#Errors"
width="100"
label="#2 Errors Count"
width="150"
>
</el-table-column>
<el-table-column
prop="error3"
label="Error"
label="#3 Error"
width="400"
>
</el-table-column>
<el-table-column
prop="error3Size"
label="#Errors"
width="100"
label="#3 Errors Count"
width="150"
>
</el-table-column>
<el-table-column
prop="error4"
label="Error"
label="#4 Error"
width="400"
>
</el-table-column>
<el-table-column
prop="error4Size"
label="#Errors"
width="100"
label="#4 Errors Count"
width="150"
>
</el-table-column>
<el-table-column
prop="error5"
label="Error"
label="#5 Error"
width="400"
>
</el-table-column>
<el-table-column
prop="error5Size"
label="#Errors"
width="100"
label="#5 Errors Count"
width="150"
>
</el-table-column>
</el-table>

View File

@ -78,7 +78,7 @@
<el-form-item :label="$t('commons.phone')" prop="phone">
<el-input v-model="form.phone" autocomplete="off" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('commons.role')" prop="roleIds">
<el-form-item :label="$t('commons.role')" prop="roleIds" :rules="{required: true, message: $t('role.please_choose_role'), trigger: 'change'}">
<el-select v-model="form.roleIds" multiple :placeholder="$t('role.please_choose_role')" class="select-width">
<el-option
v-for="item in form.allroles"
@ -175,7 +175,7 @@
// 使
this.$set(this.form, 'roleIds', roleIds);
},
updateOrgMember() {
updateOrgMember(formName) {
let param = {
id: this.form.id,
name: this.form.name,
@ -184,11 +184,15 @@
roleIds: this.form.roleIds,
organizationId: this.currentUser().lastOrganizationId
}
this.$refs[formName].validate((valid) => {
if (valid) {
this.result = this.$post("/organization/member/update", param, () => {
this.$success(this.$t('commons.modify_success'));
this.updateVisible = false;
this.initTableData();
});
}
})
},
del(row) {
this.$confirm(this.$t('member.remove_member'), '', {

View File

@ -125,7 +125,7 @@
<el-form-item :label="$t('commons.phone')" prop="phone">
<el-input v-model="memberForm.phone" autocomplete="off" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('commons.role')" prop="roleIds">
<el-form-item :label="$t('commons.role')" prop="roleIds" :rules="{required: true, message: $t('role.please_choose_role'), trigger: 'change'}">
<el-select v-model="memberForm.roleIds" multiple :placeholder="$t('role.please_choose_role')"
class="select-width">
<el-option
@ -366,7 +366,7 @@
this.$info(this.$t('commons.remove_cancel'));
});
},
updateOrgMember() {
updateOrgMember(formName) {
let param = {
id: this.memberForm.id,
name: this.memberForm.name,
@ -375,11 +375,15 @@
roleIds: this.memberForm.roleIds,
workspaceId: this.currentWorkspaceRow.id
}
this.$refs[formName].validate((valid) => {
if (valid) {
this.result = this.$post("/workspace/member/update", param, () => {
this.$success(this.$t('commons.modify_success'));
this.dialogWsMemberUpdateVisible = false;
this.cellClick(this.currentWorkspaceRow);
});
}
})
},
buildPagePath(path) {
return path + "/" + this.dialogCurrentPage + "/" + this.dialogPageSize;

View File

@ -145,7 +145,7 @@
<el-form-item :label="$t('commons.phone')" prop="phone">
<el-input v-model="memberForm.phone" autocomplete="off" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('commons.role')" prop="roleIds">
<el-form-item :label="$t('commons.role')" prop="roleIds" :rules="{required: true, message: $t('role.please_choose_role'), trigger: 'change'}">
<el-select v-model="memberForm.roleIds" multiple :placeholder="$t('role.please_choose_role')"
class="select-width">
<el-option
@ -427,7 +427,7 @@
}
});
},
updateOrgMember() {
updateOrgMember(formName) {
let param = {
id: this.memberForm.id,
name: this.memberForm.name,
@ -436,11 +436,15 @@
roleIds: this.memberForm.roleIds,
organizationId: this.currentRow.id
}
this.$refs[formName].validate((valid) => {
if (valid) {
this.result = this.$post("/organization/member/update", param, () => {
this.$success(this.$t('commons.modify_success'));
this.dialogOrgMemberUpdateVisible = false;
this.cellClick(this.currentRow);
});
}
});
},
}

View File

@ -164,7 +164,7 @@
<el-form-item :label="$t('commons.phone')" prop="phone">
<el-input v-model="memberForm.phone" autocomplete="off" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('commons.role')" prop="roleIds">
<el-form-item :label="$t('commons.role')" prop="roleIds" :rules="{required: true, message: $t('role.please_choose_role'), trigger: 'change'}">
<el-select v-model="memberForm.roleIds" multiple :placeholder="$t('role.please_choose_role')"
class="select-width">
<el-option
@ -405,7 +405,7 @@
this.$info(this.$t('commons.remove_cancel'));
});
},
updateWorkspaceMember() {
updateWorkspaceMember(formName) {
let param = {
id: this.memberForm.id,
name: this.memberForm.name,
@ -414,11 +414,15 @@
roleIds: this.memberForm.roleIds,
workspaceId: this.currentWorkspaceRow.id
}
this.$refs[formName].validate((valid) => {
if (valid) {
this.result = this.$post("/workspace/member/update", param, () => {
this.$success(this.$t('commons.modify_success'));
this.dialogWsMemberUpdateVisible = false;
this.cellClick(this.currentWorkspaceRow);
});
}
});
},
},
data() {

View File

@ -79,7 +79,7 @@
<el-form-item :label="$t('commons.phone')" prop="phone">
<el-input v-model="form.phone" autocomplete="off" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('commons.role')" prop="roleIds">
<el-form-item :label="$t('commons.role')" prop="roleIds" :rules="{required: true, message: $t('role.please_choose_role'), trigger: 'change'}">
<el-select v-model="form.roleIds" multiple :placeholder="$t('role.please_choose_role')" class="select-width">
<el-option
v-for="item in form.allroles"
@ -197,7 +197,7 @@
// 使
this.$set(this.form, 'roleIds', roleIds);
},
updateWorkspaceMember() {
updateWorkspaceMember(formName) {
let param = {
id: this.form.id,
name: this.form.name,
@ -206,11 +206,15 @@
roleIds: this.form.roleIds,
workspaceId: this.currentUser().lastWorkspaceId
}
this.$refs[formName].validate((valid) => {
if (valid) {
this.result = this.$post("/workspace/member/update", param, () => {
this.$success(this.$t('commons.modify_success'));
this.updateVisible = false;
this.initTableData();
});
}
});
},
create() {
this.form = {};

View File

@ -1,11 +1,12 @@
import {library} from '@fortawesome/fontawesome-svg-core'
import {fas} from '@fortawesome/free-solid-svg-icons'
import {far} from '@fortawesome/free-regular-svg-icons'
import { fab } from '@fortawesome/free-brands-svg-icons'
import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'
export default {
install(Vue) {
library.add(fas, far);
library.add(fas, far, fab);
Vue.component('font-awesome-icon', FontAwesomeIcon);
}
}

View File

@ -4,6 +4,7 @@ export default {
'organization': 'Organization',
'setting': 'Setting',
'project': 'Project',
'about_us': 'About Us',
current_project: 'Current Project',
'name': 'Name',
'description': 'Description',

View File

@ -4,6 +4,7 @@ export default {
'organization': '组织',
'setting': '设置',
'project': '项目',
'about_us': '关于',
current_project: '当前项目',
'name': '名称',
'description': '描述',

View File

@ -4,6 +4,7 @@ export default {
'organization': '組織',
'setting': '設置',
'project': '項目',
'about_us': '關於',
current_project: '當前項目',
'name': '名稱',
'description': '描述',