feat(admin): P1 — clearer tickets labels, pagination, min_staff_rank, analytics errors
Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
75cdfdebe4
commit
f150aea8b9
13 files changed
+311
-101
No files matched your search
@@ -12,6 +12,7 @@ import { redirect } from "next/navigation";
|
||||
import { StatsCard } from "@/components/admin/stats-card";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { getMinStaffRank } from "@/lib/admin/min-staff-rank";
|
||||
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
|
||||
@@ -34,6 +35,7 @@ export default async function ModerationDashboard() {
|
||||
|
||||
const now = Math.floor(Date.now() / 1000);
|
||||
const todayStart = now - (now % 86400);
|
||||
const minStaffRank = await getMinStaffRank();
|
||||
|
||||
const [
|
||||
openCfh,
|
||||
@@ -46,7 +48,9 @@ export default async function ModerationDashboard() {
|
||||
prisma.supportTickets.count({ where: { state: 0 } }),
|
||||
prisma.supportTickets.count({ where: { state: 1 } }),
|
||||
prisma.ban.count({ where: { timestamp: { gte: todayStart } } }),
|
||||
prisma.user.count({ where: { online: "1", rank: { gte: 4 } } }),
|
||||
prisma.user.count({
|
||||
where: { online: "1", rank: { gte: minStaffRank } },
|
||||
}),
|
||||
prisma.supportTickets.findMany({
|
||||
orderBy: { id: "desc" },
|
||||
take: 10,
|
||||
|
||||
Reference in new issue
Block a user