feat: add admin work visibility controls

This commit is contained in:
kdletters
2026-05-28 00:49:45 +08:00
parent 8e96c8a67c
commit dbbd48083a
38 changed files with 1807 additions and 89 deletions

View File

@@ -28,6 +28,7 @@ import {AdminRechargeProductPage} from '../pages/AdminRechargeProductPage';
import {AdminRedeemCodePage} from '../pages/AdminRedeemCodePage';
import {AdminTaskConfigPage} from '../pages/AdminTaskConfigPage';
import {AdminTrackingEventsPage} from '../pages/AdminTrackingEventsPage';
import {AdminWorkVisibilityPage} from '../pages/AdminWorkVisibilityPage';
import {AdminShell} from './AdminShell';
import type {AdminRouteId} from './adminRoutes';
import {resolveAdminRoute, routeHash} from './adminRoutes';
@@ -205,6 +206,12 @@ export function AdminApp() {
onUnauthorized={handleUnauthorized}
/>
) : null}
{routeId === 'work-visibility' ? (
<AdminWorkVisibilityPage
token={token}
onUnauthorized={handleUnauthorized}
/>
) : null}
{routeId === 'tasks' ? (
<AdminTaskConfigPage
result={taskConfigResult}

View File

@@ -3,6 +3,7 @@ import {
BadgeDollarSign,
LayoutDashboard,
LogOut,
Eye,
ShieldCheck,
ListChecks,
SlidersHorizontal,
@@ -35,6 +36,7 @@ const routeIcons = {
tasks: ListChecks,
'recharge-products': BadgeDollarSign,
'creation-entry': SlidersHorizontal,
'work-visibility': Eye,
} satisfies Record<AdminRouteId, typeof LayoutDashboard>;
export function AdminShell({

View File

@@ -7,7 +7,8 @@ export type AdminRouteId =
| 'invite'
| 'tasks'
| 'recharge-products'
| 'creation-entry';
| 'creation-entry'
| 'work-visibility';
export interface AdminRouteDefinition {
id: AdminRouteId;
@@ -25,6 +26,7 @@ export const adminRoutes: AdminRouteDefinition[] = [
{id: 'tasks', label: '任务配置', hash: '#tasks'},
{id: 'recharge-products', label: '充值商品', hash: '#recharge-products'},
{id: 'creation-entry', label: '入口开关', hash: '#creation-entry'},
{id: 'work-visibility', label: '作品可见性', hash: '#work-visibility'},
];
export function resolveAdminRoute(hash: string): AdminRouteId {