analysis WiP

This commit is contained in:
2026-05-23 20:07:14 +05:30
parent 0bb486223e
commit 9bb0af59b0
11 changed files with 1031 additions and 5 deletions
+13 -1
View File
@@ -6,7 +6,8 @@ export type AdminDashboardTab =
| "players"
| "matches"
| "matchmaker"
| "ledger";
| "ledger"
| "analysis";
export type DashboardUrlQuery = {
tab: AdminDashboardTab;
@@ -26,6 +27,11 @@ export type DashboardUrlQuery = {
ledgerPageSize?: number | null;
ledgerSort?: string | null;
ledgerOrder?: "asc" | "desc" | null;
/** Analysis tab: UTC date-only bounds (`afrom` / `ato`). */
analysisFrom?: string | null;
analysisTo?: string | null;
/** Analysis tab: comma-separated player ids (`aplayers`). */
analysisPlayers?: string | null;
};
/** Build `/?…` for dashboard tabs, filters, and optional edit / error flags. */
@@ -35,6 +41,7 @@ export function buildDashboardHref(q: DashboardUrlQuery): string {
else if (q.tab === "players") p.set("tab", "players");
else if (q.tab === "matchmaker") p.set("tab", "matchmaker");
else if (q.tab === "ledger") p.set("tab", "ledger");
else if (q.tab === "analysis") p.set("tab", "analysis");
if (q.highlightId) p.set("highlight", q.highlightId);
if (q.participantRaw) p.set("participant", q.participantRaw);
if (q.tab === "matchmaker" && q.matchmakerSource === "raw") {
@@ -60,6 +67,11 @@ export function buildDashboardHref(q: DashboardUrlQuery): string {
p.set("lsize", String(Math.trunc(q.ledgerPageSize)));
}
}
if (q.tab === "analysis") {
if (q.analysisFrom) p.set("afrom", q.analysisFrom);
if (q.analysisTo) p.set("ato", q.analysisTo);
if (q.analysisPlayers) p.set("aplayers", q.analysisPlayers);
}
if (q.editId != null && Number.isFinite(q.editId)) {
p.set("edit", String(q.editId));
}