feat(web): 给没有在运行的flink任务查询任务名称
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
package com.lanyuanxiaoyao.service.web.controller;
|
package com.lanyuanxiaoyao.service.web.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.eshore.odcp.hudi.connector.entity.FlinkJob;
|
||||||
import com.eshore.odcp.hudi.connector.utils.NameHelper;
|
import com.eshore.odcp.hudi.connector.utils.NameHelper;
|
||||||
import com.lanyuanxiaoyao.service.configuration.ExecutorProvider;
|
import com.lanyuanxiaoyao.service.configuration.ExecutorProvider;
|
||||||
import com.lanyuanxiaoyao.service.configuration.entity.info.JobIdAndAlias;
|
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> runningTable = Lists.mutable.empty();
|
||||||
MutableList<JobIdAndAlias> unRunningTable = Lists.mutable.empty();
|
MutableList<JobIdAndAlias> unRunningTable = Lists.mutable.empty();
|
||||||
ImmutableList<JobIdAndAlias> idAliases = infoService.allFlinkJobIdAndAlias();
|
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
|
ids
|
||||||
|
.asParallel(ExecutorProvider.EXECUTORS, 1)
|
||||||
.forEach(id -> {
|
.forEach(id -> {
|
||||||
String lockPath = NameHelper.syncRunningLockPath(id);
|
String lockPath = NameHelper.syncRunningLockPath(id);
|
||||||
if (locks.contains(lockPath)) {
|
if (locks.contains(lockPath)) {
|
||||||
runningJob.add(new JobIdAndAlias(id, ""));
|
runningJob.add(new JobIdAndAlias(id, ""));
|
||||||
} else {
|
} else {
|
||||||
unRunningJob.add(new JobIdAndAlias(id, ""));
|
FlinkJob flinkJob = infoService.flinkJobDetail(id);
|
||||||
|
unRunningJob.add(new JobIdAndAlias(id, flinkJob.getName()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
idAliases
|
idAliases
|
||||||
|
|||||||
@@ -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) {
|
function tableDetailDialog(variable, targetList) {
|
||||||
return {
|
return {
|
||||||
disabledOn: `${variable} === 0`,
|
disabledOn: `${variable} === 0`,
|
||||||
@@ -340,6 +293,8 @@ function overviewTab() {
|
|||||||
{
|
{
|
||||||
type: 'service',
|
type: 'service',
|
||||||
api: '${base}/overview/sync_running_status',
|
api: '${base}/overview/sync_running_status',
|
||||||
|
interval: 10000,
|
||||||
|
silentPolling: true,
|
||||||
body: [
|
body: [
|
||||||
{
|
{
|
||||||
type: 'tpl',
|
type: 'tpl',
|
||||||
@@ -354,7 +309,7 @@ function overviewTab() {
|
|||||||
type: 'tpl',
|
type: 'tpl',
|
||||||
tpl: '已停止<span class="font-bold m-2 font-mono text-danger">${PADSTART(unRunningJob, 3)}</span>'
|
tpl: '已停止<span class="font-bold m-2 font-mono text-danger">${PADSTART(unRunningJob, 3)}</span>'
|
||||||
},
|
},
|
||||||
jobDetailDialog('unRunningJob', 'unRunningJobList'),
|
tableDetailDialog('unRunningJob', 'unRunningJobList'),
|
||||||
'<br/>',
|
'<br/>',
|
||||||
{
|
{
|
||||||
type: 'tpl',
|
type: 'tpl',
|
||||||
|
|||||||
Reference in New Issue
Block a user