feat(admin): rebuild admin panel with full management features
- AdminLayout: sidebar navigation (5 pages) - Dashboard: real-time service/plugin/uptime stats - Services: status display for all 4 services - IoT Management: 8 devices with toggle controls - Plugins: 11 plugins grid with type badges - Memory: full CRUD with search, add, delete - 60 modules, TS zero errors, 256KB JS
This commit is contained in:
1 parent
bea29d3b73
commit
8bfda096f7
7 files changed
+372
-25
No files matched your search
@@ -0,0 +1,45 @@
|
||||
import { Outlet, NavLink } from 'react-router-dom'
|
||||
|
||||
const navItems = [
|
||||
{ to: '/admin/dashboard', label: '仪表盘', icon: '◉' },
|
||||
{ to: '/admin/services', label: '服务管理', icon: '⚙' },
|
||||
{ to: '/admin/iot', label: 'IoT 设备', icon: '⌂' },
|
||||
{ to: '/admin/plugins', label: '插件管理', icon: '◇' },
|
||||
{ to: '/admin/memory', label: '记忆管理', icon: '♡' },
|
||||
]
|
||||
|
||||
export default function AdminLayout() {
|
||||
return (
|
||||
<div className="flex h-full">
|
||||
{/* Sidebar */}
|
||||
<nav className="w-52 bg-[#000] border-r border-[#393939] shrink-0 flex flex-col">
|
||||
<div className="p-4 border-b border-[#393939]">
|
||||
<h2 className="text-sm font-semibold text-white/80">管理面板</h2>
|
||||
</div>
|
||||
<div className="flex-1 p-2 space-y-0.5">
|
||||
{navItems.map(item => (
|
||||
<NavLink
|
||||
key={item.to}
|
||||
to={item.to}
|
||||
className={({ isActive }) =>
|
||||
`flex items-center gap-3 px-3 py-2.5 rounded-[14px] text-sm transition-colors ${
|
||||
isActive
|
||||
? 'bg-[#277AF7]/15 text-[#4788FF] font-medium'
|
||||
: 'text-white/50 hover:text-white/80 hover:bg-white/5'
|
||||
}`
|
||||
}
|
||||
>
|
||||
<span className="text-base">{item.icon}</span>
|
||||
<span>{item.label}</span>
|
||||
</NavLink>
|
||||
))}
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{/* Content area */}
|
||||
<div className="flex-1 overflow-auto bg-[#242424]">
|
||||
<Outlet />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user