feat(api, i18n): add admin report job functionalities and enhance locale support
- Introduced new API functions for managing admin report jobs, including download and post operations. - Updated English, Nepali, and Chinese locale files to include new messages related to report job actions and rollback confirmations. - Enhanced user experience by providing clearer instructions and feedback in the admin interface. - Refactored related components to integrate new functionalities and improve overall usability.
This commit is contained in:
@@ -151,6 +151,8 @@ export function PlayConfigDocScreen() {
|
||||
const [loadingDetail, setLoadingDetail] = useState(false);
|
||||
const [saving, setSaving] = useState(false);
|
||||
const [creatingDraftId, setCreatingDraftId] = useState<string | null>(null);
|
||||
const [rollbackOpen, setRollbackOpen] = useState(false);
|
||||
const [rollbackTarget, setRollbackTarget] = useState<ConfigVersionSummary | null>(null);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const detailRequestSeq = useRef(0);
|
||||
|
||||
@@ -400,6 +402,41 @@ export function PlayConfigDocScreen() {
|
||||
}
|
||||
}
|
||||
|
||||
function requestRollback(row: ConfigVersionSummary) {
|
||||
setRollbackTarget(row);
|
||||
setRollbackOpen(true);
|
||||
}
|
||||
|
||||
async function handleRollback() {
|
||||
if (!rollbackTarget) {
|
||||
return;
|
||||
}
|
||||
setSaving(true);
|
||||
try {
|
||||
const d = await postPlayConfigVersion({
|
||||
reason: `rollback from v${rollbackTarget.version_no}`,
|
||||
clone_from_version_id: rollbackTarget.id,
|
||||
});
|
||||
toast.success(
|
||||
t("versionActions.rollbackSuccess", {
|
||||
ns: "config",
|
||||
fromVersion: rollbackTarget.version_no,
|
||||
version: d.version_no,
|
||||
}),
|
||||
);
|
||||
await refreshList();
|
||||
setSelectedId(String(d.id));
|
||||
setDetail(d);
|
||||
setDraftRows(d.items.map((it) => ({ ...it })));
|
||||
setRollbackOpen(false);
|
||||
setRollbackTarget(null);
|
||||
} catch (e) {
|
||||
toast.error(e instanceof LotteryApiBizError ? e.message : t("versionActions.rollbackFailed", { ns: "config" }));
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<ConfigDocPage
|
||||
title={t("nav.items.plays", { ns: "config" })}
|
||||
@@ -413,6 +450,8 @@ export function PlayConfigDocScreen() {
|
||||
loading={loadingList}
|
||||
sheetTitle={`${t("nav.items.plays", { ns: "config" })} ${t("versionSwitcher.sheetTitle", { ns: "config" })}`}
|
||||
onDeleteVersion={handleDeleteVersion}
|
||||
onRollbackVersion={requestRollback}
|
||||
rollbackBusy={saving}
|
||||
/>
|
||||
}
|
||||
actions={
|
||||
@@ -744,6 +783,29 @@ export function PlayConfigDocScreen() {
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
<Dialog open={rollbackOpen} onOpenChange={setRollbackOpen}>
|
||||
<DialogContent showCloseButton className="sm:max-w-md">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{t("versionActions.rollbackDialog.title", { ns: "config" })}</DialogTitle>
|
||||
<DialogDescription>
|
||||
{t("versionActions.rollbackDialog.description", {
|
||||
ns: "config",
|
||||
version: rollbackTarget?.version_no ?? "—",
|
||||
})}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<DialogFooter>
|
||||
<Button type="button" variant="outline" onClick={() => setRollbackOpen(false)}>
|
||||
{t("actions.cancel", { ns: "adminUsers" })}
|
||||
</Button>
|
||||
<Button type="button" onClick={() => void handleRollback()} disabled={!rollbackTarget || saving}>
|
||||
{t("versionActions.rollbackDialog.confirm", { ns: "config" })}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
<ConfirmDialog />
|
||||
</ConfigDocPage>
|
||||
);
|
||||
|
||||
@@ -19,8 +19,16 @@ import {
|
||||
ConfigVersionToolbarMeta,
|
||||
ConfigVersionToolbarMetaEmphasis,
|
||||
} from "@/modules/config/config-version-toolbar-meta";
|
||||
import { AdminStatusBadge } from "@/components/admin/admin-status-badge";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@/components/ui/dialog";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { ConfigReadonlyValue } from "@/modules/config/config-readonly-value";
|
||||
@@ -116,6 +124,8 @@ export function RebateConfigDocScreen({
|
||||
const [p2, setP2] = useState("0");
|
||||
const [p3, setP3] = useState("0");
|
||||
const [p4, setP4] = useState("0");
|
||||
const [rollbackOpen, setRollbackOpen] = useState(false);
|
||||
const [rollbackTarget, setRollbackTarget] = useState<ConfigVersionSummary | null>(null);
|
||||
|
||||
const refreshTypes = useCallback(async () => {
|
||||
try {
|
||||
@@ -328,6 +338,45 @@ export function RebateConfigDocScreen({
|
||||
|
||||
const activeHead = listRows.find((x) => x.status === "active");
|
||||
|
||||
function requestRollback(row: ConfigVersionSummary) {
|
||||
setRollbackTarget(row);
|
||||
setRollbackOpen(true);
|
||||
}
|
||||
|
||||
async function handleRollback() {
|
||||
if (!rollbackTarget) {
|
||||
return;
|
||||
}
|
||||
setSaving(true);
|
||||
try {
|
||||
const d = await postOddsVersion({
|
||||
reason: `rollback from v${rollbackTarget.version_no}`,
|
||||
clone_from_version_id: rollbackTarget.id,
|
||||
});
|
||||
toast.success(
|
||||
t("versionActions.rollbackSuccess", {
|
||||
ns: "config",
|
||||
fromVersion: rollbackTarget.version_no,
|
||||
version: d.version_no,
|
||||
}),
|
||||
);
|
||||
await refreshList();
|
||||
setSelectedId(String(d.id));
|
||||
const rows = d.items.map((it) => ({ ...it }));
|
||||
setDetail(d);
|
||||
setDraftRows(rows);
|
||||
setP2(inferPercentFrom(2, rows, types));
|
||||
setP3(inferPercentFrom(3, rows, types));
|
||||
setP4(inferPercentFrom(4, rows, types));
|
||||
setRollbackOpen(false);
|
||||
setRollbackTarget(null);
|
||||
} catch (e) {
|
||||
toast.error(e instanceof LotteryApiBizError ? e.message : t("versionActions.rollbackFailed", { ns: "config" }));
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function handleDeleteVersion(row: ConfigVersionSummary) {
|
||||
try {
|
||||
await deleteOddsVersion(row.id);
|
||||
@@ -350,6 +399,8 @@ export function RebateConfigDocScreen({
|
||||
sheetTitle={`${t("nav.items.rebate", { ns: "config" })} ${t("versionSwitcher.sheetTitle", { ns: "config" })}`}
|
||||
sheetDescription={t("rebate.sheetDescription", { ns: "config" })}
|
||||
onDeleteVersion={handleDeleteVersion}
|
||||
onRollbackVersion={requestRollback}
|
||||
rollbackBusy={saving}
|
||||
/>
|
||||
}
|
||||
actions={
|
||||
@@ -460,12 +511,13 @@ export function RebateConfigDocScreen({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-between gap-3 rounded-xl border border-border/60 px-4 py-3">
|
||||
<p className="text-sm font-medium">{t("rebate.winEnjoy.label", { ns: "config" })}</p>
|
||||
<AdminStatusBadge status="enabled">
|
||||
{t("system.states.enabled", { ns: "config" })}
|
||||
</AdminStatusBadge>
|
||||
</div>
|
||||
<Alert className="border-border/80 bg-muted/30">
|
||||
<AlertDescription className="text-sm leading-relaxed">
|
||||
<span className="font-medium text-foreground">{t("rebate.winEnjoy.label", { ns: "config" })}</span>
|
||||
{" — "}
|
||||
{t("rebate.winEnjoy.pendingNote", { ns: "config" })}
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
|
||||
{!embedded ? (
|
||||
<div className="grid gap-1 text-sm">
|
||||
@@ -482,10 +534,35 @@ export function RebateConfigDocScreen({
|
||||
</>
|
||||
);
|
||||
|
||||
const rollbackDialog = (
|
||||
<Dialog open={rollbackOpen} onOpenChange={setRollbackOpen}>
|
||||
<DialogContent showCloseButton className="sm:max-w-md">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{t("versionActions.rollbackDialog.title", { ns: "config" })}</DialogTitle>
|
||||
<DialogDescription>
|
||||
{t("versionActions.rollbackDialog.description", {
|
||||
ns: "config",
|
||||
version: rollbackTarget?.version_no ?? "—",
|
||||
})}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<DialogFooter>
|
||||
<Button type="button" variant="outline" onClick={() => setRollbackOpen(false)}>
|
||||
{t("actions.cancel", { ns: "adminUsers" })}
|
||||
</Button>
|
||||
<Button type="button" onClick={() => void handleRollback()} disabled={!rollbackTarget || saving}>
|
||||
{t("versionActions.rollbackDialog.confirm", { ns: "config" })}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
if (embedded) {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
{fieldsBlock}
|
||||
{rollbackDialog}
|
||||
<ConfirmDialog />
|
||||
</div>
|
||||
);
|
||||
@@ -497,6 +574,7 @@ export function RebateConfigDocScreen({
|
||||
toolbar={toolbarBlock}
|
||||
>
|
||||
{fieldsBlock}
|
||||
{rollbackDialog}
|
||||
<ConfirmDialog />
|
||||
</ConfigDocPage>
|
||||
);
|
||||
|
||||
@@ -31,6 +31,7 @@ import {
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { ConfigVersionSwitcher } from "@/modules/config/config-version-switcher";
|
||||
import { RiskCapRuntimePanel } from "@/modules/config/risk-cap-runtime-panel";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
@@ -98,8 +99,9 @@ export function RiskCapDocScreen() {
|
||||
|
||||
const [defaultCapStr, setDefaultCapStr] = useState("");
|
||||
const [syncOpen, setSyncOpen] = useState(false);
|
||||
const [rollbackOpen, setRollbackOpen] = useState(false);
|
||||
const [rollbackTarget, setRollbackTarget] = useState<ConfigVersionSummary | null>(null);
|
||||
|
||||
const [occSearch, setOccSearch] = useState("");
|
||||
const amountCurrencyCode = "NPR";
|
||||
|
||||
const refreshList = useCallback(async () => {
|
||||
@@ -315,7 +317,7 @@ export function RiskCapDocScreen() {
|
||||
|
||||
function applyDefaultCap() {
|
||||
const n = parseAdminMajorToMinor(defaultCapStr, amountCurrencyCode);
|
||||
if (!Number.isFinite(n) || n <= 0) {
|
||||
if (n == null || !Number.isFinite(n) || n <= 0) {
|
||||
toast.error(t("riskCap.validation.enterValidCapAmount", { ns: "config" }));
|
||||
return;
|
||||
}
|
||||
@@ -327,14 +329,6 @@ export function RiskCapDocScreen() {
|
||||
toast.message(t("riskCap.savedLocalDraft", { ns: "config" }));
|
||||
}
|
||||
|
||||
const occFiltered = useMemo(() => {
|
||||
const q = occSearch.trim();
|
||||
if (!q) {
|
||||
return draftRows.filter((row) => !isDefaultRiskRow(row));
|
||||
}
|
||||
return draftRows.filter((r) => !isDefaultRiskRow(r) && r.normalized_number.includes(q));
|
||||
}, [draftRows, occSearch]);
|
||||
|
||||
const specialRows = useMemo(
|
||||
() => draftRows.map((row, index) => ({ row, index })).filter(({ row }) => !isDefaultRiskRow(row)),
|
||||
[draftRows],
|
||||
@@ -351,6 +345,49 @@ export function RiskCapDocScreen() {
|
||||
}
|
||||
}
|
||||
|
||||
function requestRollback(row: ConfigVersionSummary) {
|
||||
setRollbackTarget(row);
|
||||
setRollbackOpen(true);
|
||||
}
|
||||
|
||||
async function handleRollback() {
|
||||
if (!rollbackTarget) {
|
||||
return;
|
||||
}
|
||||
setSaving(true);
|
||||
try {
|
||||
const d = await postRiskCapVersion({
|
||||
reason: `rollback from v${rollbackTarget.version_no}`,
|
||||
clone_from_version_id: rollbackTarget.id,
|
||||
});
|
||||
toast.success(
|
||||
t("versionActions.rollbackSuccess", {
|
||||
ns: "config",
|
||||
fromVersion: rollbackTarget.version_no,
|
||||
version: d.version_no,
|
||||
}),
|
||||
);
|
||||
await refreshList();
|
||||
setSelectedId(String(d.id));
|
||||
setDetail(d);
|
||||
const mapped = d.items.map((it) => ({
|
||||
clientKey: `srv-${it.id}`,
|
||||
draw_id: it.draw_id,
|
||||
normalized_number: it.normalized_number,
|
||||
cap_amount: it.cap_amount,
|
||||
cap_type: it.cap_type,
|
||||
}));
|
||||
setDraftRows(mapped);
|
||||
syncDefaultCapFromRows(mapped);
|
||||
setRollbackOpen(false);
|
||||
setRollbackTarget(null);
|
||||
} catch (e) {
|
||||
toast.error(e instanceof LotteryApiBizError ? e.message : t("versionActions.rollbackFailed", { ns: "config" }));
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<ConfigDocPage
|
||||
title={t("nav.items.risk-cap", { ns: "config" })}
|
||||
@@ -365,6 +402,8 @@ export function RiskCapDocScreen() {
|
||||
loading={loadingList}
|
||||
sheetTitle={`${t("nav.items.risk-cap", { ns: "config" })} ${t("versionSwitcher.sheetTitle", { ns: "config" })}`}
|
||||
onDeleteVersion={handleDeleteVersion}
|
||||
onRollbackVersion={requestRollback}
|
||||
rollbackBusy={saving}
|
||||
/>
|
||||
}
|
||||
actions={
|
||||
@@ -466,9 +505,6 @@ export function RiskCapDocScreen() {
|
||||
<TableRow>
|
||||
<TableHead className="w-[110px]">{t("riskCap.table.number", { ns: "config" })}</TableHead>
|
||||
<TableHead className="w-[140px]">{t("riskCap.table.capAmount", { ns: "config" })}</TableHead>
|
||||
<TableHead className="w-[90px] text-center">{t("riskCap.table.used", { ns: "config" })}</TableHead>
|
||||
<TableHead className="w-[90px] text-center">{t("riskCap.table.remaining", { ns: "config" })}</TableHead>
|
||||
<TableHead className="w-[72px] text-center">{t("riskCap.table.soldOut", { ns: "config" })}</TableHead>
|
||||
<TableHead className="w-[160px]">{t("riskCap.table.actions", { ns: "config" })}</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
@@ -513,9 +549,6 @@ export function RiskCapDocScreen() {
|
||||
</ConfigReadonlyValue>
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell className="text-center text-muted-foreground tabular-nums text-sm">—</TableCell>
|
||||
<TableCell className="text-center text-muted-foreground tabular-nums text-sm">—</TableCell>
|
||||
<TableCell className="text-center text-muted-foreground text-sm">—</TableCell>
|
||||
<TableCell>
|
||||
{canEditDraft ? (
|
||||
<Button
|
||||
@@ -538,54 +571,7 @@ export function RiskCapDocScreen() {
|
||||
)}
|
||||
</ConfigSection>
|
||||
|
||||
<ConfigSection title={t("riskCap.occupancy.title", { ns: "config" })}>
|
||||
<div className="flex flex-wrap gap-3 items-end">
|
||||
<div className="grid gap-1">
|
||||
<Label htmlFor="occ-search">{t("riskCap.occupancy.searchLabel", { ns: "config" })}</Label>
|
||||
<Input
|
||||
id="occ-search"
|
||||
className="w-[140px] font-mono"
|
||||
placeholder={t("riskCap.occupancy.searchPlaceholder", { ns: "config" })}
|
||||
value={occSearch}
|
||||
onChange={(e) => setOccSearch(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<Button type="button" variant="outline" onClick={() => toast.message(t("riskCap.occupancy.filterPending", { ns: "config" }))}>
|
||||
{t("riskCap.actions.filterPresets", { ns: "config" })}
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
onClick={() => toast.message(t("riskCap.occupancy.exportPending", { ns: "config" }))}
|
||||
>
|
||||
{t("riskCap.actions.exportCsv", { ns: "config" })}
|
||||
</Button>
|
||||
</div>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>{t("riskCap.table.number", { ns: "config" })}</TableHead>
|
||||
<TableHead className="text-center">{t("riskCap.table.used", { ns: "config" })}</TableHead>
|
||||
<TableHead className="text-center">{t("riskCap.table.remaining", { ns: "config" })}</TableHead>
|
||||
<TableHead className="text-center">{t("riskCap.table.ratio", { ns: "config" })}</TableHead>
|
||||
<TableHead className="text-center">{t("riskCap.table.soldOut", { ns: "config" })}</TableHead>
|
||||
<TableHead className="w-[140px]">{t("riskCap.table.actions", { ns: "config" })}</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{occFiltered.map((r) => (
|
||||
<TableRow key={`occ-${r.clientKey}`}>
|
||||
<TableCell className="font-mono text-sm">{r.normalized_number}</TableCell>
|
||||
<TableCell className="text-center text-muted-foreground">—</TableCell>
|
||||
<TableCell className="text-center text-muted-foreground">—</TableCell>
|
||||
<TableCell className="text-center text-muted-foreground">—</TableCell>
|
||||
<TableCell className="text-center text-muted-foreground">—</TableCell>
|
||||
<TableCell className="text-center text-muted-foreground">—</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</ConfigSection>
|
||||
<RiskCapRuntimePanel />
|
||||
|
||||
<Dialog open={syncOpen} onOpenChange={setSyncOpen}>
|
||||
<DialogContent showCloseButton className="sm:max-w-md">
|
||||
@@ -605,6 +591,29 @@ export function RiskCapDocScreen() {
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
<Dialog open={rollbackOpen} onOpenChange={setRollbackOpen}>
|
||||
<DialogContent showCloseButton className="sm:max-w-md">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{t("versionActions.rollbackDialog.title", { ns: "config" })}</DialogTitle>
|
||||
<DialogDescription>
|
||||
{t("versionActions.rollbackDialog.description", {
|
||||
ns: "config",
|
||||
version: rollbackTarget?.version_no ?? "—",
|
||||
})}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<DialogFooter>
|
||||
<Button type="button" variant="outline" onClick={() => setRollbackOpen(false)}>
|
||||
{t("actions.cancel", { ns: "adminUsers" })}
|
||||
</Button>
|
||||
<Button type="button" onClick={() => void handleRollback()} disabled={!rollbackTarget || saving}>
|
||||
{t("versionActions.rollbackDialog.confirm", { ns: "config" })}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
<ConfirmDialog />
|
||||
</ConfigDocPage>
|
||||
);
|
||||
|
||||
275
src/modules/config/risk-cap-runtime-panel.tsx
Normal file
275
src/modules/config/risk-cap-runtime-panel.tsx
Normal file
@@ -0,0 +1,275 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { toast } from "sonner";
|
||||
|
||||
import { getAdminDraws } from "@/api/admin-draws";
|
||||
import { getAdminRiskPools } from "@/api/admin-risk";
|
||||
import { AdminTableExportButton } from "@/components/admin/admin-table-export-button";
|
||||
import { Button, buttonVariants } from "@/components/ui/button";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { ConfigSection } from "@/modules/config/config-section";
|
||||
import { formatAdminMinorUnits } from "@/lib/money";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { LotteryApiBizError } from "@/types/api/errors";
|
||||
import type { AdminDrawListItem } from "@/types/api/admin-draws";
|
||||
import type { AdminRiskPoolRow } from "@/types/api/admin-risk";
|
||||
|
||||
type PoolFilter = "all" | "sold_out" | "high_risk";
|
||||
|
||||
export function RiskCapRuntimePanel() {
|
||||
const { t } = useTranslation(["config", "risk", "draws", "common"]);
|
||||
const [draws, setDraws] = useState<AdminDrawListItem[]>([]);
|
||||
const [drawsLoading, setDrawsLoading] = useState(true);
|
||||
const [drawId, setDrawId] = useState<string>("");
|
||||
|
||||
const [numberQ, setNumberQ] = useState("");
|
||||
const [appliedNumber, setAppliedNumber] = useState("");
|
||||
const [poolFilter, setPoolFilter] = useState<PoolFilter>("all");
|
||||
|
||||
const [pools, setPools] = useState<AdminRiskPoolRow[]>([]);
|
||||
const [currencyCode, setCurrencyCode] = useState<string | null>(null);
|
||||
const [poolsLoading, setPoolsLoading] = useState(false);
|
||||
const [poolsError, setPoolsError] = useState<string | null>(null);
|
||||
|
||||
const selectedDraw = useMemo(
|
||||
() => draws.find((d) => String(d.id) === drawId) ?? null,
|
||||
[draws, drawId],
|
||||
);
|
||||
|
||||
const loadDraws = useCallback(async () => {
|
||||
setDrawsLoading(true);
|
||||
try {
|
||||
const data = await getAdminDraws({ page: 1, per_page: 50 });
|
||||
setDraws(data.items);
|
||||
if (data.items.length > 0) {
|
||||
setDrawId((prev) => (prev === "" ? String(data.items[0].id) : prev));
|
||||
}
|
||||
} catch (e) {
|
||||
toast.error(e instanceof LotteryApiBizError ? e.message : t("errors.loadFailed", { ns: "common" }));
|
||||
setDraws([]);
|
||||
} finally {
|
||||
setDrawsLoading(false);
|
||||
}
|
||||
}, [t]);
|
||||
|
||||
const loadPools = useCallback(async () => {
|
||||
if (!drawId) {
|
||||
setPools([]);
|
||||
return;
|
||||
}
|
||||
const id = Number(drawId);
|
||||
if (!Number.isFinite(id)) {
|
||||
return;
|
||||
}
|
||||
setPoolsLoading(true);
|
||||
setPoolsError(null);
|
||||
try {
|
||||
const data = await getAdminRiskPools(id, {
|
||||
page: 1,
|
||||
per_page: 200,
|
||||
normalized_number: appliedNumber.trim() || undefined,
|
||||
sold_out_only: poolFilter === "sold_out",
|
||||
high_risk_only: poolFilter === "high_risk",
|
||||
sort: poolFilter === "high_risk" ? "usage_desc" : "number_asc",
|
||||
});
|
||||
setPools(data.items);
|
||||
setCurrencyCode(data.currency_code);
|
||||
} catch (e) {
|
||||
setPoolsError(e instanceof LotteryApiBizError ? e.message : t("errors.loadFailed", { ns: "common" }));
|
||||
setPools([]);
|
||||
} finally {
|
||||
setPoolsLoading(false);
|
||||
}
|
||||
}, [appliedNumber, drawId, poolFilter, t]);
|
||||
|
||||
useEffect(() => {
|
||||
void loadDraws();
|
||||
}, [loadDraws]);
|
||||
|
||||
useEffect(() => {
|
||||
void loadPools();
|
||||
}, [loadPools]);
|
||||
|
||||
const riskBase = drawId ? `/admin/draws/${drawId}/risk` : null;
|
||||
|
||||
return (
|
||||
<ConfigSection
|
||||
title={t("riskCap.runtime.title", { ns: "config" })}
|
||||
description={t("riskCap.runtime.description", { ns: "config" })}
|
||||
>
|
||||
<div className="flex flex-wrap items-end gap-3">
|
||||
<div className="grid min-w-[12rem] flex-1 gap-1.5">
|
||||
<Label htmlFor="risk-cap-draw">{t("riskCap.runtime.drawLabel", { ns: "config" })}</Label>
|
||||
<Select
|
||||
value={drawId || undefined}
|
||||
onValueChange={(v) => setDrawId(v ?? "")}
|
||||
disabled={drawsLoading || draws.length === 0}
|
||||
>
|
||||
<SelectTrigger id="risk-cap-draw" className="font-mono">
|
||||
<SelectValue placeholder={t("riskCap.runtime.drawPlaceholder", { ns: "config" })} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{draws.map((d) => (
|
||||
<SelectItem key={d.id} value={String(d.id)}>
|
||||
{d.draw_no} · {d.status}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
{riskBase ? (
|
||||
<div className="flex flex-wrap gap-2 pb-0.5">
|
||||
<Link href={`${riskBase}/pools`} className={cn(buttonVariants({ variant: "outline", size: "sm" }))}>
|
||||
{t("subnav.riskPools", { ns: "draws" })}
|
||||
</Link>
|
||||
<Link href={`${riskBase}/hot`} className={cn(buttonVariants({ variant: "outline", size: "sm" }))}>
|
||||
{t("subnav.riskHot", { ns: "draws" })}
|
||||
</Link>
|
||||
<Link href={`${riskBase}/sold-out`} className={cn(buttonVariants({ variant: "outline", size: "sm" }))}>
|
||||
{t("subnav.riskSoldOut", { ns: "draws" })}
|
||||
</Link>
|
||||
<Link href={`${riskBase}/occupancy`} className={cn(buttonVariants({ variant: "outline", size: "sm" }))}>
|
||||
{t("subnav.riskLockLogs", { ns: "draws" })}
|
||||
</Link>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{drawId ? (
|
||||
<>
|
||||
<div className="flex flex-wrap items-end gap-3">
|
||||
<div className="grid gap-1.5">
|
||||
<Label htmlFor="risk-cap-number-q">{t("riskCap.occupancy.searchLabel", { ns: "config" })}</Label>
|
||||
<Input
|
||||
id="risk-cap-number-q"
|
||||
className="w-[140px] font-mono"
|
||||
placeholder={t("riskCap.occupancy.searchPlaceholder", { ns: "config" })}
|
||||
value={numberQ}
|
||||
onChange={(e) => setNumberQ(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{(
|
||||
[
|
||||
{ id: "all", label: t("riskCap.runtime.filterAll", { ns: "config" }) },
|
||||
{ id: "sold_out", label: t("riskCap.runtime.filterSoldOut", { ns: "config" }) },
|
||||
{ id: "high_risk", label: t("riskCap.runtime.filterHighRisk", { ns: "config" }) },
|
||||
] as const
|
||||
).map((f) => (
|
||||
<Button
|
||||
key={f.id}
|
||||
type="button"
|
||||
size="sm"
|
||||
variant={poolFilter === f.id ? "default" : "outline"}
|
||||
onClick={() => setPoolFilter(f.id)}
|
||||
>
|
||||
{f.label}
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant="secondary"
|
||||
onClick={() => {
|
||||
setAppliedNumber(numberQ.trim());
|
||||
}}
|
||||
>
|
||||
{t("actions.search", { ns: "common" })}
|
||||
</Button>
|
||||
<Button type="button" size="sm" variant="outline" disabled={poolsLoading} onClick={() => void loadPools()}>
|
||||
{t("versionActions.refresh", { ns: "config" })}
|
||||
</Button>
|
||||
{pools.length > 0 ? (
|
||||
<AdminTableExportButton
|
||||
tableId="risk-cap-runtime-pools"
|
||||
filename={`risk-pools-${selectedDraw?.draw_no ?? drawId}`}
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{poolsError ? <p className="text-sm text-destructive">{poolsError}</p> : null}
|
||||
|
||||
<div className="admin-table-shell">
|
||||
<Table id="risk-cap-runtime-pools">
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>{t("riskCap.table.number", { ns: "config" })}</TableHead>
|
||||
<TableHead className="text-center">{t("riskCap.table.used", { ns: "config" })}</TableHead>
|
||||
<TableHead className="text-center">{t("riskCap.table.remaining", { ns: "config" })}</TableHead>
|
||||
<TableHead className="text-center">{t("riskCap.table.ratio", { ns: "config" })}</TableHead>
|
||||
<TableHead className="text-center">{t("riskCap.table.soldOut", { ns: "config" })}</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{poolsLoading ? (
|
||||
<TableRow>
|
||||
<TableCell colSpan={5} className="text-muted-foreground">
|
||||
{t("states.loading", { ns: "common" })}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
) : pools.length === 0 ? (
|
||||
<TableRow>
|
||||
<TableCell colSpan={5} className="text-muted-foreground">
|
||||
{t("states.noData", { ns: "common" })}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
) : (
|
||||
pools.map((row) => (
|
||||
<TableRow
|
||||
key={row.normalized_number}
|
||||
className={cn(
|
||||
row.is_sold_out && "bg-destructive/5",
|
||||
!row.is_sold_out && (row.usage_ratio ?? 0) >= 0.8 && "bg-amber-500/10",
|
||||
)}
|
||||
>
|
||||
<TableCell className="font-mono text-sm">{row.normalized_number}</TableCell>
|
||||
<TableCell className="text-center text-xs tabular-nums">
|
||||
{formatAdminMinorUnits(row.locked_amount, currencyCode ?? undefined)}
|
||||
</TableCell>
|
||||
<TableCell className="text-center text-xs tabular-nums">
|
||||
{formatAdminMinorUnits(row.remaining_amount, currencyCode ?? undefined)}
|
||||
</TableCell>
|
||||
<TableCell className="text-center text-xs tabular-nums">
|
||||
{row.usage_ratio != null ? `${Math.round(row.usage_ratio * 100)}%` : "—"}
|
||||
</TableCell>
|
||||
<TableCell className="text-center text-xs">
|
||||
{row.is_sold_out
|
||||
? t("riskCap.runtime.soldYes", { ns: "config" })
|
||||
: t("riskCap.runtime.soldNo", { ns: "config" })}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))
|
||||
)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{t("riskCap.runtime.manageHint", { ns: "config" })}
|
||||
</p>
|
||||
</>
|
||||
) : (
|
||||
<p className="text-sm text-muted-foreground">{t("riskCap.runtime.noDraws", { ns: "config" })}</p>
|
||||
)}
|
||||
</ConfigSection>
|
||||
);
|
||||
}
|
||||
@@ -12,7 +12,7 @@ const segments = [
|
||||
{ suffix: "/results", key: "results", label: "subnav.results" },
|
||||
{ suffix: "/finance", key: "finance", label: "subnav.finance" },
|
||||
{ suffix: "/review", key: "review", label: "subnav.review" },
|
||||
{ suffix: "/risk/occupancy", key: "riskOccupancy", label: "subnav.riskOccupancy" },
|
||||
{ suffix: "/risk/occupancy", key: "riskLockLogs", label: "subnav.riskLockLogs" },
|
||||
{ suffix: "/risk/hot", key: "riskHot", label: "subnav.riskHot" },
|
||||
{ suffix: "/risk/sold-out", key: "riskSoldOut", label: "subnav.riskSoldOut" },
|
||||
{ suffix: "/risk/pools", key: "riskPools", label: "subnav.riskPools" },
|
||||
|
||||
156
src/modules/reports/report-jobs-panel.tsx
Normal file
156
src/modules/reports/report-jobs-panel.tsx
Normal file
@@ -0,0 +1,156 @@
|
||||
"use client";
|
||||
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { toast } from "sonner";
|
||||
import { Download, RefreshCw } from "lucide-react";
|
||||
|
||||
import { downloadAdminReportJob, getAdminReportJobs } from "@/api/admin-report-jobs";
|
||||
import { AdminStatusBadge } from "@/components/admin/admin-status-badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
import { useAdminDateTimeFormatter } from "@/hooks/use-admin-datetime-formatter";
|
||||
import { LotteryApiBizError } from "@/types/api/errors";
|
||||
import type { AdminReportJobRow } from "@/types/api/admin-report-jobs";
|
||||
|
||||
function downloadBlob(blob: Blob, filename: string): void {
|
||||
const url = URL.createObjectURL(blob);
|
||||
const anchor = document.createElement("a");
|
||||
anchor.href = url;
|
||||
anchor.download = filename;
|
||||
document.body.appendChild(anchor);
|
||||
anchor.click();
|
||||
anchor.remove();
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
type ReportJobsPanelProps = {
|
||||
canExport: boolean;
|
||||
refreshToken?: number;
|
||||
};
|
||||
|
||||
export function ReportJobsPanel({ canExport, refreshToken = 0 }: ReportJobsPanelProps) {
|
||||
const { t } = useTranslation(["reports", "common"]);
|
||||
const formatTs = useAdminDateTimeFormatter();
|
||||
const [jobs, setJobs] = useState<AdminReportJobRow[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [downloadingId, setDownloadingId] = useState<number | null>(null);
|
||||
|
||||
const loadJobs = useCallback(async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await getAdminReportJobs({ page: 1, per_page: 10 });
|
||||
setJobs(data.items);
|
||||
} catch (e) {
|
||||
toast.error(e instanceof LotteryApiBizError ? e.message : t("tasks.loadFailed"));
|
||||
setJobs([]);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, [t]);
|
||||
|
||||
useEffect(() => {
|
||||
void loadJobs();
|
||||
}, [loadJobs, refreshToken]);
|
||||
|
||||
async function handleDownload(job: AdminReportJobRow): Promise<void> {
|
||||
if (!canExport || job.status !== "completed") {
|
||||
return;
|
||||
}
|
||||
setDownloadingId(job.id);
|
||||
try {
|
||||
const { blob, filename } = await downloadAdminReportJob(job.id);
|
||||
const fallback = `${job.job_no}.${job.export_format}`;
|
||||
downloadBlob(blob, filename ?? fallback);
|
||||
toast.success(t("tasks.downloadSuccess", { jobNo: job.job_no }));
|
||||
} catch (e) {
|
||||
toast.error(e instanceof LotteryApiBizError ? e.message : t("tasks.downloadFailed"));
|
||||
} finally {
|
||||
setDownloadingId(null);
|
||||
}
|
||||
}
|
||||
|
||||
function reportTypeLabel(reportType: string): string {
|
||||
const key = `jobTypes.${reportType}`;
|
||||
const label = t(key);
|
||||
return label === key ? reportType : label;
|
||||
}
|
||||
|
||||
return (
|
||||
<Card className="admin-list-card">
|
||||
<CardHeader className="admin-list-header flex flex-row items-center justify-between gap-3 pb-4">
|
||||
<CardTitle className="admin-list-title">{t("recentTasks")}</CardTitle>
|
||||
<Button type="button" variant="outline" size="sm" disabled={loading} onClick={() => void loadJobs()}>
|
||||
<RefreshCw data-icon="inline-start" className={loading ? "animate-spin" : undefined} />
|
||||
{t("tasks.refresh")}
|
||||
</Button>
|
||||
</CardHeader>
|
||||
<CardContent className="pt-2">
|
||||
<p className="mb-3 text-xs text-muted-foreground">{t("exportHint")}</p>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>{t("tasks.columns.jobNo")}</TableHead>
|
||||
<TableHead>{t("tasks.columns.report")}</TableHead>
|
||||
<TableHead>{t("tasks.columns.format")}</TableHead>
|
||||
<TableHead>{t("tasks.columns.status")}</TableHead>
|
||||
<TableHead>{t("tasks.columns.createdAt")}</TableHead>
|
||||
<TableHead>{t("tasks.columns.actions")}</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{loading ? (
|
||||
<TableRow>
|
||||
<TableCell colSpan={6} className="text-muted-foreground">
|
||||
{t("states.loading", { ns: "common" })}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
) : jobs.length === 0 ? (
|
||||
<TableRow>
|
||||
<TableCell colSpan={6} className="text-muted-foreground">
|
||||
{t("taskEmpty")}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
) : (
|
||||
jobs.map((job) => (
|
||||
<TableRow key={job.id}>
|
||||
<TableCell className="font-mono text-xs">{job.job_no}</TableCell>
|
||||
<TableCell className="text-sm">{reportTypeLabel(job.report_type)}</TableCell>
|
||||
<TableCell className="uppercase">{job.export_format}</TableCell>
|
||||
<TableCell>
|
||||
<AdminStatusBadge status={job.status}>
|
||||
{t(`tasks.status.${job.status}`, { defaultValue: job.status })}
|
||||
</AdminStatusBadge>
|
||||
</TableCell>
|
||||
<TableCell className="text-xs text-muted-foreground">
|
||||
{formatTs(job.created_at ?? job.finished_at)}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
disabled={!canExport || job.status !== "completed" || downloadingId === job.id}
|
||||
onClick={() => void handleDownload(job)}
|
||||
>
|
||||
<Download data-icon="inline-start" />
|
||||
{t("tasks.download")}
|
||||
</Button>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))
|
||||
)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
@@ -29,12 +29,20 @@ import {
|
||||
} from "@/lib/admin-play-types";
|
||||
import { getAdminDraws, getAdminDrawFinanceSummary } from "@/api/admin-draws";
|
||||
import { getAdminPlayers } from "@/api/admin-player";
|
||||
import { downloadAdminReportJob, postAdminReportJob } from "@/api/admin-report-jobs";
|
||||
import {
|
||||
getAdminReportDailyProfit,
|
||||
getAdminReportPlayDimension,
|
||||
getAdminReportPlayerWinLoss,
|
||||
getAdminReportRebateCommission,
|
||||
} from "@/api/admin-reports";
|
||||
import {
|
||||
buildReportJobParameters,
|
||||
REPORT_UI_SERVER_FULL_EXPORT,
|
||||
REPORT_UI_TO_JOB_TYPE,
|
||||
type ReportUiKey,
|
||||
} from "@/lib/report-export-map";
|
||||
import { ReportJobsPanel } from "@/modules/reports/report-jobs-panel";
|
||||
import { getAdminRiskPoolDetail, getAdminRiskPools } from "@/api/admin-risk";
|
||||
import { getAdminUsers } from "@/api/admin-users";
|
||||
import { getAdminTransferOrders } from "@/api/admin-wallet";
|
||||
@@ -387,6 +395,7 @@ export function ReportsConsole() {
|
||||
const [page, setPage] = useState(1);
|
||||
const [perPage, setPerPage] = useState(20);
|
||||
const [exporting, setExporting] = useState<ExportFormat | null>(null);
|
||||
const [jobRefreshToken, setJobRefreshToken] = useState(0);
|
||||
const [search, setSearch] = useState<SearchState>(emptySearch);
|
||||
const [playOptions, setPlayOptions] = useState<PlayOption[]>([]);
|
||||
|
||||
@@ -778,10 +787,55 @@ export function ReportsConsole() {
|
||||
setPage(1);
|
||||
}
|
||||
|
||||
const usesServerExport = REPORT_UI_SERVER_FULL_EXPORT.has(selectedReport.key as ReportUiKey);
|
||||
|
||||
async function exportViaServer(format: ExportFormat): Promise<void> {
|
||||
if (!canExportReports) {
|
||||
return;
|
||||
}
|
||||
setExporting(format);
|
||||
try {
|
||||
const parameters = buildReportJobParameters(selectedReport.key as ReportUiKey, {
|
||||
dateFrom: filters.dateFrom,
|
||||
dateTo: filters.dateTo,
|
||||
playerId: filters.playerId,
|
||||
play: filters.play,
|
||||
operatorId: filters.operatorId,
|
||||
drawId: filters.drawId,
|
||||
drawNo: filters.drawNo,
|
||||
number: filters.number,
|
||||
});
|
||||
const job = await postAdminReportJob({
|
||||
report_type: REPORT_UI_TO_JOB_TYPE[selectedReport.key as ReportUiKey],
|
||||
export_format: format === "excel" ? "xlsx" : "csv",
|
||||
parameters,
|
||||
});
|
||||
setJobRefreshToken((n) => n + 1);
|
||||
const { blob, filename } = await downloadAdminReportJob(job.id);
|
||||
const ext = job.export_format === "xlsx" ? "xlsx" : "csv";
|
||||
downloadBlob(blob, filename ?? `${exportFileBase}.${ext}`);
|
||||
toast.success(
|
||||
t("exportServerSuccess", {
|
||||
report: t(`items.${selectedReport.key}.title`),
|
||||
format: t(`formats.${format}`),
|
||||
jobNo: job.job_no,
|
||||
}),
|
||||
);
|
||||
} catch (err) {
|
||||
toast.error(err instanceof LotteryApiBizError ? err.message : t("exportFailed"));
|
||||
} finally {
|
||||
setExporting(null);
|
||||
}
|
||||
}
|
||||
|
||||
function exportReport(format: ExportFormat): void {
|
||||
if (!canExportReports) {
|
||||
return;
|
||||
}
|
||||
if (usesServerExport) {
|
||||
void exportViaServer(format);
|
||||
return;
|
||||
}
|
||||
if (!result || result.rows.length === 0) {
|
||||
toast.info(t("empty"));
|
||||
return;
|
||||
@@ -1273,24 +1327,39 @@ export function ReportsConsole() {
|
||||
<div>
|
||||
<CardTitle className="admin-list-title">{t("preview.title")}</CardTitle>
|
||||
</div>
|
||||
<div className="flex shrink-0 gap-2">
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
disabled={!canExportReports || !result || exporting !== null}
|
||||
onClick={() => exportReport("csv")}
|
||||
>
|
||||
<FileDown data-icon="inline-start" />
|
||||
{t("formats.csv")}
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
disabled={!canExportReports || !result || exporting !== null}
|
||||
onClick={() => exportReport("excel")}
|
||||
>
|
||||
<FileSpreadsheet data-icon="inline-start" />
|
||||
{t("formats.excel")}
|
||||
</Button>
|
||||
<div className="flex flex-col items-end gap-2 sm:flex-row sm:items-center">
|
||||
{usesServerExport ? (
|
||||
<p className="text-xs text-muted-foreground sm:mr-2">{t("exportServerHint")}</p>
|
||||
) : (
|
||||
<p className="text-xs text-muted-foreground sm:mr-2">{t("exportClientHint")}</p>
|
||||
)}
|
||||
<div className="flex shrink-0 gap-2">
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
disabled={
|
||||
!canExportReports ||
|
||||
exporting !== null ||
|
||||
(!usesServerExport && (!result || result.rows.length === 0))
|
||||
}
|
||||
onClick={() => exportReport("csv")}
|
||||
>
|
||||
<FileDown data-icon="inline-start" />
|
||||
{usesServerExport ? t("formats.csvServer") : t("formats.csv")}
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
disabled={
|
||||
!canExportReports ||
|
||||
exporting !== null ||
|
||||
(!usesServerExport && (!result || result.rows.length === 0))
|
||||
}
|
||||
onClick={() => exportReport("excel")}
|
||||
>
|
||||
<FileSpreadsheet data-icon="inline-start" />
|
||||
{usesServerExport ? t("formats.excelServer") : t("formats.excel")}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4 pt-4">
|
||||
@@ -1329,6 +1398,8 @@ export function ReportsConsole() {
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ReportJobsPanel canExport={canExportReports} refreshToken={jobRefreshToken} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user