feat: 峰谷电价编辑器

This commit is contained in:
2026-03-12 16:06:48 +08:00
parent 2bbb8239a6
commit 2638af3f7f
3 changed files with 525 additions and 2 deletions

View File

@@ -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 (