feature(web): 增加flink job id和alias输入框的联动
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package com.lanyuanxiaoyao.service.configuration.entity;
|
||||
|
||||
/**
|
||||
* 常见Item封装
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2023-11-30
|
||||
*/
|
||||
public class Item {
|
||||
private final String label;
|
||||
private final String value;
|
||||
|
||||
public Item(String value) {
|
||||
this(value, value);
|
||||
}
|
||||
|
||||
public Item(Number value) {
|
||||
this(value, value);
|
||||
}
|
||||
|
||||
public Item(String label, String value) {
|
||||
this.label = label;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Item(Number label, Number value) {
|
||||
this(label.toString(), value.toString());
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Item{" +
|
||||
"label='" + label + '\'' +
|
||||
", value='" + value + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -115,6 +115,9 @@ public interface InfoService {
|
||||
@Get("/info/all_flink_job_id")
|
||||
ImmutableList<Long> allFlinkJobId(@Query("key") String key, @Query("alias") String alias);
|
||||
|
||||
@Get("/info/all_flink_job_id")
|
||||
ImmutableList<Long> allFlinkJobIdByAlias(@Query("alias") String alias);
|
||||
|
||||
@Get("/info/all_alias")
|
||||
ImmutableList<String> allAlias();
|
||||
|
||||
@@ -124,6 +127,9 @@ public interface InfoService {
|
||||
@Get("/info/all_alias")
|
||||
ImmutableList<String> allAlias(@Query("key") String key, @Query("flink_job_id") String flinkJobId);
|
||||
|
||||
@Get("/info/all_alias")
|
||||
ImmutableList<String> allAliasByFlinkJobId(@Query("flink_job_id") String flinkJobId);
|
||||
|
||||
@Get("/info/all_hdfs")
|
||||
ImmutableList<String> allHdfs();
|
||||
|
||||
|
||||
@@ -8,9 +8,8 @@ import com.eshore.odcp.hudi.connector.entity.SyncState;
|
||||
import com.eshore.odcp.hudi.connector.entity.TableMeta;
|
||||
import com.eshore.odcp.hudi.connector.utils.NameHelper;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
import com.github.benmanes.caffeine.cache.LoadingCache;
|
||||
import com.lanyuanxiaoyao.service.configuration.ExecutorProvider;
|
||||
import com.lanyuanxiaoyao.service.configuration.entity.Item;
|
||||
import com.lanyuanxiaoyao.service.configuration.entity.PageResponse;
|
||||
import com.lanyuanxiaoyao.service.configuration.entity.info.CompactionMetrics;
|
||||
import com.lanyuanxiaoyao.service.configuration.entity.info.JobIdAndAlias;
|
||||
@@ -24,9 +23,7 @@ import com.lanyuanxiaoyao.service.web.entity.CompactionMetricsVO;
|
||||
import com.lanyuanxiaoyao.service.web.entity.FlinkJobVO;
|
||||
import com.lanyuanxiaoyao.service.web.entity.SyncStateVO;
|
||||
import com.lanyuanxiaoyao.service.web.entity.TableVO;
|
||||
import java.time.Duration;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
@@ -197,42 +194,30 @@ public class TableController extends BaseController {
|
||||
|
||||
@SuppressWarnings("DataFlowIssue")
|
||||
@GetMapping("all_flink_job_id")
|
||||
public AmisCrudResponse allFlinkJobId(
|
||||
@RequestParam(value = "key", required = false) String key,
|
||||
@RequestParam(value = "alias", required = false) String alias
|
||||
) {
|
||||
if (StrUtil.isBlank(key)) {
|
||||
return AmisResponse.responseCrudData(Lists.immutable.empty());
|
||||
}
|
||||
public AmisResponse<ImmutableList<Item>> allFlinkJobId(@RequestParam(value = "alias", required = false) String alias) {
|
||||
if (StrUtil.isBlank(alias)) {
|
||||
return AmisResponse.responseCrudData(infoService.allFlinkJobId(key).collect(Objects::toString));
|
||||
return AmisResponse.responseSuccess(infoService.allFlinkJobId().collect(Item::new));
|
||||
} else {
|
||||
return AmisResponse.responseCrudData(infoService.allFlinkJobId(key, alias).collect(Objects::toString));
|
||||
return AmisResponse.responseSuccess(infoService.allFlinkJobIdByAlias(alias).collect(Item::new));
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("DataFlowIssue")
|
||||
@GetMapping("all_alias")
|
||||
public AmisCrudResponse allAlias(
|
||||
@RequestParam(value = "key", required = false) String key,
|
||||
@RequestParam(value = "flink_job_id", required = false) String flinkJobId
|
||||
) {
|
||||
if (StrUtil.isBlank(key) && StrUtil.isBlank(flinkJobId)) {
|
||||
return AmisResponse.responseCrudData(Lists.immutable.empty());
|
||||
}
|
||||
public AmisResponse<ImmutableList<Item>> allAlias(@RequestParam(value = "flink_job_id", required = false) String flinkJobId) {
|
||||
if (StrUtil.isBlank(flinkJobId)) {
|
||||
return AmisResponse.responseCrudData(infoService.allAlias(key));
|
||||
return AmisResponse.responseSuccess(infoService.allAlias().collect(Item::new));
|
||||
} else {
|
||||
return AmisResponse.responseCrudData(infoService.allAlias(key, flinkJobId));
|
||||
return AmisResponse.responseSuccess(infoService.allAliasByFlinkJobId(flinkJobId).collect(Item::new));
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("DataFlowIssue")
|
||||
@GetMapping("all_hdfs")
|
||||
public AmisCrudResponse allHdfs(@RequestParam(value = "key", required = false) String key) {
|
||||
public AmisResponse<ImmutableList<Item>> allHdfs(@RequestParam(value = "key", required = false) String key) {
|
||||
if (StrUtil.isBlank(key)) {
|
||||
return AmisResponse.responseCrudData(Lists.immutable.empty());
|
||||
return AmisResponse.responseSuccess(infoService.allHdfs().collect(Item::new));
|
||||
}
|
||||
return AmisResponse.responseCrudData(infoService.allHdfs(key));
|
||||
return AmisResponse.responseSuccess(infoService.allHdfs(key).collect(Item::new));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,3 +65,6 @@ GET {{url}}/hudi_services/hudi_api/api/message_id?flink_job_id=15420979841327063
|
||||
|
||||
###
|
||||
GET http://132.122.116.149:35680/api/message_id?flink_job_id=1542097984132706304&alias=crm_cfguse_mkt_cam_strategy_rel
|
||||
|
||||
### Deploy plan
|
||||
GET {{web-url}}/cloud/deploy_plan
|
||||
|
||||
@@ -1927,39 +1927,81 @@ function filterableField(mapping, multiple = false) {
|
||||
}
|
||||
}
|
||||
|
||||
function flinkJobIdTextInput(require = false) {
|
||||
function formReloadFlinkJobIdTextInputAndAliasTextInput(id) {
|
||||
return {
|
||||
type: 'input-text',
|
||||
onEvent: {
|
||||
change: {
|
||||
actions: [
|
||||
{
|
||||
actionType: 'reload',
|
||||
componentId: `flink-job-id-input-select-${id}`
|
||||
},
|
||||
{
|
||||
actionType: 'reload',
|
||||
componentId: `alias-input-select-${id}`
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function flinkJobIdTextInput(id, require = false) {
|
||||
return {
|
||||
id: `flink-job-id-input-select-${id}`,
|
||||
type: 'select',
|
||||
name: 'flinkJobId',
|
||||
label: 'Flink job id',
|
||||
placeholder: '通过 ID 搜索',
|
||||
clearable: true,
|
||||
required: require,
|
||||
autoComplete: {
|
||||
searchable: true,
|
||||
source: {
|
||||
method: 'get',
|
||||
url: '${base}/table/all_flink_job_id?key=$term',
|
||||
url: '${base}/table/all_flink_job_id',
|
||||
data: {
|
||||
alias: '${alias|default:undefined}'
|
||||
}
|
||||
},
|
||||
/*onEvent: {
|
||||
change: {
|
||||
actions: [
|
||||
{
|
||||
actionType: 'reload',
|
||||
componentId: `alias-input-select-${id}`,
|
||||
},
|
||||
]
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
function aliasTextInput(require = false) {
|
||||
function aliasTextInput(id, require = false) {
|
||||
return {
|
||||
type: 'input-text',
|
||||
id: `alias-input-select-${id}`,
|
||||
type: 'select',
|
||||
name: 'alias',
|
||||
label: '别名',
|
||||
placeholder: '通过别名搜索',
|
||||
clearable: true,
|
||||
required: require,
|
||||
creatable: false,
|
||||
autoComplete: {
|
||||
searchable: true,
|
||||
source: {
|
||||
method: 'get',
|
||||
url: '${base}/table/all_alias?key=$term',
|
||||
url: '${base}/table/all_alias',
|
||||
data: {
|
||||
flink_job_id: '${flinkJobId|default:undefined}'
|
||||
}
|
||||
},
|
||||
/*onEvent: {
|
||||
change: {
|
||||
actions: [
|
||||
{
|
||||
actionType: 'reload',
|
||||
componentId: `flink-job-id-input-select-${id}`
|
||||
},
|
||||
]
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,17 +28,18 @@ function tableTab() {
|
||||
// interval: 10000,
|
||||
filter: {
|
||||
title: '表筛选',
|
||||
...formReloadFlinkJobIdTextInputAndAliasTextInput("58d0da94-1b3c-4234-948d-482ae3425e70"),
|
||||
body: [
|
||||
{
|
||||
type: 'group',
|
||||
body: [
|
||||
{
|
||||
...flinkJobIdTextInput(),
|
||||
size: 'md',
|
||||
...flinkJobIdTextInput("58d0da94-1b3c-4234-948d-482ae3425e70"),
|
||||
size: 'lg',
|
||||
},
|
||||
{
|
||||
...aliasTextInput(),
|
||||
size: 'md',
|
||||
...aliasTextInput("58d0da94-1b3c-4234-948d-482ae3425e70"),
|
||||
size: 'lg',
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
@@ -97,12 +97,13 @@ function toolTab() {
|
||||
force: "${force === 'undefined' ? undefined : force|default:undefined}",
|
||||
}
|
||||
},
|
||||
...formReloadFlinkJobIdTextInputAndAliasTextInput("0fe6a96c-6b6e-4346-b18e-c631c2389f48"),
|
||||
body: [
|
||||
{
|
||||
type: 'group',
|
||||
body: [
|
||||
flinkJobIdTextInput(true),
|
||||
aliasTextInput(true),
|
||||
flinkJobIdTextInput("0fe6a96c-6b6e-4346-b18e-c631c2389f48", true),
|
||||
aliasTextInput("0fe6a96c-6b6e-4346-b18e-c631c2389f48", true),
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
tabs: [
|
||||
// logTab(),
|
||||
// runningTab(),
|
||||
toolTab(),
|
||||
overviewTab(),
|
||||
tableTab(),
|
||||
queueTab(),
|
||||
@@ -72,11 +73,10 @@
|
||||
yarnTab('b1,b5,a4', '压缩 b1 b5 a4', 'datalake,ten_iap.datalake', 'Compaction'),
|
||||
cloudTab(),
|
||||
yarnClusterTab(),
|
||||
toolTab(),
|
||||
]
|
||||
}
|
||||
}
|
||||
let debug = false
|
||||
let debug = true
|
||||
let server = amis.embed(
|
||||
'#root',
|
||||
amisJSON,
|
||||
|
||||
Reference in New Issue
Block a user