feat(api, agents): add agent node profile retrieval and update functionality
Implemented new API functions to fetch and update agent node profiles, enhancing the management capabilities for agent data. This addition improves the overall functionality of the admin agents console, allowing for better user interaction with agent profiles. Updated related types for improved type safety and clarity in the codebase.
This commit is contained in:
@@ -1,17 +1,9 @@
|
||||
import { RiskPoolsConsole } from "@/modules/risk/risk-pools-console";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
/** 兼容旧链接:热门号码已并入风险池 Tab(筛选 >80%)。 */
|
||||
export default async function AdminDrawRiskHotPage(props: {
|
||||
params: Promise<{ drawId: string }>;
|
||||
}) {
|
||||
const { drawId } = await props.params;
|
||||
const id = Number(drawId);
|
||||
|
||||
return (
|
||||
<RiskPoolsConsole
|
||||
drawId={id}
|
||||
titleKey="hotPageTitle"
|
||||
soldOutOnly={false}
|
||||
defaultSort="usage_desc"
|
||||
/>
|
||||
);
|
||||
redirect(`/admin/draws/${drawId}/risk/pools?filter=high_risk`);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,30 @@
|
||||
import { RiskPoolsConsole } from "@/modules/risk/risk-pools-console";
|
||||
import {
|
||||
RiskPoolsConsole,
|
||||
type RiskPoolListFilter,
|
||||
} from "@/modules/risk/risk-pools-console";
|
||||
|
||||
function parsePoolFilter(raw: string | undefined): RiskPoolListFilter {
|
||||
if (raw === "sold_out" || raw === "high_risk") {
|
||||
return raw;
|
||||
}
|
||||
return "all";
|
||||
}
|
||||
|
||||
export default async function AdminDrawRiskPoolsPage(props: {
|
||||
params: Promise<{ drawId: string }>;
|
||||
searchParams: Promise<{ filter?: string }>;
|
||||
}) {
|
||||
const { drawId } = await props.params;
|
||||
const { filter: filterRaw } = await props.searchParams;
|
||||
const id = Number(drawId);
|
||||
const filter = parsePoolFilter(filterRaw);
|
||||
|
||||
return (
|
||||
<RiskPoolsConsole
|
||||
drawId={id}
|
||||
titleKey="allPoolsPageTitle"
|
||||
soldOutOnly={false}
|
||||
defaultSort="number_asc"
|
||||
initialFilter={filter}
|
||||
defaultSort={filter === "high_risk" ? "usage_desc" : "number_asc"}
|
||||
allowSortChange
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
import { RiskPoolsConsole } from "@/modules/risk/risk-pools-console";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
/** 兼容旧链接:售罄号码已并入风险池 Tab(筛选售罄)。 */
|
||||
export default async function AdminDrawRiskSoldOutPage(props: {
|
||||
params: Promise<{ drawId: string }>;
|
||||
}) {
|
||||
const { drawId } = await props.params;
|
||||
const id = Number(drawId);
|
||||
|
||||
return (
|
||||
<RiskPoolsConsole
|
||||
drawId={id}
|
||||
titleKey="soldOutPageTitle"
|
||||
soldOutOnly
|
||||
defaultSort="number_asc"
|
||||
/>
|
||||
);
|
||||
redirect(`/admin/draws/${drawId}/risk/pools?filter=sold_out`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user