feat(admin): server-safe StatusCard and Import hub polish
CI / check (push) Failing after 8s
CI / release (push) Skipped
CI / deploy (push) Skipped

Split OnlineUsersWidget from StatusCard, decouple ad delete button, sync badge import to ExternalTexts+WebsiteBadges, add Import section hub with cancelable SSE jobs and upload SQL option.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
SimoandCursor committed 2026-08-01 15:48:21 +02:00
1 parent db957d7fb1
commit 9c4949186c
21 files changed
+576 -249

No files matched your search

+7 -7
View File
@@ -1,5 +1,5 @@
import { desc, eq, gt, or } from "drizzle-orm";
import { Ban } from "lucide-react";
import { Ban as BanIcon } from "lucide-react";
import { redirect } from "next/navigation";
import { getTranslations } from "next-intl/server";
import { createBan, liftBan } from "@/actions/admin-bans";
@@ -7,7 +7,7 @@ import { AdminPageShell } from "@/components/admin/admin-page-shell";
import { StatusCard } from "@/components/admin/dashboard";
import { Button } from "@/components/ui/button";
import { unixNow } from "@/lib/bans";
import { Ban as BanTable, db } from "@/lib/db";
import { Ban, db } from "@/lib/db";
import { formatDate } from "@/lib/format-date";
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
@@ -19,13 +19,13 @@ export default async function AdminBans() {
const t = await getTranslations("pages.admin.bans");
const now = unixNow();
let bans: (typeof BanTable.$inferSelect)[] = [];
let bans: (typeof Ban.$inferSelect)[] = [];
try {
bans = await db
.select()
.from(BanTable)
.where(or(eq(BanTable.banExpire, 0), gt(BanTable.banExpire, now)))
.orderBy(desc(BanTable.timestamp))
.from(Ban)
.where(or(eq(Ban.banExpire, 0), gt(Ban.banExpire, now)))
.orderBy(desc(Ban.timestamp))
.limit(100);
} catch {
bans = [];
@@ -35,7 +35,7 @@ export default async function AdminBans() {
const accountBans = bans.filter((b) => b.type === "account").length;
return (
<AdminPageShell icon={Ban} title={t("title")} subtitle={t("subtitle")}>
<AdminPageShell icon={BanIcon} title={t("title")} subtitle={t("subtitle")}>
<main>
<div className="grid grid-cols-[repeat(auto-fit,minmax(180px,1fr))] gap-3.5 mb-6">
<StatusCard