diff --git a/ui/dev-dist/sw.js b/ui/dev-dist/sw.js index 2849fdfe..d9e48480 100644 --- a/ui/dev-dist/sw.js +++ b/ui/dev-dist/sw.js @@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "index.html", - "revision": "0.ettrttb2g3" + "revision": "0.0ii4qr2m5co" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { diff --git a/ui/src/routes/dynamicRouteLoader.tsx b/ui/src/routes/dynamicRouteLoader.tsx index f2446f00..baf48f1a 100644 --- a/ui/src/routes/dynamicRouteLoader.tsx +++ b/ui/src/routes/dynamicRouteLoader.tsx @@ -2,7 +2,8 @@ import { RouteDto } from '@/proxy/routes/models' import { lazy } from 'react' // Tüm view bileşenlerini import et (vite özel) -const modules = import.meta.glob('../views/**/*.tsx') +// shared klasörü hariç, çünkü bu bileşenler genellikle başka yerlerde statik import ediliyor +const modules = import.meta.glob(['../views/**/*.tsx', '!../views/shared/**/*.tsx']) const lazyComponentCache = new Map>>() diff --git a/ui/src/routes/dynamicRouter.tsx b/ui/src/routes/dynamicRouter.tsx index 5a761a98..8cb2eca7 100644 --- a/ui/src/routes/dynamicRouter.tsx +++ b/ui/src/routes/dynamicRouter.tsx @@ -1,8 +1,7 @@ import React, { useMemo } from 'react' import { Routes, Route, Navigate } from 'react-router-dom' -import { mapDynamicRoutes } from './dynamicRouteLoader' +import { mapDynamicRoutes, loadComponent } from './dynamicRouteLoader' import { useDynamicRoutes } from './dynamicRoutesContext' -import NotFound from '@/views/NotFound' import ProtectedRoute from '@/components/route/ProtectedRoute' import PermissionGuard from '@/components/route/PermissionGuard' import PageContainer from '@/components/template/PageContainer' @@ -13,6 +12,7 @@ export const DynamicRouter: React.FC = () => { const { routes, loading, error } = useDynamicRoutes() const dynamicRoutes = useMemo(() => mapDynamicRoutes(routes), [routes]) + const NotFoundComponent = useMemo(() => loadComponent('views/NotFound'), []) if (loading) return
Loading...
if (error) return
Hata: {error}
@@ -75,7 +75,13 @@ export const DynamicRouter: React.FC = () => { : + hasSubdomain() ? ( + + ) : ( + Loading...}> + + + ) } /> diff --git a/ui/src/views/NotFound.tsx b/ui/src/views/NotFound.tsx index 53313de0..a121b692 100644 --- a/ui/src/views/NotFound.tsx +++ b/ui/src/views/NotFound.tsx @@ -1,5 +1,4 @@ import { ROUTES_ENUM } from '@/routes/route.constant' -import React from 'react' import { useNavigate } from 'react-router-dom' const NotFoundPage = () => {