feat(admin, i18n): enhance admin dashboard and user management with new features and translations

Added the ability to filter admin dashboard data by site code and agent node ID, improving data retrieval capabilities. Introduced new functions for fetching dashboard data based on these parameters. Updated the admin users and roles management components to reflect these changes. Enhanced multi-language support by adding new translations for agent management and permission levels in English, Nepali, and Chinese, ensuring a consistent user experience across the admin interface.
This commit is contained in:
2026-06-03 10:07:51 +08:00
parent b15e377187
commit ce27a3ec8a
66 changed files with 1361 additions and 720 deletions

View File

@@ -0,0 +1,26 @@
import { notFound } from "next/navigation";
import { AdminPermissionGate } from "@/components/admin/admin-permission-gate";
import { PRD_REPORTS_VIEW_ACCESS_ANY } from "@/lib/admin-prd";
import { buildPageMetadata } from "@/lib/page-metadata";
import { ReportsConsole } from "@/modules/reports/reports-console";
import type { Metadata } from "next";
type Category = "profit" | "wallet" | "risk" | "audit";
export const metadata: Metadata = buildPageMetadata("reports", "title");
export default async function AdminReportsCategoryPage({
params,
}: {
params: Promise<{ category: string }>;
}) {
const { category } = await params;
if (!["profit", "wallet", "risk", "audit"].includes(category)) {
notFound();
}
return (
<AdminPermissionGate requiredAny={PRD_REPORTS_VIEW_ACCESS_ANY}>
<ReportsConsole initialCategory={category as Category} />
</AdminPermissionGate>
);
}

View File

@@ -0,0 +1,14 @@
import type { ReactNode } from "react";
import { ModuleScaffold } from "@/components/admin/module-scaffold";
import { ReportsSubnav } from "@/modules/reports/reports-subnav";
export default function AdminReportsLayout({ children }: { children: ReactNode }) {
return (
<ModuleScaffold>
<div className="sticky top-14 z-20 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80">
<ReportsSubnav />
</div>
{children}
</ModuleScaffold>
);
}

View File

@@ -1,18 +1,5 @@
import { AdminPermissionGate } from "@/components/admin/admin-permission-gate";
import { ModuleScaffold } from "@/components/admin/module-scaffold";
import { PRD_REPORTS_VIEW_ACCESS_ANY } from "@/lib/admin-prd";
import { buildPageMetadata } from "@/lib/page-metadata";
import { ReportsConsole } from "@/modules/reports/reports-console";
import type { Metadata } from "next";
export const metadata: Metadata = buildPageMetadata("reports", "title");
import { redirect } from "next/navigation";
export default function AdminReportsPage() {
return (
<ModuleScaffold>
<AdminPermissionGate requiredAny={PRD_REPORTS_VIEW_ACCESS_ANY}>
<ReportsConsole />
</AdminPermissionGate>
</ModuleScaffold>
);
redirect("/admin/reports/profit");
}

View File

@@ -168,6 +168,20 @@
@apply overflow-x-auto rounded-2xl border border-border/80 bg-card shadow-sm;
}
/* Sticky columns need an opaque background so scrolled cells/headers do not show through */
[data-slot="table-head"][class*="sticky"] {
@apply bg-muted;
}
/* Match table body (white card), not page background (#f7fbff) or header muted tint */
[data-slot="table-cell"][class*="sticky"] {
background-color: var(--card);
}
[data-slot="table-row"]:hover > [data-slot="table-cell"][class*="sticky"] {
@apply bg-muted/35;
}
.admin-table-toolbar {
@apply flex items-center justify-end border-b border-border/70 bg-muted/20 px-4 py-2.5;
}