perf(X-Pack): 游离资源管理页面

This commit is contained in:
fit2cloud-chenyw 2024-11-22 10:36:29 +08:00
parent c7dd3a7ad6
commit 9a5ef82558
5 changed files with 58 additions and 3 deletions

View File

@ -107,6 +107,8 @@ public class DatasourceServer implements DatasourceApi {
private PluginManageApi pluginManage; private PluginManageApi pluginManage;
@Autowired(required = false) @Autowired(required = false)
private RelationApi relationManage; private RelationApi relationManage;
@Autowired
private CoreDatasourceMapper coreDatasourceMapper;
public enum UpdateType { public enum UpdateType {
all_scope, add_scope all_scope, add_scope
@ -1209,4 +1211,25 @@ public class DatasourceServer implements DatasourceApi {
return datasourceDTO; return datasourceDTO;
} }
@Override
public DsSimpleVO simple(Long id) {
if (ObjectUtils.isEmpty(id)) DEException.throwException("id is null");
CoreDatasource coreDatasource = coreDatasourceMapper.selectById(id);
if (ObjectUtils.isEmpty(coreDatasource)) return null;
DsSimpleVO vo = new DsSimpleVO();
vo.setName(coreDatasource.getName());
vo.setType(coreDatasource.getType());
vo.setDescription(coreDatasource.getDescription());
String configuration = coreDatasource.getConfiguration();
DatasourceConfiguration config = null;
String host = null;
if (StringUtils.isBlank(configuration)
|| StringUtils.equalsIgnoreCase("[]", configuration)
|| ObjectUtils.isEmpty(config = JsonUtil.parseObject(configuration, DatasourceConfiguration.class))
|| StringUtils.isBlank(host = config.getHost())) {
return vo;
}
vo.setHost(host);
return vo;
}
} }

View File

@ -3843,8 +3843,17 @@ export default {
quick_del_confirm: '确定删除所有游离资源吗', quick_del_confirm: '确定删除所有游离资源吗',
quick_del_tips: '资源删除后不可撤销', quick_del_tips: '资源删除后不可撤销',
quick_sync_confirm: '确定迁移所有游离资源吗', quick_sync_confirm: '确定迁移所有游离资源吗',
quick_sync_confirm_tips: '迁移删除不可撤销请谨慎操作', quick_sync_confirm_tips: '迁移资源不可撤销请谨慎操作',
batch_sync_confirm: '确定迁移 {0} 项及其相关游离资源吗', batch_sync_confirm: '确定迁移 {0} 项及其相关游离资源吗',
single_sync_confirm: '确定迁移该资源吗' single_sync_confirm: '确定迁移该资源吗',
batch_del_confirm: '确定删除 {0} 项资源吗',
batch_del_confirm_tips: '资源删除后不可撤销请谨慎操作',
del_tips_dataset: '删除数据集会造成相关数据集失效确定删除',
del_tips_datasource: '有数据集正在使用这些数据源删除后数据集不可用确定删除',
single_del_confirm: '确定删除该{0}',
single_del_tips_dataset: '该数据集存在如下血缘关系删除会造成相关视图失效确定删除',
single_del_tips_datasource: ' {0} 个数据集正在使用此数据源删除后数据集不可用确定删除',
folder: '文件夹',
del_folder_tips: '删除后此文件夹下的所有资源都会被删除请谨慎操作'
} }
} }

@ -1 +1 @@
Subproject commit 4d24ba63004826d8a87f42f7e25798cc4e94345f Subproject commit 282f497c1f7c79e1db8c6b300d3f13ffe205a38d

View File

@ -159,4 +159,7 @@ public interface DatasourceApi {
List<DatasourceDTO> innerList(List<Long> ids, List<String> types) throws DEException; List<DatasourceDTO> innerList(List<Long> ids, List<String> types) throws DEException;
@GetMapping("/simple/{id}")
DsSimpleVO simple(@PathVariable("id") Long id);
} }

View File

@ -0,0 +1,20 @@
package io.dataease.api.ds.vo;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
@Data
public class DsSimpleVO implements Serializable {
@Serial
private static final long serialVersionUID = 46446424188194481L;
private String name;
private String type;
private String description;
private String host;
}