feat(admin, i18n): enhance reports, draws, config, and player workflows
This commit is contained in:
@@ -2,10 +2,12 @@
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Info } from "lucide-react";
|
||||
|
||||
import { AdminPageCard } from "@/components/admin/admin-page-card";
|
||||
import { JackpotPoolsConsole } from "@/modules/jackpot/jackpot-pools-console";
|
||||
import { JackpotRecordsConsole } from "@/modules/jackpot/jackpot-records-console";
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
|
||||
/** 奖池单页:池参数 + 流水记录,与列表/设置页共用 admin-list-card 布局。 */
|
||||
export function JackpotConfigScreen() {
|
||||
@@ -26,6 +28,15 @@ export function JackpotConfigScreen() {
|
||||
return (
|
||||
<div className="flex w-full max-w-none flex-col gap-6">
|
||||
<AdminPageCard title={t("poolsSectionTitle")}>
|
||||
<Alert className="mb-4 border-primary/20 bg-primary/5 text-foreground">
|
||||
<Info className="size-4" aria-hidden />
|
||||
<AlertTitle>{t("rulesTitle")}</AlertTitle>
|
||||
<AlertDescription className="space-y-1 text-xs leading-5">
|
||||
<p>{t("rulesJoin")}</p>
|
||||
<p>{t("rulesBurst")}</p>
|
||||
<p>{t("rulesManual")}</p>
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
<JackpotPoolsConsole embedded />
|
||||
</AdminPageCard>
|
||||
|
||||
|
||||
@@ -214,15 +214,15 @@ export function JackpotPoolsConsole({ embedded = false }: JackpotPoolsConsolePro
|
||||
const manualBurst = async (p: AdminJackpotPoolRow) => {
|
||||
const d = drafts[p.id];
|
||||
if (!d) return;
|
||||
const drawId = Number.parseInt(d.manual_burst_draw_id, 10);
|
||||
if (!Number.isFinite(drawId) || drawId <= 0) {
|
||||
const drawRef = d.manual_burst_draw_id.trim();
|
||||
if (drawRef.length === 0) {
|
||||
toast.error(t("invalidDrawId"));
|
||||
return;
|
||||
}
|
||||
|
||||
setBurstingId(p.id);
|
||||
try {
|
||||
const res = await postAdminJackpotManualBurst(p.id, { draw_id: drawId });
|
||||
const res = await postAdminJackpotManualBurst(p.id, { draw_id: drawRef });
|
||||
toast.success(
|
||||
`${t("manualBurstSuccess")} · ${res.draw_no} · ${res.winner_count} ${t("winnerCount")}`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user