Reapply "Add missing admin action files and navigation links"

This reverts commit 4d515bc400.
This commit is contained in:
Simo committed 2026-07-11 20:52:56 +02:00
1 parent 96ed768f14
commit 5b4228261a
338 files changed
+28143 -5948

No files matched your search

+73 -13
View File
@@ -7,12 +7,48 @@ import { requireStaff } from "@/lib/admin/guard";
import { prisma } from "@/lib/prisma";
import { siteSettings } from "@/lib/services/site-settings";
import {
LayoutDashboard, Newspaper, Tags, Compass, HelpCircle, Megaphone, SquarePen, Image,
Users, Ban, Globe, Shield, ClipboardList, Group, Key,
Store, ShoppingCart, Receipt, Ticket, CreditCard, Gem, Award, Trophy, Calendar,
Radio, History,
Terminal, Monitor, Bell, FileText, Filter, Wrench, Settings, DoorOpen, Mail, Palette, Cog,
LayoutDashboard,
Newspaper,
Tags,
Compass,
HelpCircle,
Megaphone,
SquarePen,
Image,
Users,
Ban,
Globe,
Shield,
ClipboardList,
Group,
Key,
Store,
ShoppingCart,
Receipt,
Ticket,
CreditCard,
Gem,
Award,
Trophy,
Calendar,
Radio,
History,
Terminal,
Monitor,
Bell,
FileText,
Filter,
Wrench,
Settings,
DoorOpen,
Mail,
Palette,
Cog,
LogOut,
Music,
Languages,
Upload,
MessageSquare,
} from "lucide-react";
export const dynamic = "force-dynamic";
@@ -20,11 +56,13 @@ export const dynamic = "force-dynamic";
function getNavGroups(t: (key: string) => string) {
return [
{
label: t("overview"), icon: <LayoutDashboard size={14} />,
label: t("overview"),
icon: <LayoutDashboard size={14} />,
items: [{ href: "/admin", label: t("dashboard"), icon: <LayoutDashboard size={16} /> }],
},
{
label: t("content"), icon: <Newspaper size={14} />,
label: t("content"),
icon: <Newspaper size={14} />,
items: [
{ href: "/admin/articles", label: t("articles"), icon: <Newspaper size={16} /> },
{ href: "/admin/tags", label: t("tags"), icon: <Tags size={16} /> },
@@ -33,10 +71,12 @@ function getNavGroups(t: (key: string) => string) {
{ href: "/admin/ads", label: t("advertisements"), icon: <Megaphone size={16} /> },
{ href: "/admin/writeable-boxes", label: t("writeableBoxes"), icon: <SquarePen size={16} /> },
{ href: "/admin/photos", label: t("photos"), icon: <Image size={16} /> },
{ href: "/admin/tickets", label: t("tickets"), icon: <MessageSquare size={16} /> },
],
},
{
label: t("usersAccess"), icon: <Shield size={14} />,
label: t("usersAccess"),
icon: <Shield size={14} />,
items: [
{ href: "/admin/users", label: t("users"), icon: <Users size={16} /> },
{ href: "/admin/bans", label: t("bans"), icon: <Ban size={16} /> },
@@ -48,7 +88,8 @@ function getNavGroups(t: (key: string) => string) {
],
},
{
label: t("economy"), icon: <ShoppingCart size={14} />,
label: t("economy"),
icon: <ShoppingCart size={14} />,
items: [
{ href: "/admin/catalog", label: t("catalog"), icon: <Store size={16} /> },
{ href: "/admin/shop", label: t("shop"), icon: <ShoppingCart size={16} /> },
@@ -62,14 +103,25 @@ function getNavGroups(t: (key: string) => string) {
],
},
{
label: t("radio"), icon: <Radio size={14} />,
label: t("radio"),
icon: <Radio size={14} />,
items: [
{ href: "/admin/radio", label: t("radio"), icon: <Radio size={16} /> },
{ href: "/admin/radio/history", label: t("radioHistory"), icon: <History size={16} /> },
{ href: "/admin/radio/banners", label: t("radioBanners"), icon: <Image size={16} /> },
{ href: "/admin/radio/embed", label: t("radioEmbed"), icon: <Radio size={16} /> },
{ href: "/admin/radio/api-keys", label: t("radioApiKeys"), icon: <Key size={16} /> },
{ href: "/admin/radio/moderation", label: t("radioModeration"), icon: <Shield size={16} /> },
{ href: "/admin/radio/settings", label: t("radioSettings"), icon: <Settings size={16} /> },
{ href: "/admin/radio/monitoring", label: t("radioMonitoring"), icon: <Monitor size={16} /> },
{ href: "/admin/radio/points", label: t("radioPoints"), icon: <Gem size={16} /> },
{ href: "/admin/radio/ranks", label: t("radioRanks"), icon: <Group size={16} /> },
{ href: "/admin/radio/autodj", label: t("radioAutodj"), icon: <Radio size={16} /> },
],
},
{
label: t("system"), icon: <Settings size={14} />,
label: t("system"),
icon: <Settings size={14} />,
items: [
{ href: "/admin/commandocentrum", label: t("commandocentrum"), icon: <Terminal size={16} /> },
{ href: "/admin/emulator", label: t("emulator"), icon: <Monitor size={16} /> },
@@ -83,6 +135,9 @@ function getNavGroups(t: (key: string) => string) {
{ href: "/admin/theme", label: t("theme"), icon: <Palette size={16} /> },
{ href: "/admin/media", label: t("media"), icon: <Image size={16} /> },
{ href: "/admin/favicon", label: t("favicon"), icon: <Image size={16} /> },
{ href: "/admin/sounds", label: t("sounds"), icon: <Music size={16} /> },
{ href: "/admin/translations", label: t("translations"), icon: <Languages size={16} /> },
{ href: "/admin/import", label: t("import"), icon: <Upload size={16} /> },
{ href: "/admin/settings", label: t("settings"), icon: <Cog size={16} /> },
],
},
@@ -117,12 +172,17 @@ async function Sidebar({ staff }: { staff: { id: number; username: string; rank:
return (
<aside className="sticky top-0 self-start h-screen bg-gradient-to-b from-[#1e1b2e] to-[#151226] text-[#c8cbe0] shadow-xl flex flex-col">
<div className="flex items-center gap-3 px-4 py-5 border-b border-white/[0.06]">
<span className="flex-none w-10 h-10 rounded-xl grid place-items-center font-extrabold text-base text-[#1a1a2e] bg-gradient-to-br from-[var(--color-primary)] to-[var(--color-primary-hover)] shadow-lg shadow-[var(--color-primary)]/20" aria-hidden>
<span
className="flex-none w-10 h-10 rounded-xl grid place-items-center font-extrabold text-base text-[#1a1a2e] bg-gradient-to-br from-[var(--color-primary)] to-[var(--color-primary-hover)] shadow-lg shadow-[var(--color-primary)]/20"
aria-hidden
>
{initial}
</span>
<div className="min-w-0 flex-1">
<div className="font-semibold text-sm text-white truncate">{staff.username}</div>
<span className="inline-block mt-0.5 text-[0.6rem] font-bold uppercase tracking-widest text-[rgba(200,203,224,0.5)]">{t("rankLabel", { rank: staff.rank })}</span>
<span className="inline-block mt-0.5 text-[0.6rem] font-bold uppercase tracking-widest text-[rgba(200,203,224,0.5)]">
{t("rankLabel", { rank: staff.rank })}
</span>
</div>
</div>