Files
hudi-service/service-web/src/main/resources/static/components/task-tab.js

185 lines
7.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
function taskTab() {
return {
title: `离线检索`,
icon: 'fa fa-magnifying-glass',
tab: [
{
type: 'form',
title: '检索文件',
actions: [
{
type: 'submit',
label: '提交任务',
actionType: 'ajax',
api: {
method: 'get',
url: '${base}/task/scan',
data: {
key: '${key|default:undefined}',
hdfs: '${hdfs|default:undefined}',
pulsar: '${pulsar|default:undefined}',
topic: '${topic|default:undefined}',
mode: '${scan_mode|default:undefined}',
fields: '${fields|default:undefined}',
}
}
},
],
body: [
{
name: 'scan_mode',
type: 'checkboxes',
label: '检索范围',
checkAll: true,
required: true,
value: 'log',
options: [
{label: '消息队列', value: 'queue'},
{label: '日志文件', value: 'log'},
{label: '数据文件', value: 'base'},
]
},
{
type: 'input-text',
name: 'key',
label: '检索字段',
required: true,
clearable: true,
description: '检索带有该字符的记录',
},
{
type: 'input-text',
name: 'hdfs',
label: 'HDFS路经',
requiredOn: '${CONTAINS(scan_mode, \'log\') || CONTAINS(scan_mode, \'base\')}',
visibleOn: '${CONTAINS(scan_mode, \'log\') || CONTAINS(scan_mode, \'base\')}',
clearable: true,
description: '输入表HDFS路径',
autoComplete: '${base}/table/all_hdfs?key=$term',
},
{
type: 'input-text',
name: 'fields',
label: '指定字段',
visibleOn: '${CONTAINS(scan_mode, \'base\')}',
clearable: true,
description: '逗号分隔可以大幅提高parquet文件检索速度但无法获取指定字段外的字段内容',
},
{
type: 'group',
body: [
{
type: 'input-text',
name: 'topic',
label: 'Pulsar主题',
requiredOn: '${CONTAINS(scan_mode, \'queue\')}',
visibleOn: '${CONTAINS(scan_mode, \'queue\')}',
clearable: true,
description: '输入Pulsar主题',
autoComplete: '${base}/table/all_pulsar_topic?key=$term',
columnRatio: 4,
},
{
type: 'input-text',
name: 'pulsar',
label: 'Pulsar地址',
requiredOn: '${CONTAINS(scan_mode, \'queue\')}',
visibleOn: '${CONTAINS(scan_mode, \'queue\')}',
clearable: true,
description: '输入Pulsar地址',
autoComplete: '${base}/table/all_pulsar?key=$term',
},
]
}
]
},
{
type: 'form',
title: '综合查询',
actions: [
{
type: 'action',
label: '总数&最后操作时间',
actionType: 'ajax',
api: {
method: 'get',
url: '${base}/task/table_summary',
data: {
hdfs: '${hdfs|default:undefined}',
}
}
},
{
type: 'action',
label: '最后10条记录',
actionType: 'ajax',
api: {
method: 'get',
url: '${base}/task/table_sampling',
data: {
hdfs: '${hdfs|default:undefined}',
}
}
},
],
body: [
{
type: 'input-text',
name: 'hdfs',
label: 'HDFS路经',
required: true,
clearable: true,
description: '输入表HDFS路径',
autoComplete: '${base}/table/all_hdfs?key=$term',
},
]
},
{
type: 'crud',
api: {
method: 'get',
url: `\${base}/yarn/job_list`,
data: {
clusters: commonInfo.clusters.sync_names(),
page: '${page|default:undefined}',
count: '${perPage|default:undefined}',
order: '${orderBy|default:undefined}',
direction: '${orderDir|default:undefined}',
filter_state: '${state|default:undefined}',
filter_final_status: '${finalStatus|default:undefined}',
search_id: '${id|default:undefined}',
search_name: 'Service_Task',
precise: false,
}
},
affixHeader: false,
interval: 10000,
syncLocation: false,
silentPolling: true,
resizable: false,
perPage: 10,
headerToolbar: [
"reload",
{
label: "任务管理器日志",
type: "action",
tooltip: '打开Grafana日志',
onEvent: {
click: {
actions: [
{
actionType: 'custom',
script: () => window.open(serviceLogByAppName("service-executor-manager"), '_blank'),
}
]
}
}
},
paginationCommonOptions(),
],
footerToolbar: [],
columns: yarnCrudColumns(),
}
]
}
}