86 lines
2.6 KiB
TypeScript
86 lines
2.6 KiB
TypeScript
'use client'
|
|
|
|
import { usePathname } from 'next/navigation'
|
|
|
|
const NAV_GROUPS = [
|
|
{
|
|
title: 'Configuration',
|
|
items: [
|
|
{ href: '/admin', label: 'Config overview' },
|
|
{ href: '/admin/general', label: 'Application & proxy' },
|
|
{ href: '/admin/site', label: 'Site & login' },
|
|
{ href: '/admin/notifications', label: 'Notifications' },
|
|
],
|
|
},
|
|
{
|
|
title: 'Media Services',
|
|
items: [
|
|
{ href: '/admin/seerr', label: 'Seerr' },
|
|
{ href: '/admin/jellyfin', label: 'Jellyfin' },
|
|
{ href: '/admin/sonarr', label: 'Sonarr' },
|
|
{ href: '/admin/radarr', label: 'Radarr' },
|
|
{ href: '/admin/bazarr', label: 'Bazarr' },
|
|
{ href: '/admin/prowlarr', label: 'Prowlarr' },
|
|
{ href: '/admin/qbittorrent', label: 'qBittorrent' },
|
|
],
|
|
},
|
|
{
|
|
title: 'Request Pipeline',
|
|
items: [
|
|
{ href: '/admin/requests', label: 'Sync & retention' },
|
|
{ href: '/admin/issue-workflow', label: 'Issue workflow' },
|
|
{ href: '/admin/cache', label: 'Request cache' },
|
|
{ href: '/admin/artwork', label: 'Artwork cache' },
|
|
{ href: '/admin/requests-all', label: 'All requests' },
|
|
],
|
|
},
|
|
{
|
|
title: 'Users & Access',
|
|
items: [
|
|
{ href: '/users', label: 'Users' },
|
|
{ href: '/admin/invites', label: 'Invite management' },
|
|
],
|
|
},
|
|
{
|
|
title: 'System',
|
|
items: [
|
|
{ href: '/admin/diagnostics', label: 'System health' },
|
|
{ href: '/admin/logs', label: 'Activity log' },
|
|
{ href: '/admin/maintenance', label: 'Maintenance' },
|
|
{ href: '/admin/system', label: 'How it works' },
|
|
],
|
|
},
|
|
]
|
|
|
|
export default function AdminSidebar() {
|
|
const pathname = usePathname()
|
|
return (
|
|
<nav className="admin-sidebar">
|
|
<div className="admin-sidebar-identity">
|
|
<strong>Magent Admin</strong>
|
|
<span><i aria-hidden="true" />Configuration workspace</span>
|
|
</div>
|
|
<a className="admin-new-request" href="/new-requests"><span>+</span> New request</a>
|
|
{NAV_GROUPS.map((group) => (
|
|
<div key={group.title} className="admin-nav-group">
|
|
<span className="admin-nav-title">{group.title}</span>
|
|
<div className="admin-nav-links">
|
|
{group.items.map((item) => {
|
|
const isActive =
|
|
pathname === item.href ||
|
|
(item.href !== '/' &&
|
|
item.href !== '/admin' &&
|
|
pathname.startsWith(`${item.href}/`))
|
|
return (
|
|
<a key={item.href} href={item.href} className={isActive ? 'is-active' : ''}>
|
|
{item.label}
|
|
</a>
|
|
)
|
|
})}
|
|
</div>
|
|
</div>
|
|
))}
|
|
</nav>
|
|
)
|
|
}
|