Skip to content

Commit 6a5790b

Browse files
committed
Supports creating worker groups without workers
1 parent 4b0427d commit 6a5790b

4 files changed

Lines changed: 16 additions & 23 deletions

File tree

dolphinscheduler-ui/src/views/projects/components/dependencies/dependencies-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default defineComponent({
5959
}
6060

6161
const cancelToHandle = () => {
62-
ctx.emit('update:show', showRef)
62+
ctx.emit('update:show', showRef.value)
6363
}
6464

6565
const renderDownstreamDependencies = () => {

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

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ export function useModal(
3232
const variables = reactive({
3333
workerGroupFormRef: ref(),
3434
model: {
35-
id: ref<number>(-1),
35+
id: -1,
3636
name: ref(''),
37-
addrList: ref<Array<number>>([]),
37+
addrList: [] as string[],
3838
generalOptions: []
3939
},
4040
saving: false,
@@ -43,19 +43,10 @@ export function useModal(
4343
required: true,
4444
trigger: ['input', 'blur'],
4545
validator() {
46-
if (variables.model.name === '') {
46+
if (!variables.model.name || !variables.model.name.trim()) {
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const WorkerGroupModal = defineComponent({
107107
show={this.showModalRef}
108108
onCancel={this.cancelModal}
109109
onConfirm={this.confirmModal}
110-
confirmDisabled={!this.model.name || this.model.addrList.length < 1}
110+
confirmDisabled={!this.model.name?.trim()}
111111
confirmClassName='btn-submit'
112112
cancelClassName='btn-cancel'
113113
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' } }, null)
69+
}
6870
})
6971
},
7072
{

0 commit comments

Comments
 (0)