mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-12 11:23:42 +08:00
feat: add new theme berry (#860)
* feat: add theme berry * docs: add development notes * fix: fix blank page * chore: update implementation * fix: fix package.json * chore: update ui copy --------- Co-authored-by: JustSong <songquanpeng@foxmail.com>
This commit is contained in:
18
web/berry/src/menu-items/index.js
Normal file
18
web/berry/src/menu-items/index.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import panel from './panel';
|
||||
|
||||
// ==============================|| MENU ITEMS ||============================== //
|
||||
|
||||
const menuItems = {
|
||||
items: [panel],
|
||||
urlMap: {}
|
||||
};
|
||||
|
||||
// Initialize urlMap
|
||||
menuItems.urlMap = menuItems.items.reduce((map, item) => {
|
||||
item.children.forEach((child) => {
|
||||
map[child.url] = child;
|
||||
});
|
||||
return map;
|
||||
}, {});
|
||||
|
||||
export default menuItems;
|
||||
104
web/berry/src/menu-items/panel.js
Normal file
104
web/berry/src/menu-items/panel.js
Normal file
@@ -0,0 +1,104 @@
|
||||
// assets
|
||||
import {
|
||||
IconDashboard,
|
||||
IconSitemap,
|
||||
IconArticle,
|
||||
IconCoin,
|
||||
IconAdjustments,
|
||||
IconKey,
|
||||
IconGardenCart,
|
||||
IconUser,
|
||||
IconUserScan
|
||||
} from '@tabler/icons-react';
|
||||
|
||||
// constant
|
||||
const icons = { IconDashboard, IconSitemap, IconArticle, IconCoin, IconAdjustments, IconKey, IconGardenCart, IconUser, IconUserScan };
|
||||
|
||||
// ==============================|| DASHBOARD MENU ITEMS ||============================== //
|
||||
|
||||
const panel = {
|
||||
id: 'panel',
|
||||
type: 'group',
|
||||
children: [
|
||||
{
|
||||
id: 'dashboard',
|
||||
title: '总览',
|
||||
type: 'item',
|
||||
url: '/panel/dashboard',
|
||||
icon: icons.IconDashboard,
|
||||
breadcrumbs: false,
|
||||
isAdmin: false
|
||||
},
|
||||
{
|
||||
id: 'channel',
|
||||
title: '渠道',
|
||||
type: 'item',
|
||||
url: '/panel/channel',
|
||||
icon: icons.IconSitemap,
|
||||
breadcrumbs: false,
|
||||
isAdmin: true
|
||||
},
|
||||
{
|
||||
id: 'token',
|
||||
title: '令牌',
|
||||
type: 'item',
|
||||
url: '/panel/token',
|
||||
icon: icons.IconKey,
|
||||
breadcrumbs: false
|
||||
},
|
||||
{
|
||||
id: 'log',
|
||||
title: '日志',
|
||||
type: 'item',
|
||||
url: '/panel/log',
|
||||
icon: icons.IconArticle,
|
||||
breadcrumbs: false
|
||||
},
|
||||
{
|
||||
id: 'redemption',
|
||||
title: '兑换',
|
||||
type: 'item',
|
||||
url: '/panel/redemption',
|
||||
icon: icons.IconCoin,
|
||||
breadcrumbs: false,
|
||||
isAdmin: true
|
||||
},
|
||||
{
|
||||
id: 'topup',
|
||||
title: '充值',
|
||||
type: 'item',
|
||||
url: '/panel/topup',
|
||||
icon: icons.IconGardenCart,
|
||||
breadcrumbs: false
|
||||
},
|
||||
{
|
||||
id: 'user',
|
||||
title: '用户',
|
||||
type: 'item',
|
||||
url: '/panel/user',
|
||||
icon: icons.IconUser,
|
||||
breadcrumbs: false,
|
||||
isAdmin: true
|
||||
},
|
||||
{
|
||||
id: 'profile',
|
||||
title: '我的',
|
||||
type: 'item',
|
||||
url: '/panel/profile',
|
||||
icon: icons.IconUserScan,
|
||||
breadcrumbs: false,
|
||||
isAdmin: true
|
||||
},
|
||||
{
|
||||
id: 'setting',
|
||||
title: '设置',
|
||||
type: 'item',
|
||||
url: '/panel/setting',
|
||||
icon: icons.IconAdjustments,
|
||||
breadcrumbs: false,
|
||||
isAdmin: true
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export default panel;
|
||||
Reference in New Issue
Block a user