From 22e5cc3aa5df0eb75a41802555de6f1a665206f1 Mon Sep 17 00:00:00 2001 From: jialin Date: Wed, 24 Jun 2026 11:25:16 +0800 Subject: [PATCH] fix(usage): display usage tabs base on access permissions --- src/pages/usage/index.tsx | 9 ++++++++- src/utils/access-probes.ts | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pages/usage/index.tsx b/src/pages/usage/index.tsx index 996e288b..d41c2feb 100644 --- a/src/pages/usage/index.tsx +++ b/src/pages/usage/index.tsx @@ -25,7 +25,8 @@ import TokenTab from './token-tab'; const Usage: React.FC = () => { const access = useAccess(); const intl = useIntl(); - // Land on the cross-resource Summary by default. + + const canSeeGpuService = !!access?.canSeeGpuService; const [activeKey, setActiveKey] = useState('summary'); const items: TabsProps['items'] = useMemo(() => { @@ -69,6 +70,12 @@ const Usage: React.FC = () => { }); }, [intl, access.canSeeGpuService]); + // Only the Tokens tab is available — render it on its own without the + // single-item tab bar. + if (!canSeeGpuService) { + return ; + } + return (