Merge pull request #13983 from dataease/pr@dev-v2@fixds

Pr@dev v2@fixds
This commit is contained in:
taojinlong
2024-12-11 17:20:30 +08:00
committed by GitHub
9 changed files with 42 additions and 47 deletions

View File

@@ -18,7 +18,21 @@
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>io.dataease</groupId>
<artifactId>xpack-base</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.dataease</groupId>
<artifactId>xpack-permissions</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.dataease</groupId>
<artifactId>xpack-sync</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.dataease</groupId>
<artifactId>api-base</artifactId>

View File

@@ -57,6 +57,7 @@ public class DatasourceTaskServer {
queryWrapper.eq("ds_id", dsId);
queryWrapper.eq("table_name", tableName);
queryWrapper.orderByDesc("start_time");
queryWrapper.last("limit 1");
List<CoreDatasourceTaskLog> logs = coreDatasourceTaskLogMapper.selectList(queryWrapper);
if (!CollectionUtils.isEmpty(logs)) {
return logs.get(0);
@@ -192,6 +193,14 @@ public class DatasourceTaskServer {
datasourceTaskMapper.update(record, updateTaskWrapper);
}
public void cleanLog() {
long expTime = Long.parseLong("30") * 24L * 3600L * 1000L;
long threshold = System.currentTimeMillis() - expTime;
QueryWrapper<CoreDatasourceTaskLog> queryWrapper = new QueryWrapper<>();
queryWrapper.lt("start_time", threshold);
coreDatasourceTaskLogMapper.delete(queryWrapper);
}
public enum ScheduleType {
CRON, RIGHTNOW, SIMPLE_CRON, MANUAL

View File

@@ -1,5 +1,6 @@
package io.dataease.job.schedule;
import io.dataease.datasource.server.DatasourceTaskServer;
import io.dataease.exportCenter.manage.ExportCenterManage;
import io.dataease.utils.LogUtil;
import jakarta.annotation.Resource;
@@ -11,6 +12,8 @@ public class CleanScheduler {
@Resource(name = "exportCenterManage")
private ExportCenterManage exportCenterManage;
@Resource(name = "datasourceTaskServer")
private DatasourceTaskServer datasourceTaskServer;
@Scheduled(cron = "0 0 0 * * ?")
public void clean() {
@@ -18,4 +21,11 @@ public class CleanScheduler {
exportCenterManage.cleanLog();
LogUtil.info("Execute export file cleaner success");
}
@Scheduled(cron = "0 0 0 * * ?")
public void cleanSyncLog() {
LogUtil.info("Start to clean sync log ...");
datasourceTaskServer.cleanLog();
LogUtil.info("End to clean sync log.");
}
}

View File

@@ -1,8 +1,8 @@
spring:
datasource:
url: jdbc:mysql://localhost:3306/dataease?autoReconnect=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
url: jdbc:mysql://123.57.152.118:3306/dataease?autoReconnect=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: 123456
password: Password123@mysql
messages:
basename: i18n/lic,i18n/core,i18n/permissions,i18n/xpack,i18n/sync
flyway:

View File

@@ -1,3 +1,4 @@
UPDATE `visualization_background` SET `name` = 'Board10' WHERE `id` = 'dark_1';
UPDATE `visualization_subject` SET `name` = 'chart.light_theme' WHERE `id` = '10001';
UPDATE `visualization_subject` SET `name` = 'chart.dark_theme' WHERE `id` = '10002';
CREATE INDEX idx_dataset_table_task_log_A ON core_datasource_task_log(ds_id, table_name, start_time);

View File

@@ -108,47 +108,7 @@ defineExpose({
invokeMethod
})
onMounted(async () => {
const key = 'xpack-model-distributed'
let distributed = false
if (wsCache.get(key) === null) {
const res = await xpackModelApi()
const resData = isNull(res.data) ? 'null' : res.data
wsCache.set('xpack-model-distributed', resData)
distributed = res.data
} else {
distributed = wsCache.get(key)
}
if (isNull(distributed)) {
setTimeout(() => {
emits('loadFail')
loading.value = false
}, 1000)
return
}
if (distributed) {
if (window['DEXPack']) {
const xpack = await window['DEXPack'].mapping[attrs.jsname]
plugin.value = xpack.default
} else if (!window._de_xpack_not_loaded) {
window._de_xpack_not_loaded = true
window['VueDe'] = Vue
window['AxiosDe'] = axios
window['PiniaDe'] = Pinia
window['vueRouterDe'] = router
window['MittAllDe'] = useEmitt().emitter.all
window['I18nDe'] = i18n
window['EchartsDE'] = echarts
if (!window.tinymce) {
window.tinymce = tinymce
}
loadDistributed().then(async res => {
new Function(res.data)()
useEmitt().emitter.emit('load-xpack')
})
}
} else {
loadComponent()
}
loadComponent()
})
</script>

View File

@@ -243,12 +243,12 @@ const callbackExportSuc = () => {
const downLoadAll = () => {
if (multipleSelection.value.length === 0) {
tableData.value.forEach(item => {
window.open(PATH_URL + '/exportCenter/download/' + item.id, openType)
window.open(PATH_URL + '/exportCenter/download/' + item.id)
})
return
}
multipleSelection.value.map(ele => {
window.open(PATH_URL + '/exportCenter/download/' + ele.id, openType)
window.open(PATH_URL + '/exportCenter/download/' + ele.id)
})
}
const showMsg = item => {

View File

@@ -45,6 +45,7 @@ export default {
if (!prefix.endsWith('/')) {
prefix += '/'
}
console.log('newSockJS')
const socket = new SockJS(prefix + 'websocket?userId=' + wsCache.get('user.uid'))
stompClient = Stomp.over(socket)
const heads = {