Add media and channel management routes: introduce new routes for admin channels, media, and shows in the routing structure. Update navigation in the admin layout to include links for these new sections. Enhance type definitions for media assets and shows in the API types. Integrate HLS.js for improved streaming support.
This commit is contained in:
@@ -16,8 +16,13 @@ import { Route as LoginRouteImport } from './routes/login'
|
||||
import { Route as RegisterRouteImport } from './routes/register'
|
||||
import { Route as SettingsRouteImport } from './routes/settings'
|
||||
import { Route as AdminIndexRouteImport } from './routes/admin/index'
|
||||
import { Route as AdminChannelsRouteImport } from './routes/admin/channels'
|
||||
import { Route as AdminMediaRouteImport } from './routes/admin/media'
|
||||
import { Route as AdminRolesRouteImport } from './routes/admin/roles'
|
||||
import { Route as AdminShowsRouteImport } from './routes/admin/shows'
|
||||
import { Route as AdminUsersRouteImport } from './routes/admin/users'
|
||||
import { Route as AdminChannelsChannelIdRouteImport } from './routes/admin/channels.$channelId'
|
||||
import { Route as AdminShowsShowIdRouteImport } from './routes/admin/shows.$showId'
|
||||
|
||||
const IndexRoute = IndexRouteImport.update({
|
||||
id: '/',
|
||||
@@ -54,16 +59,41 @@ const AdminIndexRoute = AdminIndexRouteImport.update({
|
||||
path: '/',
|
||||
getParentRoute: () => AdminRoute,
|
||||
} as any)
|
||||
const AdminChannelsRoute = AdminChannelsRouteImport.update({
|
||||
id: '/channels',
|
||||
path: '/channels',
|
||||
getParentRoute: () => AdminRoute,
|
||||
} as any)
|
||||
const AdminMediaRoute = AdminMediaRouteImport.update({
|
||||
id: '/media',
|
||||
path: '/media',
|
||||
getParentRoute: () => AdminRoute,
|
||||
} as any)
|
||||
const AdminRolesRoute = AdminRolesRouteImport.update({
|
||||
id: '/roles',
|
||||
path: '/roles',
|
||||
getParentRoute: () => AdminRoute,
|
||||
} as any)
|
||||
const AdminShowsRoute = AdminShowsRouteImport.update({
|
||||
id: '/shows',
|
||||
path: '/shows',
|
||||
getParentRoute: () => AdminRoute,
|
||||
} as any)
|
||||
const AdminUsersRoute = AdminUsersRouteImport.update({
|
||||
id: '/users',
|
||||
path: '/users',
|
||||
getParentRoute: () => AdminRoute,
|
||||
} as any)
|
||||
const AdminChannelsChannelIdRoute = AdminChannelsChannelIdRouteImport.update({
|
||||
id: '/$channelId',
|
||||
path: '/$channelId',
|
||||
getParentRoute: () => AdminChannelsRoute,
|
||||
} as any)
|
||||
const AdminShowsShowIdRoute = AdminShowsShowIdRouteImport.update({
|
||||
id: '/$showId',
|
||||
path: '/$showId',
|
||||
getParentRoute: () => AdminShowsRoute,
|
||||
} as any)
|
||||
|
||||
export interface FileRoutesByFullPath {
|
||||
'/': typeof IndexRoute
|
||||
@@ -72,9 +102,14 @@ export interface FileRoutesByFullPath {
|
||||
'/login': typeof LoginRoute
|
||||
'/register': typeof RegisterRoute
|
||||
'/settings': typeof SettingsRoute
|
||||
'/admin/channels': typeof AdminChannelsRouteWithChildren
|
||||
'/admin/media': typeof AdminMediaRoute
|
||||
'/admin/roles': typeof AdminRolesRoute
|
||||
'/admin/shows': typeof AdminShowsRouteWithChildren
|
||||
'/admin/users': typeof AdminUsersRoute
|
||||
'/admin/': typeof AdminIndexRoute
|
||||
'/admin/channels/$channelId': typeof AdminChannelsChannelIdRoute
|
||||
'/admin/shows/$showId': typeof AdminShowsShowIdRoute
|
||||
}
|
||||
export interface FileRoutesByTo {
|
||||
'/': typeof IndexRoute
|
||||
@@ -82,9 +117,14 @@ export interface FileRoutesByTo {
|
||||
'/login': typeof LoginRoute
|
||||
'/register': typeof RegisterRoute
|
||||
'/settings': typeof SettingsRoute
|
||||
'/admin/channels': typeof AdminChannelsRouteWithChildren
|
||||
'/admin/media': typeof AdminMediaRoute
|
||||
'/admin/roles': typeof AdminRolesRoute
|
||||
'/admin/shows': typeof AdminShowsRouteWithChildren
|
||||
'/admin/users': typeof AdminUsersRoute
|
||||
'/admin': typeof AdminIndexRoute
|
||||
'/admin/channels/$channelId': typeof AdminChannelsChannelIdRoute
|
||||
'/admin/shows/$showId': typeof AdminShowsShowIdRoute
|
||||
}
|
||||
export interface FileRoutesById {
|
||||
__root__: typeof rootRouteImport
|
||||
@@ -94,9 +134,14 @@ export interface FileRoutesById {
|
||||
'/login': typeof LoginRoute
|
||||
'/register': typeof RegisterRoute
|
||||
'/settings': typeof SettingsRoute
|
||||
'/admin/channels': typeof AdminChannelsRouteWithChildren
|
||||
'/admin/media': typeof AdminMediaRoute
|
||||
'/admin/roles': typeof AdminRolesRoute
|
||||
'/admin/shows': typeof AdminShowsRouteWithChildren
|
||||
'/admin/users': typeof AdminUsersRoute
|
||||
'/admin/': typeof AdminIndexRoute
|
||||
'/admin/channels/$channelId': typeof AdminChannelsChannelIdRoute
|
||||
'/admin/shows/$showId': typeof AdminShowsShowIdRoute
|
||||
}
|
||||
export interface FileRouteTypes {
|
||||
fileRoutesByFullPath: FileRoutesByFullPath
|
||||
@@ -107,9 +152,14 @@ export interface FileRouteTypes {
|
||||
| '/login'
|
||||
| '/register'
|
||||
| '/settings'
|
||||
| '/admin/channels'
|
||||
| '/admin/media'
|
||||
| '/admin/roles'
|
||||
| '/admin/shows'
|
||||
| '/admin/users'
|
||||
| '/admin/'
|
||||
| '/admin/channels/$channelId'
|
||||
| '/admin/shows/$showId'
|
||||
fileRoutesByTo: FileRoutesByTo
|
||||
to:
|
||||
| '/'
|
||||
@@ -117,9 +167,14 @@ export interface FileRouteTypes {
|
||||
| '/login'
|
||||
| '/register'
|
||||
| '/settings'
|
||||
| '/admin/channels'
|
||||
| '/admin/media'
|
||||
| '/admin/roles'
|
||||
| '/admin/shows'
|
||||
| '/admin/users'
|
||||
| '/admin'
|
||||
| '/admin/channels/$channelId'
|
||||
| '/admin/shows/$showId'
|
||||
id:
|
||||
| '__root__'
|
||||
| '/'
|
||||
@@ -128,9 +183,14 @@ export interface FileRouteTypes {
|
||||
| '/login'
|
||||
| '/register'
|
||||
| '/settings'
|
||||
| '/admin/channels'
|
||||
| '/admin/media'
|
||||
| '/admin/roles'
|
||||
| '/admin/shows'
|
||||
| '/admin/users'
|
||||
| '/admin/'
|
||||
| '/admin/channels/$channelId'
|
||||
| '/admin/shows/$showId'
|
||||
fileRoutesById: FileRoutesById
|
||||
}
|
||||
export interface RootRouteChildren {
|
||||
@@ -193,6 +253,20 @@ declare module '@tanstack/react-router' {
|
||||
preLoaderRoute: typeof AdminIndexRouteImport
|
||||
parentRoute: typeof AdminRoute
|
||||
}
|
||||
'/admin/channels': {
|
||||
id: '/admin/channels'
|
||||
path: '/channels'
|
||||
fullPath: '/admin/channels'
|
||||
preLoaderRoute: typeof AdminChannelsRouteImport
|
||||
parentRoute: typeof AdminRoute
|
||||
}
|
||||
'/admin/media': {
|
||||
id: '/admin/media'
|
||||
path: '/media'
|
||||
fullPath: '/admin/media'
|
||||
preLoaderRoute: typeof AdminMediaRouteImport
|
||||
parentRoute: typeof AdminRoute
|
||||
}
|
||||
'/admin/roles': {
|
||||
id: '/admin/roles'
|
||||
path: '/roles'
|
||||
@@ -200,6 +274,13 @@ declare module '@tanstack/react-router' {
|
||||
preLoaderRoute: typeof AdminRolesRouteImport
|
||||
parentRoute: typeof AdminRoute
|
||||
}
|
||||
'/admin/shows': {
|
||||
id: '/admin/shows'
|
||||
path: '/shows'
|
||||
fullPath: '/admin/shows'
|
||||
preLoaderRoute: typeof AdminShowsRouteImport
|
||||
parentRoute: typeof AdminRoute
|
||||
}
|
||||
'/admin/users': {
|
||||
id: '/admin/users'
|
||||
path: '/users'
|
||||
@@ -207,17 +288,61 @@ declare module '@tanstack/react-router' {
|
||||
preLoaderRoute: typeof AdminUsersRouteImport
|
||||
parentRoute: typeof AdminRoute
|
||||
}
|
||||
'/admin/channels/$channelId': {
|
||||
id: '/admin/channels/$channelId'
|
||||
path: '/$channelId'
|
||||
fullPath: '/admin/channels/$channelId'
|
||||
preLoaderRoute: typeof AdminChannelsChannelIdRouteImport
|
||||
parentRoute: typeof AdminChannelsRoute
|
||||
}
|
||||
'/admin/shows/$showId': {
|
||||
id: '/admin/shows/$showId'
|
||||
path: '/$showId'
|
||||
fullPath: '/admin/shows/$showId'
|
||||
preLoaderRoute: typeof AdminShowsShowIdRouteImport
|
||||
parentRoute: typeof AdminShowsRoute
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface AdminChannelsRouteChildren {
|
||||
AdminChannelsChannelIdRoute: typeof AdminChannelsChannelIdRoute
|
||||
}
|
||||
|
||||
const AdminChannelsRouteChildren: AdminChannelsRouteChildren = {
|
||||
AdminChannelsChannelIdRoute: AdminChannelsChannelIdRoute,
|
||||
}
|
||||
|
||||
const AdminChannelsRouteWithChildren = AdminChannelsRoute._addFileChildren(
|
||||
AdminChannelsRouteChildren,
|
||||
)
|
||||
|
||||
interface AdminShowsRouteChildren {
|
||||
AdminShowsShowIdRoute: typeof AdminShowsShowIdRoute
|
||||
}
|
||||
|
||||
const AdminShowsRouteChildren: AdminShowsRouteChildren = {
|
||||
AdminShowsShowIdRoute: AdminShowsShowIdRoute,
|
||||
}
|
||||
|
||||
const AdminShowsRouteWithChildren = AdminShowsRoute._addFileChildren(
|
||||
AdminShowsRouteChildren,
|
||||
)
|
||||
|
||||
interface AdminRouteChildren {
|
||||
AdminChannelsRoute: typeof AdminChannelsRouteWithChildren
|
||||
AdminMediaRoute: typeof AdminMediaRoute
|
||||
AdminRolesRoute: typeof AdminRolesRoute
|
||||
AdminShowsRoute: typeof AdminShowsRouteWithChildren
|
||||
AdminUsersRoute: typeof AdminUsersRoute
|
||||
AdminIndexRoute: typeof AdminIndexRoute
|
||||
}
|
||||
|
||||
const AdminRouteChildren: AdminRouteChildren = {
|
||||
AdminChannelsRoute: AdminChannelsRouteWithChildren,
|
||||
AdminMediaRoute: AdminMediaRoute,
|
||||
AdminRolesRoute: AdminRolesRoute,
|
||||
AdminShowsRoute: AdminShowsRouteWithChildren,
|
||||
AdminUsersRoute: AdminUsersRoute,
|
||||
AdminIndexRoute: AdminIndexRoute,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user