feat(docs, agents, risk): enhance documentation, API queries, and UI components
Updated the public documentation site with improved layout and accessibility, including new sections for client integration and admin guides. Enhanced API queries by adding 'active_only' and 'group_by' parameters for better data filtering in risk management. Refined UI components for agent management, ensuring consistent styling and improved user experience across the application. Added localization support for new documentation content in English and Nepali.
This commit is contained in:
@@ -4,7 +4,7 @@ import { AgentsSubnav } from "@/modules/agents/agents-subnav";
|
||||
|
||||
export default function AdminAgentsLayout({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<div className="mx-auto flex w-full max-w-[1680px] min-w-0 flex-col gap-4 px-4 py-4 sm:px-6 lg:px-8 lg:py-5">
|
||||
<div className="mx-auto flex w-full max-w-[1680px] min-h-0 min-w-0 flex-1 flex-col gap-4 px-4 py-4 sm:px-6 lg:px-8 lg:py-5">
|
||||
<AgentsSubnav />
|
||||
{children}
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { Metadata } from "next";
|
||||
import { AgentsDirectoryConsole } from "@/modules/agents/agents-directory-console";
|
||||
import { buildPageMetadata } from "@/lib/page-metadata";
|
||||
|
||||
export const metadata: Metadata = buildPageMetadata("agents", "directoryTitle");
|
||||
export const metadata: Metadata = buildPageMetadata("agents", "listTitle");
|
||||
|
||||
export default function AgentsListPage() {
|
||||
return <AgentsDirectoryConsole />;
|
||||
|
||||
@@ -4,10 +4,10 @@ import {
|
||||
} from "@/modules/risk/risk-pools-console";
|
||||
|
||||
function parsePoolFilter(raw: string | undefined): RiskPoolListFilter {
|
||||
if (raw === "sold_out" || raw === "high_risk") {
|
||||
if (raw === "sold_out" || raw === "high_risk" || raw === "all" || raw === "active") {
|
||||
return raw;
|
||||
}
|
||||
return "all";
|
||||
return "active";
|
||||
}
|
||||
|
||||
export default async function AdminDrawRiskPoolsPage(props: {
|
||||
@@ -24,7 +24,7 @@ export default async function AdminDrawRiskPoolsPage(props: {
|
||||
drawId={id}
|
||||
titleKey="allPoolsPageTitle"
|
||||
initialFilter={filter}
|
||||
defaultSort={filter === "high_risk" ? "usage_desc" : "number_asc"}
|
||||
defaultSort={filter === "high_risk" || filter === "active" ? "usage_desc" : "number_asc"}
|
||||
allowSortChange
|
||||
/>
|
||||
);
|
||||
|
||||
22
src/app/admin/(shell)/tickets/[ticketNo]/page.tsx
Normal file
22
src/app/admin/(shell)/tickets/[ticketNo]/page.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { AdminPermissionGate } from "@/components/admin/admin-permission-gate";
|
||||
import { ModuleScaffold } from "@/components/admin/module-scaffold";
|
||||
import { PRD_TICKETS_ACCESS_ANY } from "@/lib/admin-prd";
|
||||
import { TicketDetailConsole } from "@/modules/tickets/ticket-detail-console";
|
||||
import { buildPageMetadata } from "@/lib/page-metadata";
|
||||
import type { Metadata } from "next";
|
||||
|
||||
export const metadata: Metadata = buildPageMetadata("tickets", "detailTitle");
|
||||
|
||||
export default async function AdminTicketDetailPage(props: {
|
||||
params: Promise<{ ticketNo: string }>;
|
||||
}) {
|
||||
const { ticketNo } = await props.params;
|
||||
|
||||
return (
|
||||
<ModuleScaffold>
|
||||
<AdminPermissionGate requiredAny={PRD_TICKETS_ACCESS_ANY}>
|
||||
<TicketDetailConsole ticketNo={decodeURIComponent(ticketNo)} />
|
||||
</AdminPermissionGate>
|
||||
</ModuleScaffold>
|
||||
);
|
||||
}
|
||||
5
src/app/docs/admin/agents/page.tsx
Normal file
5
src/app/docs/admin/agents/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AdminAgentsDocScreen } from "@/modules/docs/admin/admin-doc-screens";
|
||||
|
||||
export default function AdminDocsAgentsPage(): React.ReactElement {
|
||||
return <AdminAgentsDocScreen />;
|
||||
}
|
||||
5
src/app/docs/admin/config/page.tsx
Normal file
5
src/app/docs/admin/config/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AdminConfigDocScreen } from "@/modules/docs/admin/admin-doc-screens";
|
||||
|
||||
export default function AdminDocsConfigPage(): React.ReactElement {
|
||||
return <AdminConfigDocScreen />;
|
||||
}
|
||||
5
src/app/docs/admin/draws/page.tsx
Normal file
5
src/app/docs/admin/draws/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AdminDrawsDocScreen } from "@/modules/docs/admin/admin-doc-screens";
|
||||
|
||||
export default function AdminDocsDrawsPage(): React.ReactElement {
|
||||
return <AdminDrawsDocScreen />;
|
||||
}
|
||||
5
src/app/docs/admin/faq/page.tsx
Normal file
5
src/app/docs/admin/faq/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AdminFaqDocScreen } from "@/modules/docs/admin/admin-doc-screens";
|
||||
|
||||
export default function AdminDocsFaqPage(): React.ReactElement {
|
||||
return <AdminFaqDocScreen />;
|
||||
}
|
||||
5
src/app/docs/admin/fund-operations/page.tsx
Normal file
5
src/app/docs/admin/fund-operations/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AdminFundOperationsDocScreen } from "@/modules/docs/admin/admin-doc-screens";
|
||||
|
||||
export default function AdminDocsFundOperationsPage(): React.ReactElement {
|
||||
return <AdminFundOperationsDocScreen />;
|
||||
}
|
||||
13
src/app/docs/admin/layout.tsx
Normal file
13
src/app/docs/admin/layout.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
import { DocsSidebar } from "@/components/docs/docs-sidebar";
|
||||
import { DocsBody } from "@/components/docs/docs-shell";
|
||||
import { ADMIN_DOCS_NAV_GROUPS } from "@/lib/admin-docs-nav";
|
||||
|
||||
export default function AdminDocsLayout({ children }: { children: ReactNode }): React.ReactElement {
|
||||
return (
|
||||
<DocsBody sidebar={<DocsSidebar groups={ADMIN_DOCS_NAV_GROUPS} namespace="adminDocs" />}>
|
||||
{children}
|
||||
</DocsBody>
|
||||
);
|
||||
}
|
||||
5
src/app/docs/admin/manual-review/page.tsx
Normal file
5
src/app/docs/admin/manual-review/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AdminManualReviewDocScreen } from "@/modules/docs/admin/admin-doc-screens";
|
||||
|
||||
export default function AdminDocsManualReviewPage(): React.ReactElement {
|
||||
return <AdminManualReviewDocScreen />;
|
||||
}
|
||||
5
src/app/docs/admin/page.tsx
Normal file
5
src/app/docs/admin/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AdminOverviewDocScreen } from "@/modules/docs/admin/admin-doc-screens";
|
||||
|
||||
export default function AdminDocsOverviewPage(): React.ReactElement {
|
||||
return <AdminOverviewDocScreen />;
|
||||
}
|
||||
5
src/app/docs/admin/players/page.tsx
Normal file
5
src/app/docs/admin/players/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AdminPlayersDocScreen } from "@/modules/docs/admin/admin-doc-screens";
|
||||
|
||||
export default function AdminDocsPlayersPage(): React.ReactElement {
|
||||
return <AdminPlayersDocScreen />;
|
||||
}
|
||||
5
src/app/docs/admin/reports/page.tsx
Normal file
5
src/app/docs/admin/reports/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AdminReportsDocScreen } from "@/modules/docs/admin/admin-doc-screens";
|
||||
|
||||
export default function AdminDocsReportsPage(): React.ReactElement {
|
||||
return <AdminReportsDocScreen />;
|
||||
}
|
||||
5
src/app/docs/admin/roles/page.tsx
Normal file
5
src/app/docs/admin/roles/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AdminRolesDocScreen } from "@/modules/docs/admin/admin-doc-screens";
|
||||
|
||||
export default function AdminDocsRolesPage(): React.ReactElement {
|
||||
return <AdminRolesDocScreen />;
|
||||
}
|
||||
5
src/app/docs/admin/settlement-center/page.tsx
Normal file
5
src/app/docs/admin/settlement-center/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AdminSettlementCenterDocScreen } from "@/modules/docs/admin/admin-doc-screens";
|
||||
|
||||
export default function AdminDocsSettlementCenterPage(): React.ReactElement {
|
||||
return <AdminSettlementCenterDocScreen />;
|
||||
}
|
||||
5
src/app/docs/admin/site-setup/page.tsx
Normal file
5
src/app/docs/admin/site-setup/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AdminSiteSetupDocScreen } from "@/modules/docs/admin/admin-doc-screens";
|
||||
|
||||
export default function AdminDocsSiteSetupPage(): React.ReactElement {
|
||||
return <AdminSiteSetupDocScreen />;
|
||||
}
|
||||
5
src/app/docs/admin/tickets/page.tsx
Normal file
5
src/app/docs/admin/tickets/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AdminTicketsDocScreen } from "@/modules/docs/admin/admin-doc-screens";
|
||||
|
||||
export default function AdminDocsTicketsPage(): React.ReactElement {
|
||||
return <AdminTicketsDocScreen />;
|
||||
}
|
||||
5
src/app/docs/admin/wallet/page.tsx
Normal file
5
src/app/docs/admin/wallet/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AdminWalletDocScreen } from "@/modules/docs/admin/admin-doc-screens";
|
||||
|
||||
export default function AdminDocsWalletPage(): React.ReactElement {
|
||||
return <AdminWalletDocScreen />;
|
||||
}
|
||||
5
src/app/docs/integration/admin-guide/page.tsx
Normal file
5
src/app/docs/integration/admin-guide/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default function LegacyAdminGuidePage(): never {
|
||||
redirect("/docs/admin");
|
||||
}
|
||||
6
src/app/docs/integration/api-reference/page.tsx
Normal file
6
src/app/docs/integration/api-reference/page.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
/** 旧链接兼容:完整内容已拆至左侧分章导航 */
|
||||
export default function ApiReferencePage(): never {
|
||||
redirect("/docs/integration");
|
||||
}
|
||||
5
src/app/docs/integration/delivery/page.tsx
Normal file
5
src/app/docs/integration/delivery/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { DeliveryDocScreen } from "@/modules/docs/integration/integration-doc-screens";
|
||||
|
||||
export default function IntegrationDeliveryPage(): React.ReactElement {
|
||||
return <DeliveryDocScreen />;
|
||||
}
|
||||
5
src/app/docs/integration/troubleshooting/page.tsx
Normal file
5
src/app/docs/integration/troubleshooting/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { TroubleshootingDocScreen } from "@/modules/docs/integration/integration-doc-screens";
|
||||
|
||||
export default function IntegrationTroubleshootingPage(): React.ReactElement {
|
||||
return <TroubleshootingDocScreen />;
|
||||
}
|
||||
@@ -5,10 +5,10 @@ import { DocsShell } from "@/components/docs/docs-shell";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: {
|
||||
template: "%s · Integration API",
|
||||
default: "Integration API",
|
||||
template: "%s · Docs",
|
||||
default: "Documentation",
|
||||
},
|
||||
description: "Lottery integration docs: SSO, wallet gateway, transfers.",
|
||||
description: "Lottery admin user guide and API integration documentation.",
|
||||
};
|
||||
|
||||
export default function DocsLayout({ children }: { children: ReactNode }): React.ReactElement {
|
||||
|
||||
@@ -238,3 +238,21 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* 公开文档站:正文链接与强调,避免继承后台 muted 色 */
|
||||
.docs-site .doc-content a:not([class]) {
|
||||
color: #0f172a;
|
||||
font-weight: 500;
|
||||
text-decoration: underline;
|
||||
text-decoration-color: #cbd5e1;
|
||||
text-underline-offset: 2px;
|
||||
}
|
||||
|
||||
.docs-site .doc-content a:not([class]):hover {
|
||||
text-decoration-color: #64748b;
|
||||
}
|
||||
|
||||
.docs-site .doc-content strong {
|
||||
color: #0f172a;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user