From 10a14985cce57e18378a72e0a891dd264f7c7360 Mon Sep 17 00:00:00 2001 From: Wenjun Ruan Date: Sun, 1 Feb 2026 12:49:04 +0800 Subject: [PATCH] Supports creating worker groups without workers --- .../components/use-modal.ts | 9 --------- .../components/worker-group-modal.tsx | 10 +++++++--- .../security/worker-group-manage/use-table.ts | 20 ++++++++++--------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/dolphinscheduler-ui/src/views/security/worker-group-manage/components/use-modal.ts b/dolphinscheduler-ui/src/views/security/worker-group-manage/components/use-modal.ts index 379571f81843..893aa430f553 100644 --- a/dolphinscheduler-ui/src/views/security/worker-group-manage/components/use-modal.ts +++ b/dolphinscheduler-ui/src/views/security/worker-group-manage/components/use-modal.ts @@ -47,15 +47,6 @@ export function useModal( return new Error(t('security.worker_group.group_name_tips')) } } - }, - addrList: { - required: true, - trigger: ['input', 'blur'], - validator() { - if (variables.model.addrList.length < 1) { - return new Error(t('security.worker_group.worker_addresses_tips')) - } - } } } }) diff --git a/dolphinscheduler-ui/src/views/security/worker-group-manage/components/worker-group-modal.tsx b/dolphinscheduler-ui/src/views/security/worker-group-manage/components/worker-group-modal.tsx index b51e841c8d39..aecde8f157f6 100644 --- a/dolphinscheduler-ui/src/views/security/worker-group-manage/components/worker-group-modal.tsx +++ b/dolphinscheduler-ui/src/views/security/worker-group-manage/components/worker-group-modal.tsx @@ -78,7 +78,9 @@ const WorkerGroupModal = defineComponent({ } else { variables.model.id = props.row.id variables.model.name = props.row.name - variables.model.addrList = props.row.addrList.split(',') + variables.model.addrList = props.row.addrList + ? props.row.addrList.split(',') + : [] } } ) @@ -88,7 +90,9 @@ const WorkerGroupModal = defineComponent({ () => { variables.model.id = props.row.id variables.model.name = props.row.name - variables.model.addrList = props.row.addrList.split(',') + variables.model.addrList = props.row.addrList + ? props.row.addrList.split(',') + : [] } ) @@ -107,7 +111,7 @@ const WorkerGroupModal = defineComponent({ show={this.showModalRef} onCancel={this.cancelModal} onConfirm={this.confirmModal} - confirmDisabled={!this.model.name || this.model.addrList.length < 1} + confirmDisabled={!this.model.name} confirmClassName='btn-submit' cancelClassName='btn-cancel' confirmLoading={this.saving} diff --git a/dolphinscheduler-ui/src/views/security/worker-group-manage/use-table.ts b/dolphinscheduler-ui/src/views/security/worker-group-manage/use-table.ts index 3213d76fc2be..d4cafadbc650 100644 --- a/dolphinscheduler-ui/src/views/security/worker-group-manage/use-table.ts +++ b/dolphinscheduler-ui/src/views/security/worker-group-manage/use-table.ts @@ -55,16 +55,18 @@ export function useTable() { key: 'addrList', render: (row: WorkerGroupItem) => h(NSpace, null, { - default: () => - row.addrList - .split(',') - .map((item: string) => - h( - NTag, - { type: 'success', size: 'small' }, - { default: () => item } + default: () => { + const addrList = row.addrList ? row.addrList.split(',') : [] + return addrList.length + ? addrList.map((item: string) => + h( + NTag, + { type: 'success', size: 'small' }, + { default: () => item } + ) ) - ) + : h('span', { style: { color: '#999' } }, '-') + } }) }, {