feat: add admin creation entry switches
Some checks failed
CI / verify (pull_request) Has been cancelled

This commit is contained in:
2026-05-11 12:02:39 +08:00
parent d23cf3807d
commit 0461c0ee41
18 changed files with 745 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ import {
getStoredAdminToken,
setStoredAdminToken,
} from '../auth/adminAuthStore';
import {AdminCreationEntrySwitchPage} from '../pages/AdminCreationEntrySwitchPage';
import {AdminDebugHttpPage} from '../pages/AdminDebugHttpPage';
import {AdminDatabaseTablesPage} from '../pages/AdminDatabaseTablesPage';
import {AdminInviteCodePage} from '../pages/AdminInviteCodePage';
@@ -192,6 +193,12 @@ export function AdminApp() {
onResultChange={setInviteResult}
/>
) : null}
{routeId === 'creation-entry' ? (
<AdminCreationEntrySwitchPage
token={token}
onUnauthorized={handleUnauthorized}
/>
) : null}
{routeId === 'tasks' ? (
<AdminTaskConfigPage
result={taskConfigResult}

View File

@@ -4,6 +4,7 @@ import {
LogOut,
ShieldCheck,
ListChecks,
SlidersHorizontal,
Database,
Table2,
TicketCheck,
@@ -31,6 +32,7 @@ const routeIcons = {
redeem: TicketPercent,
invite: TicketCheck,
tasks: ListChecks,
'creation-entry': SlidersHorizontal,
} satisfies Record<AdminRouteId, typeof LayoutDashboard>;
export function AdminShell({

View File

@@ -5,7 +5,8 @@ export type AdminRouteId =
| 'tracking'
| 'redeem'
| 'invite'
| 'tasks';
| 'tasks'
| 'creation-entry';
export interface AdminRouteDefinition {
id: AdminRouteId;
@@ -21,6 +22,7 @@ export const adminRoutes: AdminRouteDefinition[] = [
{id: 'redeem', label: '兑换码', hash: '#redeem'},
{id: 'invite', label: '邀请码', hash: '#invite'},
{id: 'tasks', label: '任务配置', hash: '#tasks'},
{id: 'creation-entry', label: '入口开关', hash: '#creation-entry'},
];
export function resolveAdminRoute(hash: string): AdminRouteId {