Merge branch 'dev' of github.com:dataease/dataease into dev

This commit is contained in:
taojinlong 2022-07-28 14:25:07 +08:00
commit e5ca3808ee
4 changed files with 25 additions and 4 deletions

View File

@ -9,19 +9,25 @@ import io.dataease.controller.handler.annotation.I18n;
import io.dataease.dto.SysLogDTO;
import io.dataease.listener.util.CacheUtils;
import io.dataease.plugins.common.dto.DatasourceBaseType;
import io.dataease.plugins.common.dto.datasource.DataSourceType;
import io.dataease.plugins.config.SpringContextUtil;
import io.dataease.plugins.xpack.auth.dto.request.XpackBaseTreeRequest;
import io.dataease.plugins.xpack.auth.dto.request.XpackSysAuthRequest;
import io.dataease.plugins.xpack.auth.dto.response.XpackSysAuthDetail;
import io.dataease.plugins.xpack.auth.dto.response.XpackSysAuthDetailDTO;
import io.dataease.plugins.xpack.auth.dto.response.XpackVAuthModelDTO;
import io.dataease.service.datasource.DatasourceService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;
import io.dataease.plugins.xpack.auth.service.AuthXpackService;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
@ApiIgnore
@RequestMapping("/plugin/auth")
@RestController
@ -29,6 +35,9 @@ public class XAuthServer {
private static final Set<String> cacheTypes = new HashSet<>();
@Resource
private DatasourceService datasourceService;
@RequiresPermissions("auth:read")
@PostMapping("/authModels")
@I18n
@ -149,7 +158,16 @@ public class XAuthServer {
@GetMapping("/getDatasourceTypes")
public List<DatasourceBaseType> getDatasourceTypes(){
Collection<DataSourceType> activeType = datasourceService.types();
Map<String,String> activeTypeMap = activeType.stream().collect(Collectors.toMap(DataSourceType::getType, DataSourceType::getName));
activeTypeMap.put("all","所有数据源");
AuthXpackService sysAuthService = SpringContextUtil.getBean(AuthXpackService.class);
return sysAuthService.getDatasourceTypes();
List<DatasourceBaseType> presentTypes = sysAuthService.getDatasourceTypes();
presentTypes.stream().forEach(datasourceBaseType -> {
if(activeTypeMap.get(datasourceBaseType.getType())!=null){
datasourceBaseType.setName(activeTypeMap.get(datasourceBaseType.getType()));
}
});
return presentTypes;
}
}

View File

@ -1898,7 +1898,8 @@ export default {
},
auth: {
no_item_selected: 'Please select resources on the left',
no_item_selected: 'Please select organization、user or role on the left',
no_resource_selected: 'Please select resource on the left',
search_pre: 'Search by ',
search_suf: ' name',
separate_auth: 'Separate Authorization',

View File

@ -1907,7 +1907,8 @@ export default {
},
auth: {
no_item_selected: '请在左侧选择资源',
no_item_selected: '请在左侧选择组织、角色或用户',
no_resource_selected: '请在左侧选择资源',
search_pre: '通过',
search_suf: '名称来搜索',
separate_auth: '单独授权',

View File

@ -1916,7 +1916,8 @@ export default {
},
auth: {
no_item_selected: '请在左侧选择资源',
no_item_selected: '请在左侧选择组织、角色或用户',
no_resource_selected: '请在左侧选择资源',
search_pre: '通过',
search_suf: '名称来搜索',
separate_auth: '单独授权',