Files
crosscode-platform/apps/website/frontend/src/admin/nav.ts
T
joshuaandClaude Opus 5.5 a3ac3da5a5 Website 1.4.0: nightly database backups and background jobs
As Accounts and Cross Events: a gzipped pg_dump every night (02:20) into
backend/backups/, the same website-*.sql.gz files crosscode makes before
updates, with Admin -> Backups (back up now, download, how many to keep).
The heartbeat, event feed and YouTube move from plain timers onto pg-boss
with the backup, and Admin -> Background jobs switches each on or off,
changes its schedule or runs it now. The heartbeat now reports the newest
backup (before: always none, so the Hub warned) and the real job state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 09:47:30 +02:00

59 lines
3.4 KiB
TypeScript

/** The admin's sections, in groups (the sidebar) with a line each (the dashboard's tiles). */
import {
Building2, CalendarDays, DatabaseBackup, FileText, HandHeart, Image as ImageIcon, LayoutDashboard, Link2, Mic, Palette, ScrollText,
Send, Settings, Timer, UserCog, Users, type LucideIcon,
} from "lucide-react";
export type NavItem = { href: string; label: string; description: string; icon: LucideIcon; managers?: boolean };
export const NAV_GROUPS: { title: string | null; items: NavItem[] }[] = [
{ title: null, items: [{ href: "/admin", label: "Dashboard", description: "Where your site stands, and what to do next", icon: LayoutDashboard }] },
{
title: "Your site",
items: [
{ href: "/admin/template", label: "Template and style", description: "The look: template, home page layout, colours of sections", icon: Palette },
{ href: "/admin/pages", label: "Pages", description: "Your home page, the fixed pages and your own", icon: FileText },
{ href: "/admin/church", label: "Church details", description: "Name, logo, service times and address, for all your sites", icon: Building2 },
],
},
{
title: "Content",
items: [
{ href: "/admin/ministries", label: "Ministries", description: "What happens in your church, each on the Ministries page", icon: HandHeart },
{ href: "/admin/leaders", label: "Leadership", description: "Your pastors and team, with photos", icon: Users },
{ href: "/admin/messages", label: "Messages", description: "Sermons, from YouTube or Spotify", icon: Mic },
{ href: "/admin/events", label: "Events", description: "What's coming up, or your Cross Events calendar", icon: CalendarDays },
{ href: "/admin/media", label: "Media library", description: "Your photos, what each shows, and storage", icon: ImageIcon },
],
},
{
title: "Go live",
items: [
{ href: "/admin/publish", label: "Publish and history", description: "What's changed, publish it, share a preview, go back", icon: Send },
{ href: "/admin/linked", label: "Linked products", description: "Cross Events and your church's other sites", icon: Link2 },
{ href: "/admin/settings", label: "Settings", description: "Search engines, the menu order, the Coming soon line", icon: Settings },
],
},
{
title: "Team",
items: [
{ href: "/admin/people", label: "People", description: "Who can edit the site, and what they can do", icon: UserCog, managers: true },
{ href: "/admin/audit", label: "Audit log", description: "Who changed what, and when", icon: ScrollText, managers: true },
],
},
{
// 1.4.0, as Accounts and Cross Events.
title: "Looking after it",
items: [
{ href: "/admin/backups", label: "Backups", description: "Copies of your site's database: back up now, download, how many to keep", icon: DatabaseBackup, managers: true },
{ href: "/admin/jobs", label: "Background jobs", description: "What runs on a schedule, and when: switch each on or off", icon: Timer, managers: true },
],
},
];
export const NAV: NavItem[] = NAV_GROUPS.flatMap((g) => g.items);
/** The section an address is in: the longest match, so /admin/pages/… is Pages. */
export const sectionFor = (path: string): NavItem | undefined =>
NAV.filter((n) => (n.href === "/admin" ? path === "/admin" : path === n.href || path.startsWith(`${n.href}/`))).sort((a, b) => b.href.length - a.href.length)[0];