feat: 峰谷电价编辑器
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
ListCheck,
|
||||
Person,
|
||||
PlugConnection,
|
||||
TagDollar,
|
||||
Thunderbolt,
|
||||
ThunderboltFill,
|
||||
Xmark,
|
||||
@@ -29,7 +30,10 @@ const navItems = [
|
||||
{ href: "/dashboard/users", label: "用户管理", icon: Person, adminOnly: true },
|
||||
];
|
||||
|
||||
const settingsItems = [{ href: "/dashboard/settings", label: "账号设置", icon: Gear }];
|
||||
const settingsItems = [
|
||||
{ href: "/dashboard/settings/user", label: "账号设置", icon: Gear, adminOnly: false },
|
||||
{ href: "/dashboard/settings/pricing", label: "峰谷电价", icon: TagDollar, adminOnly: true },
|
||||
];
|
||||
|
||||
function NavContent({
|
||||
pathname,
|
||||
@@ -110,7 +114,7 @@ function NavContent({
|
||||
<p className="mb-1 mt-3 px-2 text-[11px] font-semibold uppercase tracking-widest text-muted">
|
||||
设置
|
||||
</p>
|
||||
{settingsItems.map((item) => {
|
||||
{settingsItems.filter((item) => !item.adminOnly || isAdmin).map((item) => {
|
||||
const isActive = pathname === item.href || pathname.startsWith(item.href + "/");
|
||||
const Icon = item.icon;
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user