Skip to content

Commit 078c973

Browse files
committed
style(FR-2481): replace storage node permission badge with lock icons (#6441)
Resolves #6424(FR-2481) ## Summary - Replace `BAIBadge` with Lucide lock icons (`LockIcon`/`LockOpenIcon`) in the admin Project page's Storage Nodes column - All permissions allowed: `lock-open` icon in **success** (green) color - Some permissions allowed: `lock-open` icon in **warning** (orange) color - All permissions blocked: `lock` icon in **error** (red) color ## Verification ``` === ALL PASS === ``` ## Screenshots | Before | After | |--------|-------| | ![before](https://raw.githubusercontent.com/lablup/backend.ai-webui/assets/images/screenshots/pr-6441/20260406-234624-before-storage-nodes.png) | ![after](https://raw.githubusercontent.com/lablup/backend.ai-webui/assets/images/screenshots/pr-6441/20260406-234627-after-storage-nodes.png) | ## Test plan - [ ] Navigate to Admin Settings > Projects - [ ] Scroll right to the "Storage Nodes" column - [ ] Verify lock-open icons appear in green for storage nodes with all permissions - [ ] Verify lock-open icons appear in orange for storage nodes with partial permissions - [ ] Verify lock icons appear in red for storage nodes with no permissions - [ ] Click on a storage node to verify the permission detail modal still works
1 parent 595383b commit 078c973

1 file changed

Lines changed: 37 additions & 12 deletions

File tree

packages/backend.ai-ui/src/components/fragments/BAIAllowedVfolderHostsWithPermission.tsx

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { BAIAllowedVfolderHostsWithPermissionFromGroupFragment$key } from '../..
22
import { BAIAllowedVfolderHostsWithPermissionFromKeyPairResourcePolicyFragment$key } from '../../__generated__/BAIAllowedVfolderHostsWithPermissionFromKeyPairResourcePolicyFragment.graphql';
33
import { BAIAllowedVfolderHostsWithPermissionQuery } from '../../__generated__/BAIAllowedVfolderHostsWithPermissionQuery.graphql';
44
import { SemanticColor } from '../../helper';
5-
import BAIBadge from '../BAIBadge';
65
import BAIFlex from '../BAIFlex';
76
import BAILink from '../BAILink';
87
import BAIModal from '../BAIModal';
98
import { BAITable } from '../Table';
109
import { CheckCircleFilled, StopFilled } from '@ant-design/icons';
1110
import { theme } from 'antd';
1211
import _ from 'lodash';
12+
import { LockIcon, LockOpenIcon } from 'lucide-react';
1313
import React from 'react';
1414
import { useTranslation } from 'react-i18next';
1515
import { graphql, useFragment, useLazyLoadQuery } from 'react-relay';
@@ -90,17 +90,42 @@ const BAIAllowedVfolderHostsWithPermission: React.FC<
9090
return (
9191
<>
9292
<BAIFlex gap="xs" wrap="wrap">
93-
{_.map(_.keys(allowedVfolderHosts), (storageHost) => (
94-
<BAILink
95-
key={storageHost}
96-
onClick={() => {
97-
setStorageHost(storageHost);
98-
}}
99-
type="hover"
100-
>
101-
<BAIBadge color={getColor(storageHost)} text={storageHost} />
102-
</BAILink>
103-
))}
93+
{_.map(_.keys(allowedVfolderHosts), (storageHost) => {
94+
const color = getColor(storageHost);
95+
return (
96+
<BAILink
97+
key={storageHost}
98+
onClick={() => {
99+
setStorageHost(storageHost);
100+
}}
101+
type="hover"
102+
>
103+
<BAIFlex gap="xxs" align="center">
104+
{color === 'error' ? (
105+
<LockIcon
106+
size={14}
107+
aria-hidden="true"
108+
focusable={false}
109+
style={{ color: token.colorError }}
110+
/>
111+
) : (
112+
<LockOpenIcon
113+
size={14}
114+
aria-hidden="true"
115+
focusable={false}
116+
style={{
117+
color:
118+
color === 'success'
119+
? token.colorSuccess
120+
: token.colorWarning,
121+
}}
122+
/>
123+
)}
124+
{storageHost}
125+
</BAIFlex>
126+
</BAILink>
127+
);
128+
})}
104129
</BAIFlex>
105130
<BAIModal
106131
centered

0 commit comments

Comments
 (0)