Improve admin UX: hub i18n, dynamic topbar, settings strings, staff logs DataTable.
Local Build and Deploy / deploy (push) Successful in 1m12s

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
SimoandCursor committed 2026-07-17 20:14:55 +02:00
1 parent 604e63da51
commit 1039044e48
11 files changed
+526 -305

No files matched your search

+101 -99
View File
@@ -19,7 +19,8 @@ import {
export interface AdminHubTab {
href: string;
label: string;
/** Key under pages.admin.hubs.tabs.* */
labelKey: string;
match?: string[];
/** Optional group id for multi-row tab strips (e.g. Radio primary/tools). */
group?: string;
@@ -27,8 +28,9 @@ export interface AdminHubTab {
export interface AdminHubDefinition {
id: string;
title: string;
subtitle: string;
/** Key under pages.admin.hubs.* for title/subtitle */
titleKey: string;
subtitleKey: string;
icon: LucideIcon;
/** Path prefixes belonging to this hub (for chrome + sidebar active). */
prefixes: string[];
@@ -52,8 +54,8 @@ export interface AdminNavGroup {
export const ADMIN_HUBS: AdminHubDefinition[] = [
{
id: "news-media",
title: "News & media",
subtitle: "Articles, photos, banners, ads and media library",
titleKey: "newsMedia",
subtitleKey: "newsMediaSubtitle",
icon: Newspaper,
prefixes: [
"/admin/articles",
@@ -65,19 +67,19 @@ export const ADMIN_HUBS: AdminHubDefinition[] = [
tabs: [
{
href: "/admin/articles",
label: "Articles",
labelKey: "articles",
match: ["/admin/articles"],
},
{ href: "/admin/photos", label: "Photos" },
{ href: "/admin/banners", label: "Banners" },
{ href: "/admin/ads", label: "Ads", match: ["/admin/ads"] },
{ href: "/admin/media", label: "Media" },
{ href: "/admin/photos", labelKey: "photos" },
{ href: "/admin/banners", labelKey: "banners" },
{ href: "/admin/ads", labelKey: "ads", match: ["/admin/ads"] },
{ href: "/admin/media", labelKey: "media" },
],
},
{
id: "site-content",
title: "Site content",
subtitle: "Navigation, help center, boxes, tags and prefixes",
titleKey: "siteContent",
subtitleKey: "siteContentSubtitle",
icon: Compass,
prefixes: [
"/admin/navigation",
@@ -87,39 +89,39 @@ export const ADMIN_HUBS: AdminHubDefinition[] = [
"/admin/prefixes",
],
tabs: [
{ href: "/admin/navigation", label: "Navigator" },
{ href: "/admin/navigation", labelKey: "navigator" },
{
href: "/admin/help-questions",
label: "Help",
labelKey: "help",
match: ["/admin/help-questions"],
},
{ href: "/admin/writeable-boxes", label: "Boxes" },
{ href: "/admin/tags", label: "Tags" },
{ href: "/admin/prefixes", label: "Prefixes" },
{ href: "/admin/writeable-boxes", labelKey: "boxes" },
{ href: "/admin/tags", labelKey: "tags" },
{ href: "/admin/prefixes", labelKey: "prefixes" },
],
},
{
id: "engagement",
title: "Engagement",
subtitle: "Events, polls and support tickets",
titleKey: "engagement",
subtitleKey: "engagementSubtitle",
icon: Calendar,
prefixes: ["/admin/events", "/admin/polls", "/admin/tickets"],
tabs: [
{ href: "/admin/events", label: "Events", match: ["/admin/events"] },
{ href: "/admin/events/types", label: "Event types" },
{ href: "/admin/polls", label: "Polls", match: ["/admin/polls"] },
{ href: "/admin/events", labelKey: "events", match: ["/admin/events"] },
{ href: "/admin/events/types", labelKey: "eventTypes" },
{ href: "/admin/polls", labelKey: "polls", match: ["/admin/polls"] },
{
href: "/admin/tickets",
label: "Tickets",
labelKey: "tickets",
match: ["/admin/tickets"],
},
{ href: "/admin/tickets/templates", label: "Templates" },
{ href: "/admin/tickets/templates", labelKey: "templates" },
],
},
{
id: "users",
title: "Users",
subtitle: "Directory, online players, applications and teams",
titleKey: "users",
subtitleKey: "usersSubtitle",
icon: Users,
prefixes: [
"/admin/users",
@@ -130,19 +132,19 @@ export const ADMIN_HUBS: AdminHubDefinition[] = [
tabs: [
{
href: "/admin/users",
label: "Directory",
labelKey: "directory",
match: ["/admin/users"],
},
{ href: "/admin/users/multi-accounts", label: "Multi-accounts" },
{ href: "/admin/online", label: "Online" },
{ href: "/admin/applications", label: "Applications" },
{ href: "/admin/teams", label: "Teams" },
{ href: "/admin/users/multi-accounts", labelKey: "multiAccounts" },
{ href: "/admin/online", labelKey: "online" },
{ href: "/admin/applications", labelKey: "applications" },
{ href: "/admin/teams", labelKey: "teams" },
],
},
{
id: "access",
title: "Access & security",
subtitle: "Bans, IP, VPN, permissions and word filter",
titleKey: "access",
subtitleKey: "accessSubtitle",
icon: Shield,
prefixes: [
"/admin/bans",
@@ -152,38 +154,38 @@ export const ADMIN_HUBS: AdminHubDefinition[] = [
"/admin/wordfilter",
],
tabs: [
{ href: "/admin/bans", label: "Bans" },
{ href: "/admin/ip", label: "IP" },
{ href: "/admin/vpn", label: "VPN" },
{ href: "/admin/bans", labelKey: "bans" },
{ href: "/admin/ip", labelKey: "ip" },
{ href: "/admin/vpn", labelKey: "vpn" },
{
href: "/admin/permissions",
label: "Permissions",
labelKey: "permissions",
match: ["/admin/permissions"],
},
{ href: "/admin/wordfilter", label: "Word filter" },
{ href: "/admin/wordfilter", labelKey: "wordFilter" },
],
},
{
id: "moderation",
title: "Moderation",
subtitle: "Reports, actions and moderation team",
titleKey: "moderation",
subtitleKey: "moderationSubtitle",
icon: Gavel,
prefixes: ["/admin/moderation"],
tabs: [
{ href: "/admin/moderation", label: "Overview" },
{ href: "/admin/moderation/actions", label: "Actions" },
{ href: "/admin/moderation", labelKey: "overview" },
{ href: "/admin/moderation/actions", labelKey: "actions" },
{
href: "/admin/moderation/cfh",
label: "CFH",
labelKey: "cfh",
match: ["/admin/moderation/cfh"],
},
{ href: "/admin/moderation/team", label: "Team" },
{ href: "/admin/moderation/team", labelKey: "team" },
],
},
{
id: "catalog",
title: "Catalog & rares",
subtitle: "Catalog, rares, badges, achievements and sounds",
titleKey: "catalog",
subtitleKey: "catalogSubtitle",
icon: Store,
prefixes: [
"/admin/catalog",
@@ -193,17 +195,17 @@ export const ADMIN_HUBS: AdminHubDefinition[] = [
"/admin/sounds",
],
tabs: [
{ href: "/admin/catalog", label: "Catalog", match: ["/admin/catalog"] },
{ href: "/admin/rare-values", label: "Rares" },
{ href: "/admin/badges", label: "Badges" },
{ href: "/admin/achievements", label: "Achievements" },
{ href: "/admin/sounds", label: "Sounds" },
{ href: "/admin/catalog", labelKey: "catalogTab", match: ["/admin/catalog"] },
{ href: "/admin/rare-values", labelKey: "rares" },
{ href: "/admin/badges", labelKey: "badges" },
{ href: "/admin/achievements", labelKey: "achievements" },
{ href: "/admin/sounds", labelKey: "sounds" },
],
},
{
id: "shop",
title: "Shop & payments",
subtitle: "Shop, transactions, vouchers, subscriptions and calendar",
titleKey: "shop",
subtitleKey: "shopSubtitle",
icon: ShoppingCart,
prefixes: [
"/admin/shop",
@@ -213,49 +215,49 @@ export const ADMIN_HUBS: AdminHubDefinition[] = [
"/admin/calendar",
],
tabs: [
{ href: "/admin/shop", label: "Shop" },
{ href: "/admin/transactions", label: "Transactions" },
{ href: "/admin/vouchers", label: "Vouchers" },
{ href: "/admin/subscriptions", label: "Subscriptions" },
{ href: "/admin/shop", labelKey: "shopTab" },
{ href: "/admin/transactions", labelKey: "transactions" },
{ href: "/admin/vouchers", labelKey: "vouchers" },
{ href: "/admin/subscriptions", labelKey: "subscriptions" },
{
href: "/admin/calendar",
label: "Calendar",
labelKey: "calendar",
match: ["/admin/calendar"],
},
],
},
{
id: "radio",
title: "Radio",
subtitle: "Stream, DJ tools, embed and monitoring",
titleKey: "radio",
subtitleKey: "radioSubtitle",
icon: Radio,
prefixes: ["/admin/radio"],
tabs: [
{ href: "/admin/radio", label: "Overview", group: "primary" },
{ href: "/admin/radio/history", label: "History", group: "primary" },
{ href: "/admin/radio", labelKey: "overview", group: "primary" },
{ href: "/admin/radio/history", labelKey: "history", group: "primary" },
{
href: "/admin/radio/moderation",
label: "Moderation",
labelKey: "moderationTab",
group: "primary",
},
{
href: "/admin/radio/monitoring",
label: "Monitoring",
labelKey: "monitoring",
group: "primary",
},
{ href: "/admin/radio/settings", label: "Settings", group: "primary" },
{ href: "/admin/radio/banners", label: "Banners", group: "tools" },
{ href: "/admin/radio/embed", label: "Embed", group: "tools" },
{ href: "/admin/radio/api-keys", label: "API keys", group: "tools" },
{ href: "/admin/radio/points", label: "Points", group: "tools" },
{ href: "/admin/radio/ranks", label: "Ranks", group: "tools" },
{ href: "/admin/radio/autodj", label: "Auto DJ", group: "tools" },
{ href: "/admin/radio/settings", labelKey: "settingsTab", group: "primary" },
{ href: "/admin/radio/banners", labelKey: "banners", group: "tools" },
{ href: "/admin/radio/embed", labelKey: "embed", group: "tools" },
{ href: "/admin/radio/api-keys", labelKey: "apiKeys", group: "tools" },
{ href: "/admin/radio/points", labelKey: "points", group: "tools" },
{ href: "/admin/radio/ranks", labelKey: "ranks", group: "tools" },
{ href: "/admin/radio/autodj", labelKey: "autoDj", group: "tools" },
],
},
{
id: "settings",
title: "Settings",
subtitle: "CMS config, theme, maintenance and related tools",
titleKey: "settings",
subtitleKey: "settingsSubtitle",
icon: Cog,
prefixes: [
"/admin/settings",
@@ -267,19 +269,19 @@ export const ADMIN_HUBS: AdminHubDefinition[] = [
"/admin/housekeeping",
],
tabs: [
{ href: "/admin/settings", label: "CMS" },
{ href: "/admin/theme", label: "Theme" },
{ href: "/admin/maintenance", label: "Maintenance" },
{ href: "/admin/favicon", label: "Favicon" },
{ href: "/admin/emulator", label: "Emulator" },
{ href: "/admin/email-templates", label: "Email" },
{ href: "/admin/housekeeping", label: "Housekeeping" },
{ href: "/admin/settings", labelKey: "cms" },
{ href: "/admin/theme", labelKey: "theme" },
{ href: "/admin/maintenance", labelKey: "maintenance" },
{ href: "/admin/favicon", labelKey: "favicon" },
{ href: "/admin/emulator", labelKey: "emulator" },
{ href: "/admin/email-templates", labelKey: "email" },
{ href: "/admin/housekeeping", labelKey: "housekeeping" },
],
},
{
id: "tools",
title: "Tools",
subtitle: "RCON, rooms, import and translations",
titleKey: "tools",
subtitleKey: "toolsSubtitle",
icon: Wrench,
prefixes: [
"/admin/commandocentrum",
@@ -288,20 +290,20 @@ export const ADMIN_HUBS: AdminHubDefinition[] = [
"/admin/translations",
],
tabs: [
{ href: "/admin/commandocentrum", label: "Commando" },
{ href: "/admin/rooms", label: "Rooms", match: ["/admin/rooms"] },
{ href: "/admin/import", label: "Import", match: ["/admin/import"] },
{ href: "/admin/commandocentrum", labelKey: "commando" },
{ href: "/admin/rooms", labelKey: "rooms", match: ["/admin/rooms"] },
{ href: "/admin/import", labelKey: "import", match: ["/admin/import"] },
{
href: "/admin/translations",
label: "Translations",
labelKey: "translations",
match: ["/admin/translations"],
},
],
},
{
id: "observability",
title: "Observability",
subtitle: "Logs, analytics, DevOps and hotel alerts",
titleKey: "observability",
subtitleKey: "observabilitySubtitle",
icon: Monitor,
prefixes: [
"/admin/logs",
@@ -310,21 +312,21 @@ export const ADMIN_HUBS: AdminHubDefinition[] = [
"/admin/alerts",
],
tabs: [
{ href: "/admin/logs", label: "Logs" },
{ href: "/admin/logs/audit", label: "Audit" },
{ href: "/admin/logs/chat", label: "Chat" },
{ href: "/admin/logs/commands", label: "Commands" },
{ href: "/admin/logs/trades", label: "Trades" },
{ href: "/admin/logs", labelKey: "logs" },
{ href: "/admin/logs/audit", labelKey: "audit" },
{ href: "/admin/logs/chat", labelKey: "chat" },
{ href: "/admin/logs/commands", labelKey: "commands" },
{ href: "/admin/logs/trades", labelKey: "trades" },
{
href: "/admin/analytics",
label: "Analytics",
labelKey: "analytics",
match: ["/admin/analytics"],
},
{ href: "/admin/analytics/activity", label: "Activity" },
{ href: "/admin/analytics/economy", label: "Economy" },
{ href: "/admin/devops", label: "DevOps", match: ["/admin/devops"] },
{ href: "/admin/devops/errors", label: "Errors" },
{ href: "/admin/alerts", label: "Alerts" },
{ href: "/admin/analytics/activity", labelKey: "activity" },
{ href: "/admin/analytics/economy", labelKey: "economy" },
{ href: "/admin/devops", labelKey: "devops", match: ["/admin/devops"] },
{ href: "/admin/devops/errors", labelKey: "errors" },
{ href: "/admin/alerts", labelKey: "alerts" },
],
},
];