import './style/main.sass'; import './style/sb-admin-2.css' import './style/style.css'; import './style/mobile.css'; import 'react-bootstrap-range-slider/dist/react-bootstrap-range-slider.css'; import {BrowserRouter, Navigate, Route, Routes} from "react-router-dom"; import React, {useCallback} from "react"; import {NightModeCss, ThemeContextProvider, ThemeCss} from "./hooks/themeHook"; import axios from "axios"; import ErrorView from "./views/ErrorView"; import {faMapSigns} from "@fortawesome/free-solid-svg-icons"; import {MetadataContextProvider} from "./hooks/metadataHook"; import {AuthenticationContextProvider} from "./hooks/authenticationHook"; import {NavigationContextProvider} from "./hooks/navigationHook"; import MainPageRedirect from "./components/navigation/MainPageRedirect"; import {baseAddress, staticSite} from "./service/backendConfiguration"; import {PageExtensionContextProvider} from "./hooks/pageExtensionHook"; import ErrorBoundary from "./components/ErrorBoundary"; import {AlertPopupContextProvider} from "./hooks/context/alertPopupContext"; import {PreferencesContextProvider} from "./hooks/preferencesHook"; const PlayerPage = React.lazy(() => import("./views/layout/PlayerPage")); const PlayerOverview = React.lazy(() => import("./views/player/PlayerOverview")); const PlayerSessions = React.lazy(() => import("./views/player/PlayerSessions")); const PlayerPvpPve = React.lazy(() => import("./views/player/PlayerPvpPve")); const PlayerServers = React.lazy(() => import("./views/player/PlayerServers")); const PlayerPluginData = React.lazy(() => import("./views/player/PlayerPluginData")); const ServerPage = React.lazy(() => import("./views/layout/ServerPage")); const ServerOverview = React.lazy(() => import("./views/server/ServerOverview")); const OnlineActivity = React.lazy(() => import("./views/server/OnlineActivity")); const ServerSessions = React.lazy(() => import("./views/server/ServerSessions")); const ServerPvpPve = React.lazy(() => import("./views/server/ServerPvpPve")); const ServerAllowList = React.lazy(() => import("./views/server/ServerAllowList")); const PlayerbaseOverview = React.lazy(() => import("./views/server/PlayerbaseOverview")); const ServerPlayers = React.lazy(() => import("./views/server/ServerPlayers")); const ServerGeolocations = React.lazy(() => import("./views/server/ServerGeolocations")); const ServerPerformance = React.lazy(() => import("./views/server/ServerPerformance")); const ServerPluginHistory = React.lazy(() => import('./views/server/ServerPluginHistory')); const ServerPluginData = React.lazy(() => import("./views/server/ServerPluginData")); const ServerWidePluginData = React.lazy(() => import("./views/server/ServerWidePluginData")); const ServerJoinAddresses = React.lazy(() => import("./views/server/ServerJoinAddresses")); const ServerPlayerRetention = React.lazy(() => import("./views/server/ServerPlayerRetention")); const NetworkPage = React.lazy(() => import("./views/layout/NetworkPage")); const NetworkOverview = React.lazy(() => import("./views/network/NetworkOverview")); const NetworkServers = React.lazy(() => import("./views/network/NetworkServers")); const NetworkSessions = React.lazy(() => import("./views/network/NetworkSessions")); const NetworkJoinAddresses = React.lazy(() => import("./views/network/NetworkJoinAddresses")); const NetworkPlayerRetention = React.lazy(() => import("./views/network/NetworkPlayerRetention")); const NetworkGeolocations = React.lazy(() => import("./views/network/NetworkGeolocations")); const NetworkPlayerbaseOverview = React.lazy(() => import("./views/network/NetworkPlayerbaseOverview")); const NetworkPerformance = React.lazy(() => import("./views/network/NetworkPerformance")); const NetworkPluginHistory = React.lazy(() => import('./views/network/NetworkPluginHistory')); const PlayersPage = React.lazy(() => import("./views/layout/PlayersPage")); const AllPlayers = React.lazy(() => import("./views/players/AllPlayers")); const QueryPage = React.lazy(() => import("./views/layout/QueryPage")); const NewQueryView = React.lazy(() => import("./views/query/NewQueryView")); const QueryResultView = React.lazy(() => import("./views/query/QueryResultView")); const ManagePage = React.lazy(() => import("./views/layout/ManagePage")); const GroupsView = React.lazy(() => import("./views/manage/GroupsView")); const LoginPage = React.lazy(() => import("./views/layout/LoginPage")); const RegisterPage = React.lazy(() => import("./views/layout/RegisterPage")); const ErrorPage = React.lazy(() => import("./views/layout/ErrorPage")); const ErrorsPage = React.lazy(() => import("./views/layout/ErrorsPage")); const SwaggerView = React.lazy(() => import("./views/SwaggerView")); const OverviewRedirect = () => { return () } const NewRedirect = () => { return () } const GroupsRedirect = () => { return () } const ContextProviders = ({children}) => ( {children} ) const Lazy = ({children}) => { const fallbackFunction = useCallback((error) => , []); return ( }> {children} ); } const getBasename = () => { if (baseAddress) { const addressWithoutProtocol = baseAddress .replace("http://", "") .replace("https://", ""); const startOfPath = addressWithoutProtocol.indexOf("/"); return startOfPath >= 0 ? addressWithoutProtocol.substring(startOfPath) : ""; } else { return ""; } } function App() { axios.defaults.withCredentials = true; return (
}/> }/> }/> {!staticSite && }/>} {!staticSite && }/>} }> }/> }/> }/> }/> }/> }/> }/> }> }/> }/> }> }/> }/> }/> }/> }/> }/> }/> }/> }/> }/> }/> }/> }/> }/> }/> }/> }> }/> }/> }/> }/> {!staticSite && }/>} }/> }/> }/> }/> }/> }/> }/> }/> }/> {!staticSite && }> }/> }/> } {!staticSite && }> }/> }/> }/> } {!staticSite && }/>} {!staticSite && }/>} }/>
); } export default App;