Skip to content

Commit ba2b482

Browse files
authored
[Improvement-17926] Supports creating worker groups without workers (#17927)
1 parent 12f8ea0 commit ba2b482

3 files changed

Lines changed: 18 additions & 21 deletions

File tree

dolphinscheduler-ui/src/views/security/worker-group-manage/components/use-modal.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ export function useModal(
4747
return new Error(t('security.worker_group.group_name_tips'))
4848
}
4949
}
50-
},
51-
addrList: {
52-
required: true,
53-
trigger: ['input', 'blur'],
54-
validator() {
55-
if (variables.model.addrList.length < 1) {
56-
return new Error(t('security.worker_group.worker_addresses_tips'))
57-
}
58-
}
5950
}
6051
}
6152
})

dolphinscheduler-ui/src/views/security/worker-group-manage/components/worker-group-modal.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ const WorkerGroupModal = defineComponent({
7878
} else {
7979
variables.model.id = props.row.id
8080
variables.model.name = props.row.name
81-
variables.model.addrList = props.row.addrList.split(',')
81+
variables.model.addrList = props.row.addrList
82+
? props.row.addrList.split(',')
83+
: []
8284
}
8385
}
8486
)
@@ -88,7 +90,9 @@ const WorkerGroupModal = defineComponent({
8890
() => {
8991
variables.model.id = props.row.id
9092
variables.model.name = props.row.name
91-
variables.model.addrList = props.row.addrList.split(',')
93+
variables.model.addrList = props.row.addrList
94+
? props.row.addrList.split(',')
95+
: []
9296
}
9397
)
9498

@@ -107,7 +111,7 @@ const WorkerGroupModal = defineComponent({
107111
show={this.showModalRef}
108112
onCancel={this.cancelModal}
109113
onConfirm={this.confirmModal}
110-
confirmDisabled={!this.model.name || this.model.addrList.length < 1}
114+
confirmDisabled={!this.model.name}
111115
confirmClassName='btn-submit'
112116
cancelClassName='btn-cancel'
113117
confirmLoading={this.saving}

dolphinscheduler-ui/src/views/security/worker-group-manage/use-table.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,18 @@ export function useTable() {
5555
key: 'addrList',
5656
render: (row: WorkerGroupItem) =>
5757
h(NSpace, null, {
58-
default: () =>
59-
row.addrList
60-
.split(',')
61-
.map((item: string) =>
62-
h(
63-
NTag,
64-
{ type: 'success', size: 'small' },
65-
{ default: () => item }
58+
default: () => {
59+
const addrList = row.addrList ? row.addrList.split(',') : []
60+
return addrList.length
61+
? addrList.map((item: string) =>
62+
h(
63+
NTag,
64+
{ type: 'success', size: 'small' },
65+
{ default: () => item }
66+
)
6667
)
67-
)
68+
: h('span', { style: { color: '#999' } }, '-')
69+
}
6870
})
6971
},
7072
{

0 commit comments

Comments
 (0)