mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 03:26:37 +08:00
bd41ab3fb4
- 新增 /queue 任务队列页:全部 / 刮削 / 下载 / 上传 类型 Tab(URL 参数 ?type= 同步),Tab 上实时显示各自任务计数徽章 - 「全部」视图纵向堆叠三类队列,单类视图直接复用原队列组件 (ScraperQueuePage / StrmQueuePanel,后者已导出) - 侧边栏导航:删除「刮削队列 / 下载队列 / 上传队列」三个入口,合并为 「任务队列」单一菜单项;旧路由 /scraper/queue、/strm/downloads、 /strm/uploads 保留直达
73 lines
4.2 KiB
TypeScript
73 lines
4.2 KiB
TypeScript
/* eslint-disable react-refresh/only-export-components */
|
|
import { lazy, type ReactElement } from 'react'
|
|
import { Navigate } from 'react-router-dom'
|
|
|
|
const HomePage = lazy(() => import('./pages/HomePage').then((m) => ({ default: m.HomePage })))
|
|
const LibraryPage = lazy(() => import('./pages/LibraryPage').then((m) => ({ default: m.LibraryPage })))
|
|
const LibrariesPage = lazy(() => import('./pages/LibrariesPage').then((m) => ({ default: m.LibrariesPage })))
|
|
const FavouritesPage = lazy(() => import('./pages/FavouritesPage').then((m) => ({ default: m.FavouritesPage })))
|
|
const PlaylistsPage = lazy(() => import('./pages/PlaylistsPage').then((m) => ({ default: m.PlaylistsPage })))
|
|
const PlaylistDetailPage = lazy(() =>
|
|
import('./pages/PlaylistDetailPage').then((m) => ({ default: m.PlaylistDetailPage })),
|
|
)
|
|
const MediaDetailPage = lazy(() => import('./pages/MediaDetailPage').then((m) => ({ default: m.MediaDetailPage })))
|
|
const PlayerPage = lazy(() => import('./pages/PlayerPage').then((m) => ({ default: m.PlayerPage })))
|
|
const AdminPage = lazy(() => import('./pages/AdminPage').then((m) => ({ default: m.AdminPage })))
|
|
const ProfilePage = lazy(() => import('./pages/ProfilePage').then((m) => ({ default: m.ProfilePage })))
|
|
const DlnaPage = lazy(() => import('./pages/DlnaPage').then((m) => ({ default: m.DlnaPage })))
|
|
const FileManagerPage = lazy(() =>
|
|
import('./pages/FileManagerPage').then((m) => ({ default: m.FileManagerPage })),
|
|
)
|
|
const WatchHistoryPage = lazy(() =>
|
|
import('./pages/WatchHistoryPage').then((m) => ({ default: m.WatchHistoryPage })),
|
|
)
|
|
const PosterWallPage = lazy(() => import('./pages/PosterWallPage').then((m) => ({ default: m.PosterWallPage })))
|
|
const ProfileManagementPage = lazy(() =>
|
|
import('./pages/ProfileManagementPage').then((m) => ({ default: m.ProfileManagementPage })),
|
|
)
|
|
const SettingsPage = lazy(() => import('./pages/SettingsPage').then((m) => ({ default: m.SettingsPage })))
|
|
const EmbyMountPage = lazy(() => import('./pages/EmbyMountPage').then((m) => ({ default: m.EmbyMountPage })))
|
|
const StrmManagePage = lazy(() => import('./pages/StrmManagePage').then((m) => ({ default: m.StrmManagePage })))
|
|
const StrmDownloadQueuePage = lazy(() =>
|
|
import('./pages/StrmQueuePage').then((m) => ({ default: m.StrmDownloadQueuePage })),
|
|
)
|
|
const StrmUploadQueuePage = lazy(() =>
|
|
import('./pages/StrmQueuePage').then((m) => ({ default: m.StrmUploadQueuePage })),
|
|
)
|
|
const ScraperQueuePage = lazy(() => import('./pages/ScraperQueuePage').then((m) => ({ default: m.ScraperQueuePage })))
|
|
const TaskQueuePage = lazy(() => import('./pages/TaskQueuePage').then((m) => ({ default: m.TaskQueuePage })))
|
|
|
|
export type AppRoute = {
|
|
path?: string
|
|
index?: boolean
|
|
element: ReactElement
|
|
adminOnly?: boolean
|
|
}
|
|
|
|
export const appRoutes: AppRoute[] = [
|
|
{ index: true, element: <HomePage /> },
|
|
{ path: 'libraries', element: <LibrariesPage /> },
|
|
{ path: 'library/:id', element: <LibraryPage /> },
|
|
{ path: 'favourites', element: <FavouritesPage /> },
|
|
{ path: 'playlists', element: <PlaylistsPage /> },
|
|
{ path: 'playlist/:id', element: <PlaylistDetailPage /> },
|
|
{ path: 'media/:id', element: <MediaDetailPage /> },
|
|
{ path: 'play/:id', element: <PlayerPage /> },
|
|
{ path: 'profile', element: <ProfilePage /> },
|
|
{ path: 'dlna', element: <DlnaPage /> },
|
|
{ path: 'history', element: <WatchHistoryPage /> },
|
|
{ path: 'poster-wall', element: <PosterWallPage /> },
|
|
{ path: 'play-profiles', element: <ProfileManagementPage /> },
|
|
{ path: 'api-configs', element: <Navigate to="/settings?group=api-configs" replace /> },
|
|
{ path: 'tools', element: <Navigate to="/files" replace /> },
|
|
{ path: 'files', element: <FileManagerPage />, adminOnly: true },
|
|
{ path: 'settings', element: <SettingsPage />, adminOnly: true },
|
|
{ path: 'emby-mount', element: <EmbyMountPage />, adminOnly: true },
|
|
{ path: 'strm', element: <StrmManagePage />, adminOnly: true },
|
|
{ path: 'strm/downloads', element: <StrmDownloadQueuePage />, adminOnly: true },
|
|
{ path: 'strm/uploads', element: <StrmUploadQueuePage />, adminOnly: true },
|
|
{ path: 'scraper/queue', element: <ScraperQueuePage />, adminOnly: true },
|
|
{ path: 'queue', element: <TaskQueuePage />, adminOnly: true },
|
|
{ path: 'admin', element: <AdminPage />, adminOnly: true },
|
|
]
|