From 5ac76062c40b679fc68787d9212baac2554c6d60 Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Fri, 12 Jan 2024 09:29:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(web):=20=E7=BB=99=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=9C=A8=E8=BF=90=E8=A1=8C=E7=9A=84flink=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BB=BB=E5=8A=A1=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/OverviewController.java | 8 ++- .../static/components/overview-tab.js | 51 ++----------------- 2 files changed, 9 insertions(+), 50 deletions(-) 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',