- Snapshots now include recursive sizeBytes (lib/snapshots.ts dirSize),
rendered as a badge next to mod count.
- Snapshot restore/delete is now type-to-confirm: click Restore/Delete,
type the literal snapshot name, press Enter or click Confirm. Esc
cancels, matches the existing wizard Esc handler.
- Analytics card:
- Uptime ring showing % of datapoints with tps>0 (color-graded
green/amber/red) + numeric % over selected range.
- Peak-player marker dot on the Players sparkline + peak caption.
- "Online now" player list (up to 8) with small PlayerAvatar badges,
sourced from the latest analytics entry's players[] array.
- Player profile drawer (new):
- Slide-in right panel opened by clicking any PlayerAvatar.
- Shows Online / Op / Whitelisted / Banned badges, UUID, ban reason.
- Quick toggles for op/deop, whitelist add/remove, ban (with reason
input) and pardon — reuses /api/players POST contract.
- Global event bus (lib/events.ts) decouples avatars from drawer.
- Esc / backdrop / close-button dismiss.
- PlayerAvatar now renders as a <button> by default (stopPropagation on
click, focus-visible ring); pass interactive={false} to opt out (used
inside the drawer itself).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
"use client";
|
|
|
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
import { SessionProvider } from "next-auth/react";
|
|
import { Toaster } from "sonner";
|
|
import { useEffect, useState } from "react";
|
|
import { CommandPalette } from "@/components/CommandPalette";
|
|
import { PlayerDrawer } from "@/components/PlayerDrawer";
|
|
|
|
export function Providers({ children }: { children: React.ReactNode }) {
|
|
const [queryClient] = useState(
|
|
() =>
|
|
new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
refetchOnWindowFocus: false,
|
|
},
|
|
},
|
|
})
|
|
);
|
|
|
|
const [theme, setTheme] = useState<"light" | "dark">("dark");
|
|
useEffect(() => {
|
|
const sync = () => {
|
|
setTheme(document.documentElement.classList.contains("dark") ? "dark" : "light");
|
|
};
|
|
sync();
|
|
const obs = new MutationObserver(sync);
|
|
obs.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] });
|
|
return () => obs.disconnect();
|
|
}, []);
|
|
|
|
return (
|
|
<SessionProvider>
|
|
<QueryClientProvider client={queryClient}>
|
|
{children}
|
|
<CommandPalette />
|
|
<PlayerDrawer />
|
|
<Toaster
|
|
theme={theme}
|
|
position="bottom-right"
|
|
richColors
|
|
closeButton
|
|
toastOptions={{ duration: 4000 }}
|
|
/>
|
|
</QueryClientProvider>
|
|
</SessionProvider>
|
|
);
|
|
}
|