File tree 4 files changed +41
-21
lines changed
4 files changed +41
-21
lines changed Original file line number Diff line number Diff line change
1
+ import { Provider } from './components/ui/provider' ;
2
+ import { BrowserRouter , Route , Routes } from 'react-router-dom' ;
3
+ import Loading from './pages/Loading' ;
4
+ import { lazy , Suspense } from 'react' ;
5
+
6
+ const Home = lazy ( ( ) => import ( './pages/Home' ) ) ;
7
+ const StatusPage = lazy ( ( ) => import ( './pages/StatusPage' ) ) ;
8
+ const Error = lazy ( ( ) => import ( './pages/Error' ) ) ;
9
+
10
+ const App = ( ) => {
11
+ const hostname = window . location . hostname ;
12
+
13
+ return (
14
+ < Provider >
15
+ < Suspense fallback = { < Loading /> } >
16
+ < BrowserRouter future = { { v7_startTransition : true , v7_relativeSplatPath : true } } >
17
+ < Routes >
18
+ { hostname === "status.jomity.net" ? (
19
+ < >
20
+ < Route path = "/" element = { < StatusPage /> } />
21
+ < Route path = "*" element = { < Error /> } />
22
+ </ >
23
+ ) : (
24
+ < >
25
+ < Route path = "/" element = { < Home /> } />
26
+ < Route path = "/status" element = { < StatusPage /> } />
27
+ < Route path = "*" element = { < Error /> } />
28
+ </ >
29
+ ) }
30
+ </ Routes >
31
+ </ BrowserRouter >
32
+ </ Suspense >
33
+ </ Provider >
34
+ )
35
+ }
36
+
37
+ export default App ;
Original file line number Diff line number Diff line change 1
- import { Provider } from './components/ui/provider' ;
2
- import { lazy , StrictMode , Suspense } from 'react' ;
1
+ import { lazy , StrictMode } from 'react' ;
3
2
import { createRoot } from 'react-dom/client' ;
4
- import { BrowserRouter , Route , Routes } from 'react-router-dom' ;
5
- import Loading from './pages/Loading' ;
6
3
import './index.css' ;
7
4
import favicon from './images/favicon.ico' ;
8
-
9
- const Home = lazy ( ( ) => import ( './pages/Home' ) ) ;
10
- const StatusPage = lazy ( ( ) => import ( './pages/StatusPage' ) ) ;
11
- const Error = lazy ( ( ) => import ( './pages/Error' ) ) ;
5
+ import App from './App' ;
12
6
13
7
const link = document . createElement ( 'link' ) ;
14
8
link . rel = 'icon' ;
@@ -17,16 +11,6 @@ document.head.appendChild(link);
17
11
18
12
createRoot ( document . querySelector ( '#entry' ) ! ) . render (
19
13
< StrictMode >
20
- < Provider >
21
- < Suspense fallback = { < Loading /> } >
22
- < BrowserRouter future = { { v7_startTransition : true , v7_relativeSplatPath : true } } >
23
- < Routes >
24
- < Route path = "/" element = { < Home /> } />
25
- < Route path = "/status" element = { < StatusPage /> } />
26
- < Route path = "*" element = { < Error /> } />
27
- </ Routes >
28
- </ BrowserRouter >
29
- </ Suspense >
30
- </ Provider >
14
+ < App />
31
15
</ StrictMode >
32
16
)
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ const StatusPage = () => {
107
107
const process = processes . find ( ( r ) => r . name === p . key ) ;
108
108
109
109
if ( ! process ) {
110
- p . status = "unknown " ;
110
+ p . status = "disabled " ;
111
111
return p ;
112
112
}
113
113
Original file line number Diff line number Diff line change @@ -131,7 +131,6 @@ export class WebServer {
131
131
132
132
if ( err || ! stats . isFile ( ) ) {
133
133
serveFile ( res , join ( this . root , "index.html" ) , "text/html" ) ;
134
- return ;
135
134
} else {
136
135
serveFile ( res , filePath , getContentType ( url ) , encoding ) ;
137
136
}
You can’t perform that action at this time.
0 commit comments