Skip to content

Commit

Permalink
✨ (admin) 将site选择移动到侧边栏
Browse files Browse the repository at this point in the history
  • Loading branch information
suyiiyii committed Oct 9, 2024
1 parent 19345cf commit 24251c2
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions admin-frontend/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from 'react-router-dom';
import { useAppSelector } from '../app/hooks';
import { selectIsLogin } from '../features/auth/authSlice';
import { selectSiteConf } from '../features/globalConf/globalConfSlice';

export default function Home() {
const location = useLocation();
Expand Down Expand Up @@ -103,6 +104,10 @@ export default function Home() {
</Breadcrumb>
);
}
const MenuItem = Menu.Item;
const { SubMenu } = Menu;
const siteConf = useAppSelector(selectSiteConf);

return (
<Layout className="layout-collapse-demo">
<Layout.Header>
Expand All @@ -125,10 +130,21 @@ export default function Home() {
<IconRobot />
订阅管理
</Menu.Item>
<Menu.Item key="cookie">
<IconIdcard />
Cookie 管理
</Menu.Item>
<SubMenu
key="cookie"
title={(
<>
<IconIdcard />
Cookie 管理
</>
)}
>
{Object.values(siteConf).filter((site) => site.enable_cookie).map((site) => (
<MenuItem key={site.name}>
{site.name}
</MenuItem>
))}
</SubMenu>
<Menu.Item key="weight">
<IconDashboard />
调度权重
Expand Down

0 comments on commit 24251c2

Please sign in to comment.