chore: remove old code

This commit is contained in:
jialin
2026-07-02 13:18:04 +08:00
committed by jialin
parent bd58a911d5
commit f4ebd8d7d1
2 changed files with 0 additions and 101 deletions
-24
View File
@@ -1,24 +0,0 @@
import { PageContainer } from '@ant-design/pro-components';
import { Access, useAccess } from '@umijs/max';
import { Button } from 'antd';
const AccessPage: React.FC = () => {
const access = useAccess();
return (
<PageContainer
ghost
header={{
title: 'permission example',
style: {
paddingInline: 'var(--layout-content-header-inlinepadding)'
}
}}
>
<Access accessible={access.canSeeAdmin}>
<Button>Only Admin can see this button</Button>
</Access>
</PageContainer>
);
};
export default AccessPage;
-77
View File
@@ -1,77 +0,0 @@
import useTabActive from '@/hooks/use-tab-active';
import { PageContainer } from '@ant-design/pro-components';
import { useIntl } from '@umijs/max';
import type { TabsProps } from 'antd';
import { useCallback, useState } from 'react';
import styled from 'styled-components';
import GPUs from './components/gpus';
import ModelFiles from './components/model-files';
import Workers from './components/workers';
const Wrapper = styled.div`
.ant-page-header-heading {
padding-inline: 8px;
}
.ant-tabs-nav .ant-tabs-tab-active,
.ant-tabs-tab {
background: transparent;
}
`;
const Resources = () => {
const { setTabActive, getTabActive, tabsMap } = useTabActive();
const [activeKey, setActiveKey] = useState(
getTabActive(tabsMap.resources) || 'workers'
);
const intl = useIntl();
const items: TabsProps['items'] = [
{
key: 'workers',
label: 'resources.nodes',
children: <Workers />
},
{
key: 'gpus',
label: 'GPUs',
children: <GPUs />
},
{
key: 'model-files',
label: intl.formatMessage({ id: 'resources.modelfiles.modelfile' }),
children: <ModelFiles />
}
];
const handleChangeTab = useCallback((key: string) => {
setActiveKey(key);
setTabActive(tabsMap.resources, key);
}, []);
return (
<Wrapper>
<PageContainer
ghost
header={{
title: intl.formatMessage({ id: 'resources.title' }),
style: {
paddingInline: 'var(--layout-content-inlinepadding)'
}
}}
tabList={items}
onTabChange={handleChangeTab}
tabActiveKey={activeKey}
tabProps={{
type: 'card',
style: {
marginTop: 78
}
}}
extra={[]}
></PageContainer>
</Wrapper>
);
};
export default Resources;