Files
hudi-service/web/components/table-tab.js

225 lines
11 KiB
JavaScript

function tableTab() {
return {
title: `表任务`,
tab: [
{
id: 'table-service',
type: 'service',
data: {},
body: [
{
type: 'crud',
api: {
method: 'get',
url: `\${base}/table/list`,
data: {
page: '${page|default:undefined}',
count: '${perPage|default:undefined}',
order: '${orderBy|default:undefined}',
direction: '${orderDir|default:undefined}',
search_flink_job_id: '${flinkJobId|default:undefined}',
search_alias: '${alias|default:undefined}',
filter_run_mode: '${flinkJob\\.runMode|default:undefined}',
filter_compaction_status: '${syncState\\.compactionStatus|default:undefined}'
}
},
...crudCommonOptions(),
// interval: 10000,
filter: {
mode: 'inline',
title: '表筛选',
body: [
{
type: 'group',
body: [
{
type: 'input-text',
name: 'flinkJobId',
label: 'Flink job id',
clearable: true,
placeholder: '通过 ID 搜索',
size: 'md'
},
{
type: 'input-text',
name: 'alias',
label: '名称',
clearable: true,
placeholder: '通过别名搜索',
size: 'md'
},
]
},
],
actions: [
{
type: "submit",
level: "primary",
label: "查询",
},
{
type: "reset",
label: "重置",
},
]
},
filterTogglable: true,
filterDefaultVisible: true,
perPage: 20,
headerToolbar: [
"reload",
'filter-toggler',
{
type: 'pagination',
layout: ['pager', 'perPage'],
maxButtons: 5,
showPageInput: false,
},
],
footerToolbar: [
{
type: 'pagination',
layout: ['pager', 'perPage'],
maxButtons: 5,
showPageInput: false,
},
],
columns: [
{
label: 'Flink job id',
width: 170,
fixed: 'left',
type: 'wrapper',
size: 'none',
body: [
{
type: 'action',
level: 'link',
label: '${flinkJobId}',
size: 'xs',
actionType: 'dialog',
tooltip: '查看详情',
dialog: flinkJobDialog(),
},
{
type: 'action',
level: 'link',
label: '',
icon: 'fa fa-copy',
size: 'xs',
actionType: 'copy',
content: '${flinkJobId}',
tooltip: '复制 ID',
}
],
},
{
label: '别名',
type: 'wrapper',
fixed: 'left',
size: 'none',
className: 'nowrap',
body: [
{
type: 'action',
level: 'link',
label: '${tableMeta.alias}',
size: 'xs',
actionType: 'dialog',
tooltip: '查看详情',
dialog: tableMetaDialog(),
},
{
type: 'action',
level: 'link',
label: '',
icon: 'fa fa-copy',
size: 'xs',
actionType: 'copy',
content: '${tableMeta.alias}',
tooltip: '复制别名',
},
],
},
{
name: 'flinkJob.runMode',
label: '表类型',
width: 60,
align: 'center',
...mappingField('flinkJob.runMode', runModeMapping),
filterable: filterableField(runModeMapping, true)
},
{
name: 'syncRunning',
label: '同步运行状态',
align: 'center',
...mappingField('syncRunning', tableRunningStateMapping),
className: 'bg-green-50',
width: 75,
},
{
name: 'source_start_time',
label: '同步启动时间',
...timeAndFrom('syncState.sourceStartTime', 'syncState.sourceStartTimeFromNow', '未启动'),
sortable: true,
className: 'bg-green-50',
},
{
name: 'source_checkpoint_time',
label: '同步心跳时间',
...timeAndFrom('syncState.sourceCheckpointTime', 'syncState.sourceCheckpointTimeFromNow', '未启动'),
sortable: true,
className: 'bg-green-50',
},
{
name: 'source_publish_time',
label: '源端发布时间',
...timeAndFrom('syncState.sourcePublishTime', 'syncState.sourcePublishTimeFromNow', '无增量'),
sortable: true,
className: 'bg-green-50',
},
{
name: 'source_operation_time',
label: '源端业务时间',
...timeAndFrom('syncState.sourceOperationTime', 'syncState.sourceOperationTimeFromNow', '无增量'),
sortable: true,
className: 'bg-green-50',
},
{
name: 'compactionRunning',
label: '压缩运行状态',
align: 'center',
...mappingField('compactionRunning', tableRunningStateMapping),
className: 'bg-cyan-50',
width: 75,
},
{
name: 'syncState.compactionStatus',
label: '压缩状态',
width: 60,
align: 'center',
...mappingField('syncState.compactionStatus', compactionStatusMapping),
filterable: filterableField(compactionStatusMapping, true),
className: 'bg-cyan-50',
},
{
name: 'compaction_start_time',
label: '压缩启动时间',
...timeAndFrom('syncState.compactionStartTime', 'syncState.compactionStartTimeFromNow'),
sortable: true,
className: 'bg-cyan-50',
},
{
name: 'compaction_finish_time',
label: '压缩完成时间',
...timeAndFrom('syncState.compactionFinishTime', 'syncState.compactionFinishTimeFromNow'),
sortable: true,
className: 'bg-cyan-50',
},
]
}
]
}
],
}
}