diff --git a/service-web/src/main/java/com/lanyuanxiaoyao/service/web/controller/OverviewController.java b/service-web/src/main/java/com/lanyuanxiaoyao/service/web/controller/OverviewController.java index caa32f4..995aa88 100644 --- a/service-web/src/main/java/com/lanyuanxiaoyao/service/web/controller/OverviewController.java +++ b/service-web/src/main/java/com/lanyuanxiaoyao/service/web/controller/OverviewController.java @@ -1,6 +1,8 @@ package com.lanyuanxiaoyao.service.web.controller; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import com.eshore.odcp.hudi.connector.entity.FlinkJob; import com.eshore.odcp.hudi.connector.utils.NameHelper; import com.lanyuanxiaoyao.service.configuration.ExecutorProvider; import com.lanyuanxiaoyao.service.configuration.entity.info.JobIdAndAlias; @@ -155,14 +157,16 @@ public class OverviewController extends BaseController { MutableList runningTable = Lists.mutable.empty(); MutableList unRunningTable = Lists.mutable.empty(); ImmutableList idAliases = infoService.allFlinkJobIdAndAlias(); - ImmutableList ids = idAliases.collect(JobIdAndAlias::getId).distinct(); + ImmutableList ids = idAliases.collect(JobIdAndAlias::getId).reject(ObjectUtil::isNull).distinct(); ids + .asParallel(ExecutorProvider.EXECUTORS, 1) .forEach(id -> { String lockPath = NameHelper.syncRunningLockPath(id); if (locks.contains(lockPath)) { runningJob.add(new JobIdAndAlias(id, "")); } else { - unRunningJob.add(new JobIdAndAlias(id, "")); + FlinkJob flinkJob = infoService.flinkJobDetail(id); + unRunningJob.add(new JobIdAndAlias(id, flinkJob.getName())); } }); idAliases diff --git a/service-web/src/main/resources/static/components/overview-tab.js b/service-web/src/main/resources/static/components/overview-tab.js index 29e0a20..bd30873 100644 --- a/service-web/src/main/resources/static/components/overview-tab.js +++ b/service-web/src/main/resources/static/components/overview-tab.js @@ -94,53 +94,6 @@ function versionDetailDialog(variable, target) { } } -function jobDetailDialog(variable, targetList) { - return { - disabledOn: `${variable} === 0`, - type: 'action', - label: '详情', - level: 'link', - size: 'sm', - actionType: 'dialog', - dialog: { - title: '详情', - size: 'sm', - ...readOnlyDialogOptions(), - body: [ - { - type: "table", - source: `\${${targetList}}`, - affixHeader: false, - columns: [ - { - label: 'Flink job id', - fixed: 'left', - type: 'wrapper', - size: 'none', - body: [ - { - type: 'tpl', - tpl: '${id}', - }, - { - type: 'action', - level: 'link', - label: '', - icon: 'fa fa-copy', - size: 'xs', - actionType: 'copy', - content: '${id}', - tooltip: '复制 ID', - } - ], - }, - ] - } - ] - } - } -} - function tableDetailDialog(variable, targetList) { return { disabledOn: `${variable} === 0`, @@ -340,6 +293,8 @@ function overviewTab() { { type: 'service', api: '${base}/overview/sync_running_status', + interval: 10000, + silentPolling: true, body: [ { type: 'tpl', @@ -354,7 +309,7 @@ function overviewTab() { type: 'tpl', tpl: '已停止${PADSTART(unRunningJob, 3)}' }, - jobDetailDialog('unRunningJob', 'unRunningJobList'), + tableDetailDialog('unRunningJob', 'unRunningJobList'), '
', { type: 'tpl',