forked from github/dataease
Merge pull request #6377 from dataease/pr@dev-v2@fixDatasource
Pr@dev v2@fix datasource
This commit is contained in:
commit
250f46081e
@ -134,7 +134,7 @@ public class DatasourceSyncManage {
|
||||
datasourceRequest.setDatasource(coreDatasource);
|
||||
List<DatasetTableDTO> tables = ApiUtils.getTables(datasourceRequest);
|
||||
for (DatasetTableDTO api : tables) {
|
||||
CoreDatasourceTaskLog datasetTableTaskLog = datasourceTaskServer.initTaskLog(coreDatasource.getId(), taskId, api.getName(), scheduleType);
|
||||
CoreDatasourceTaskLog datasetTableTaskLog = datasourceTaskServer.initTaskLog(coreDatasource.getId(), taskId, api.getTableName(), scheduleType);
|
||||
datasourceRequest.setTable(api.getTableName());
|
||||
List<TableField> tableFields = ApiUtils.getTableFields(datasourceRequest);
|
||||
try {
|
||||
@ -181,7 +181,7 @@ public class DatasourceSyncManage {
|
||||
LogUtil.error("Can not find datasource: " + datasourceId);
|
||||
return;
|
||||
}
|
||||
CoreDatasourceTaskLog datasetTableTaskLog = datasourceTaskServer.initTaskLog(datasourceId, null, name, MANUAL.toString());
|
||||
CoreDatasourceTaskLog datasetTableTaskLog = datasourceTaskServer.initTaskLog(datasourceId, null, tableName, MANUAL.toString());
|
||||
|
||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||
datasourceRequest.setDatasource(coreDatasource);
|
||||
|
@ -846,11 +846,24 @@ public class DatasourceServer implements DatasourceApi {
|
||||
}
|
||||
|
||||
public IPage<CoreDatasourceTaskLogDTO> listSyncRecord(int goPage, int pageSize, Long dsId) {
|
||||
|
||||
|
||||
QueryWrapper<CoreDatasourceTaskLogDTO> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("ds_id", dsId);
|
||||
wrapper.orderByDesc("start_time");
|
||||
Page<CoreDatasourceTaskLogDTO> page = new Page<>(goPage, pageSize);
|
||||
IPage<CoreDatasourceTaskLogDTO> pager = taskLogExtMapper.pager(page, wrapper);
|
||||
CoreDatasource coreDatasource = datasourceMapper.selectById(dsId);
|
||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||
datasourceRequest.setDatasource(coreDatasource);
|
||||
List<DatasetTableDTO> datasetTableDTOS = ApiUtils.getTables(datasourceRequest);
|
||||
for (int i = 0; i < pager.getRecords().size(); i++) {
|
||||
for (int i1 = 0; i1 < datasetTableDTOS.size(); i1++) {
|
||||
if(pager.getRecords().get(i).getTableName().equalsIgnoreCase(datasetTableDTOS.get(i1).getTableName())){
|
||||
pager.getRecords().get(i).setName(datasetTableDTOS.get(i1).getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return pager;
|
||||
}
|
||||
|
||||
|
@ -737,7 +737,7 @@ defineExpose({
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<span
|
||||
v-if="!['es', 'api', 'mongo'].includes(form.type)"
|
||||
v-if="!['es', 'api'].includes(form.type)"
|
||||
class="de-expand"
|
||||
@click="showPriority = !showPriority"
|
||||
>{{ t('datasource.priority') }}
|
||||
|
@ -995,7 +995,7 @@ onMounted(() => {
|
||||
</el-col>
|
||||
</el-row>
|
||||
<span
|
||||
v-if="!['es', 'api', 'mongo'].includes(nodeInfo.type.toLowerCase())"
|
||||
v-if="!['es', 'api'].includes(nodeInfo.type.toLowerCase())"
|
||||
class="de-expand"
|
||||
@click="showPriority = !showPriority"
|
||||
>{{ t('datasource.priority') }}
|
||||
@ -1236,7 +1236,7 @@ onMounted(() => {
|
||||
@size-change="handleRecordSizeChange"
|
||||
@current-change="handleRecordCurrentChange"
|
||||
>
|
||||
<el-table-column prop="tableName" :label="t('datasource.data_table')"></el-table-column>
|
||||
<el-table-column prop="name" :label="t('datasource.data_table')"></el-table-column>
|
||||
<el-table-column prop="triggerType" :label="t('datasource.sync_rate')">
|
||||
<template #default="scope">
|
||||
<div class="flex-align-center">
|
||||
|
@ -55,6 +55,7 @@ public class CoreDatasourceTaskLogDTO implements Serializable {
|
||||
*/
|
||||
private String taskStatus;
|
||||
private String tableName;
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
|
Loading…
Reference in New Issue
Block a user