Merge pull request #10698 from dataease/pr@dev-v2@fixDS

fix: API 数据源参数校验
This commit is contained in:
taojinlong 2024-07-02 13:53:47 +08:00 committed by GitHub
commit 6e8afa3071
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 67 additions and 12 deletions

View File

@ -95,10 +95,10 @@ public class DataSourceManage {
if (ObjectUtils.isNotEmpty(dto.getId())) {
wrapper.ne("id", dto.getId());
}
if (ObjectUtils.isNotEmpty(dto.getNodeType()) ) {
if(dto.getNodeType().equalsIgnoreCase("folder")){
if (ObjectUtils.isNotEmpty(dto.getNodeType())) {
if (dto.getNodeType().equalsIgnoreCase("folder")) {
wrapper.eq("type", dto.getType());
}else {
} else {
wrapper.ne("type", "folder");
}

View File

@ -37,6 +37,7 @@ import io.dataease.i18n.Translator;
import io.dataease.job.schedule.CheckDsStatusJob;
import io.dataease.job.schedule.ScheduleManager;
import io.dataease.license.config.XpackInteract;
import io.dataease.license.utils.LicenseUtil;
import io.dataease.log.DeLog;
import io.dataease.model.BusiNodeRequest;
import io.dataease.model.BusiNodeVO;
@ -969,9 +970,10 @@ public class DatasourceServer implements DatasourceApi {
datasources.forEach(datasource -> {
commonThreadPool.addTask(() -> {
try {
LicenseUtil.validate();
validate(datasource);
} catch (Exception e) {
e.printStackTrace();
}
});
});

View File

@ -70,6 +70,7 @@ public class ExportCenterManage {
public void init() {
scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(corePoolSize);
scheduledThreadPoolExecutor.setKeepAliveTime(keepAliveSeconds, TimeUnit.SECONDS);
scheduledThreadPoolExecutor.setMaximumPoolSize(10);
}
@Scheduled(fixedRate = 5000)
@ -154,6 +155,9 @@ public class ExportCenterManage {
public void retry(String id) {
CoreExportTask exportTask = exportTaskMapper.selectById(id);
if(!exportTask.getExportStatus().equalsIgnoreCase("FAILED")){
DEException.throwException("正在导出中!");
}
exportTask.setExportStatus("PENDING");
exportTask.setExportProgress("0");
exportTask.setExportMachineName(hostName());

View File

@ -599,13 +599,18 @@ const handleApiParams = (cmd: string, data) => {
autofocus: false,
showClose: false
}).then(() => {
form.value.paramsConfiguration.splice(0, 1)
let index = 0
for (let i = 0; i < form.value.paramsConfiguration.length; i++) {
if (form.value.paramsConfiguration[i].serialNumber === data.serialNumber) {
index = i
}
}
form.value.paramsConfiguration.splice(index, 1)
if (activeParamsName.value === data.name) {
gridData.value = []
}
})
}
if (cmd === 'edit') {
addApiItem(data)
}

View File

@ -630,15 +630,59 @@ const editDatasource = (editType?: number) => {
}
const handleEdit = async data => {
await handleNodeClick(data)
datasourceEditor.value.init(nodeInfo)
editDatasource()
}
const handleCopy = async data => {
await handleNodeClick(data)
nodeInfo.id = ''
nodeInfo.name = '复制数据源'
datasourceEditor.value.init(nodeInfo)
getById(nodeInfo.id).then(res => {
let {
name,
createBy,
id,
createTime,
creator,
type,
pid,
configuration,
syncSetting,
apiConfigurationStr,
paramsStr,
fileName,
size,
description,
lastSyncTime
} = res.data
if (configuration) {
configuration = JSON.parse(Base64.decode(configuration))
}
if (paramsStr) {
paramsStr = JSON.parse(Base64.decode(paramsStr))
}
if (apiConfigurationStr) {
apiConfigurationStr = JSON.parse(Base64.decode(apiConfigurationStr))
}
let datasource = reactive<Node>(cloneDeep(defaultInfo))
Object.assign(datasource, {
name,
pid,
description,
fileName,
size,
createTime,
creator,
createBy,
id,
type,
configuration,
syncSetting,
apiConfiguration: apiConfigurationStr,
paramsConfiguration: paramsStr,
lastSyncTime
})
datasource.id = ''
datasource.name = '复制数据源'
datasourceEditor.value.init(datasource)
})
}
const handleDatasourceTree = (cmd: string, data?: Tree) => {