feat(web): 给没有在运行的flink任务查询任务名称

This commit is contained in:
2024-01-12 09:29:07 +08:00
parent 820c8438b1
commit 5ac76062c4
2 changed files with 9 additions and 50 deletions

View File

@@ -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<JobIdAndAlias> runningTable = Lists.mutable.empty();
MutableList<JobIdAndAlias> unRunningTable = Lists.mutable.empty();
ImmutableList<JobIdAndAlias> idAliases = infoService.allFlinkJobIdAndAlias();
ImmutableList<Long> ids = idAliases.collect(JobIdAndAlias::getId).distinct();
ImmutableList<Long> 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

View File

@@ -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: '已停止<span class="font-bold m-2 font-mono text-danger">${PADSTART(unRunningJob, 3)}</span>'
},
jobDetailDialog('unRunningJob', 'unRunningJobList'),
tableDetailDialog('unRunningJob', 'unRunningJobList'),
'<br/>',
{
type: 'tpl',