- Bundle analyzer: @next/bundle-analyzer wired through next.config.ts,
new `bun run analyze` script (ANALYZE=true next build).
- Scheduled tasks gain:
- enabled flag round-tripped via a #DISABLED prefix on the crontab line
(preserves the mc-task marker + payload for re-enable).
- PATCH /api/schedule/tasks to toggle enabled.
- POST /api/schedule/tasks/run to execute a task immediately via
the same buildCommand used for the cron line (60s timeout, kills
child on client abort).
- Weekly preset in the UI (day-of-week selector), broader aria-labels
on all form selects. Human-readable cron renders "Tue at 04:30"
and next-run calc accounts for weekly.
- Hover-reveal Run now / Enable / Disable / Remove actions; disabled
tasks render at 60% opacity with a "disabled" badge and no next-run.
- /api/errors: minimal append-only JSONL reporter (200ms throttle, UA
and IP captured, fields length-bounded). Falls back to a stable
path under /home/minecraft/logs/ and never fails the client on
logging errors.
- ErrorReporter client (production-only) listens to window.error and
unhandledrejection, fingerprint-dedups via a bounded in-memory set,
sends with keepalive so unloads still flush.
- app/opengraph-image.tsx: 1200x630 dynamic PNG with live status dot
(green/red), player count, address. 60s memo on the status probe.
- A11y: aria-labels on log-line count select, scheduled-restart hour
and minute selects, copy-server-address button (plus focus-visible
ring). ModManager selected-mod pill upgraded to role=button with a
real accessible name and a proper × glyph.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
126 lines
3.5 KiB
TypeScript
126 lines
3.5 KiB
TypeScript
import { ImageResponse } from "next/og";
|
|
import { probeStatus } from "@/lib/server-status";
|
|
import { memoAsync } from "@/lib/cache";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
export const size = { width: 1200, height: 630 };
|
|
export const contentType = "image/png";
|
|
export const alt = "HurkiCorgi MC — modded Minecraft server";
|
|
|
|
export default async function OGImage() {
|
|
const status = await memoAsync("og-status", 60_000, async () => {
|
|
try {
|
|
return await probeStatus();
|
|
} catch {
|
|
return { online: false, players: { online: 0, max: 0 } };
|
|
}
|
|
});
|
|
|
|
const online = status.online;
|
|
const players = status.players;
|
|
const accent = online ? "#4ade80" : "#f87171";
|
|
const statusLabel = online ? "Online" : "Offline";
|
|
|
|
return new ImageResponse(
|
|
(
|
|
<div
|
|
style={{
|
|
width: "100%",
|
|
height: "100%",
|
|
display: "flex",
|
|
flexDirection: "column",
|
|
justifyContent: "space-between",
|
|
padding: 72,
|
|
background:
|
|
"linear-gradient(135deg, #0b0b18 0%, #1a1a2e 60%, #2a1f45 100%)",
|
|
color: "#f4f4f5",
|
|
fontFamily: "system-ui, -apple-system, Segoe UI, Roboto",
|
|
}}
|
|
>
|
|
<div style={{ display: "flex", alignItems: "center", gap: 24 }}>
|
|
<div
|
|
style={{
|
|
width: 20,
|
|
height: 20,
|
|
borderRadius: 999,
|
|
background: accent,
|
|
boxShadow: `0 0 28px ${accent}`,
|
|
}}
|
|
/>
|
|
<span
|
|
style={{
|
|
fontSize: 28,
|
|
fontWeight: 700,
|
|
letterSpacing: "0.3em",
|
|
textTransform: "uppercase",
|
|
color: accent,
|
|
}}
|
|
>
|
|
{statusLabel}
|
|
</span>
|
|
</div>
|
|
|
|
<div style={{ display: "flex", flexDirection: "column", gap: 14 }}>
|
|
<div
|
|
style={{
|
|
fontSize: 108,
|
|
fontWeight: 800,
|
|
letterSpacing: "-0.04em",
|
|
lineHeight: 1,
|
|
display: "flex",
|
|
}}
|
|
>
|
|
HurkiCorgi MC
|
|
</div>
|
|
<div
|
|
style={{
|
|
fontSize: 38,
|
|
color: "#a1a1aa",
|
|
display: "flex",
|
|
}}
|
|
>
|
|
Create & Engineering · Raids · Survival
|
|
</div>
|
|
</div>
|
|
|
|
<div
|
|
style={{
|
|
display: "flex",
|
|
justifyContent: "space-between",
|
|
alignItems: "flex-end",
|
|
gap: 48,
|
|
}}
|
|
>
|
|
<div style={{ display: "flex", flexDirection: "column", gap: 4 }}>
|
|
<span style={{ fontSize: 22, color: "#71717a" }}>Address</span>
|
|
<span style={{ fontSize: 34, fontWeight: 600, fontFamily: "monospace" }}>
|
|
minecraft.hurkicorgi.com
|
|
</span>
|
|
</div>
|
|
<div
|
|
style={{
|
|
display: "flex",
|
|
flexDirection: "column",
|
|
alignItems: "flex-end",
|
|
gap: 4,
|
|
}}
|
|
>
|
|
<span style={{ fontSize: 22, color: "#71717a" }}>Players</span>
|
|
<span
|
|
style={{
|
|
fontSize: 64,
|
|
fontWeight: 800,
|
|
fontVariantNumeric: "tabular-nums",
|
|
color: online ? "#f4f4f5" : "#52525b",
|
|
display: "flex",
|
|
}}
|
|
>
|
|
{online ? `${players.online}/${players.max}` : "—"}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
),
|
|
{ ...size }
|
|
);
|
|
}
|