Complete DDS training workflow and delivery package
This commit is contained in:
parent
68dd83c7c2
commit
4c4b91064f
229 changed files with 11969 additions and 1024 deletions
|
|
@ -1,22 +1,30 @@
|
|||
import { lazy, Suspense } from "react";
|
||||
import { createBrowserRouter, Navigate } from "react-router-dom";
|
||||
|
||||
import { Call } from "@/pages/trainee/Call";
|
||||
import { Instructor } from "@/pages/instructor/Instructor";
|
||||
import { Dds } from "@/pages/dds/Dds";
|
||||
import { Admin } from "@/pages/admin/Admin";
|
||||
import { Profile } from "@/pages/profile/Profile";
|
||||
import { Groups } from "@/pages/groups/Groups";
|
||||
import { Wall } from "@/pages/wall/Wall";
|
||||
import { RequireAuth } from "@/features/auth/Login";
|
||||
import { DEMO_MODE } from "@/features/auth/useAuth";
|
||||
|
||||
const Call = lazy(() => import("@/pages/trainee/Call").then((module) => ({ default: module.Call })));
|
||||
const Instructor = lazy(() => import("@/pages/instructor/Instructor").then((module) => ({ default: module.Instructor })));
|
||||
const Dds = lazy(() => import("@/pages/dds/Dds").then((module) => ({ default: module.Dds })));
|
||||
const Admin = lazy(() => import("@/pages/admin/Admin").then((module) => ({ default: module.Admin })));
|
||||
const Profile = lazy(() => import("@/pages/profile/Profile").then((module) => ({ default: module.Profile })));
|
||||
const Groups = lazy(() => import("@/pages/groups/Groups").then((module) => ({ default: module.Groups })));
|
||||
const Wall = lazy(() => import("@/pages/wall/Wall").then((module) => ({ default: module.Wall })));
|
||||
const Phone = lazy(() => import("@/pages/phone/Phone").then((module) => ({ default: module.Phone })));
|
||||
const Materials = lazy(() => import("@/pages/materials/Materials").then((module) => ({ default: module.Materials })));
|
||||
|
||||
// Четыре интерфейса — одна SPA (docs/arch/FRONTEND.md).
|
||||
// session_id живёт в URL: /instructor?session=..., монитор открывают ссылкой.
|
||||
// Каждый экран за проверкой роли: курсант не открывает пульт даже по прямой
|
||||
// ссылке. Сервер проверяет то же самое на сокетах — здесь только чтобы человек
|
||||
// увидел понятное объяснение вместо пустого экрана (lct-23).
|
||||
const guarded = (screen: string, element: JSX.Element) => (
|
||||
<RequireAuth screen={screen}>{element}</RequireAuth>
|
||||
<RequireAuth screen={screen}>
|
||||
<Suspense fallback={<main className="page"><p>Загружаем рабочее место…</p></main>}>
|
||||
{element}
|
||||
</Suspense>
|
||||
</RequireAuth>
|
||||
);
|
||||
|
||||
export const router = createBrowserRouter([
|
||||
|
|
@ -27,5 +35,7 @@ export const router = createBrowserRouter([
|
|||
{ path: "/profile", element: guarded("/profile", <Profile />) },
|
||||
{ path: "/groups", element: guarded("/groups", <Groups />) },
|
||||
{ path: "/dds", element: guarded("/dds", <Dds />) },
|
||||
{ path: "/phone", element: guarded("/phone", <Phone />) },
|
||||
{ path: "/materials", element: guarded("/materials", <Materials />) },
|
||||
{ path: "/admin", element: guarded("/admin", <Admin />) },
|
||||
]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue