From 60c9698cddef31a786105dfa8a6cde1726103e58 Mon Sep 17 00:00:00 2001 From: lcx <1793599591@qq.com> Date: Wed, 7 Jan 2026 17:39:50 +0800 Subject: [PATCH] fix: prevent "Deny All" resource group from being set as default --- frontend/src/components/resource-group/AddServerModal.tsx | 2 +- .../src/components/resource-group/GroupServiceTable.tsx | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/resource-group/AddServerModal.tsx b/frontend/src/components/resource-group/AddServerModal.tsx index 92874b7..8042907 100644 --- a/frontend/src/components/resource-group/AddServerModal.tsx +++ b/frontend/src/components/resource-group/AddServerModal.tsx @@ -52,7 +52,7 @@ export const AddServerModal: React.FC = ({ { - id !== 'allow-all' && <> + !['allow-all', 'deny-all'].includes(id) && <> = ({ return !['allow-all', 'deny-all'].includes(resourceGroupDetail.id); }, [resourceGroupDetail]); - // 是否展示编辑按钮 - const showEditOptions = useMemo(() => { - if (!resourceGroupDetail) return false; - return !['deny-all'].includes(resourceGroupDetail.id); - }, [resourceGroupDetail]); - const getResourceGroup = async (groupId: string) => { const response = await fetchResourceGroupDetail(groupId); if (response) { @@ -112,7 +106,7 @@ const GroupServiceTable: React.FC = ({ {resourceGroupDetail?.name}
- {showEditOptions && currentGroupId && <> + {currentGroupId && <>