2024-12-12 00:09:41 -05:00
|
|
|
import { Navigate, Route, Routes as LibRoutes } from "react-router";
|
2026-02-20 18:13:39 +00:00
|
|
|
import RootLayout from "@/Components/layout/RootLayout";
|
2026-02-09 22:19:10 +00:00
|
|
|
import NotFound from "@/Pages/NotFound";
|
2026-02-06 21:50:45 +00:00
|
|
|
|
2025-01-28 11:04:11 -08:00
|
|
|
// Auth
|
2026-02-09 22:19:10 +00:00
|
|
|
import AuthLogin from "@/Pages/Auth/Login";
|
2026-02-06 22:34:50 +00:00
|
|
|
import AuthRegister from "@/Pages/Auth/Register";
|
2026-02-06 21:50:45 +00:00
|
|
|
import AuthForgotPassword from "@/Pages/Auth/Recovery";
|
2026-02-11 17:21:32 +00:00
|
|
|
import AuthSetNewPassword from "@/Pages/Auth/SetNewPassword";
|
2025-01-28 11:04:11 -08:00
|
|
|
|
2026-09-10 18:00:12 -06:00
|
|
|
// Dashboard
|
|
|
|
|
import Dashboard from "@/Pages/Dashboard";
|
|
|
|
|
|
2025-01-28 11:04:11 -08:00
|
|
|
// Uptime
|
2026-02-09 22:19:10 +00:00
|
|
|
import Uptime from "@/Pages/Uptime/Monitors";
|
|
|
|
|
import UptimeDetails from "@/Pages/Uptime/Details";
|
2025-01-28 11:04:11 -08:00
|
|
|
|
|
|
|
|
// PageSpeed
|
2026-02-09 22:19:10 +00:00
|
|
|
import PageSpeed from "@/Pages/PageSpeed/Monitors/";
|
|
|
|
|
import PageSpeedDetails from "@/Pages/PageSpeed/Details/";
|
2025-01-28 11:04:11 -08:00
|
|
|
|
|
|
|
|
// Infrastructure
|
2026-02-09 22:19:10 +00:00
|
|
|
import Infrastructure from "@/Pages/Infrastructure/Monitors";
|
2026-02-11 17:21:32 +00:00
|
|
|
import InfrastructureDetails from "@/Pages/Infrastructure/Details";
|
2025-01-27 14:55:55 -08:00
|
|
|
|
2026-08-28 15:08:23 -07:00
|
|
|
// Docker
|
|
|
|
|
import Docker from "@/Pages/Docker/Monitors";
|
2026-08-31 12:02:40 -07:00
|
|
|
import DockerHostDetails from "@/Pages/Docker/HostDetails";
|
2026-09-02 09:45:28 -07:00
|
|
|
import DockerDetails from "@/Pages/Docker/ContainerDetails";
|
2026-08-28 15:08:23 -07:00
|
|
|
|
2026-01-20 19:12:05 +00:00
|
|
|
// Checks
|
2026-02-11 17:21:32 +00:00
|
|
|
import Checks from "@/Pages/Checks";
|
2026-01-20 19:12:05 +00:00
|
|
|
|
2025-02-05 14:58:34 -08:00
|
|
|
// Incidents
|
2026-02-11 17:21:32 +00:00
|
|
|
import Incidents from "@/Pages/Incidents";
|
2025-01-29 15:06:41 -08:00
|
|
|
|
2025-02-05 14:58:34 -08:00
|
|
|
// Status pages
|
2026-02-11 17:21:32 +00:00
|
|
|
import CreateStatus from "@/Pages/StatusPage/Create/";
|
|
|
|
|
import StatusPages from "@/Pages/StatusPage/StatusPages";
|
|
|
|
|
import Status from "@/Pages/StatusPage/Status";
|
2025-02-02 21:26:48 -08:00
|
|
|
|
2026-05-20 10:29:25 -07:00
|
|
|
// Notifications
|
2026-02-11 17:21:32 +00:00
|
|
|
import Notifications from "@/Pages/Notifications";
|
|
|
|
|
import CreateNotifications from "@/Pages/Notifications/create";
|
2025-01-28 11:04:11 -08:00
|
|
|
|
2026-05-20 10:29:25 -07:00
|
|
|
// Tags
|
|
|
|
|
import Tags from "@/Pages/Tags";
|
|
|
|
|
import CreateTags from "@/Pages/Tags/create";
|
|
|
|
|
|
2026-08-21 15:13:34 -07:00
|
|
|
// Proxies
|
|
|
|
|
import Proxies from "@/Pages/Proxies";
|
|
|
|
|
import CreateProxies from "@/Pages/Proxies/create";
|
|
|
|
|
|
2025-01-28 11:04:11 -08:00
|
|
|
// Settings
|
2026-02-07 00:49:49 +00:00
|
|
|
import Account from "@/Pages/Account";
|
2026-02-11 17:21:32 +00:00
|
|
|
import EditUser from "@/Pages/Account/EditUser";
|
|
|
|
|
import Settings from "@/Pages/Settings";
|
|
|
|
|
import Maintenance from "@/Pages/Maintenance";
|
2026-02-04 21:45:39 +00:00
|
|
|
import CreateNewMaintenanceWindow from "@/Pages/Maintenance/create";
|
2025-01-28 11:04:11 -08:00
|
|
|
|
2026-02-11 17:52:26 +00:00
|
|
|
// Logs & Diagnostics
|
2026-02-11 17:21:32 +00:00
|
|
|
import Logs from "@/Pages/Logs";
|
2024-12-12 00:09:41 -05:00
|
|
|
|
2026-02-11 17:52:26 +00:00
|
|
|
// Routing
|
2026-02-20 18:13:39 +00:00
|
|
|
import { ProtectedRoute, RoleProtectedRoute } from "@/Components/routing/RouteProtected";
|
2026-01-29 22:17:56 +00:00
|
|
|
import CreateMonitor from "@/Pages/CreateMonitor";
|
2026-06-07 22:37:24 -04:00
|
|
|
import { isCustomDomainHost } from "@/Utils/statusPageUrl";
|
2024-12-12 00:09:41 -05:00
|
|
|
const Routes = () => {
|
2026-06-07 22:37:24 -04:00
|
|
|
if (isCustomDomainHost()) {
|
|
|
|
|
return (
|
|
|
|
|
<LibRoutes>
|
|
|
|
|
<Route
|
|
|
|
|
path="/"
|
|
|
|
|
element={<Status />}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="*"
|
|
|
|
|
element={<Status />}
|
|
|
|
|
/>
|
|
|
|
|
</LibRoutes>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-12 00:09:41 -05:00
|
|
|
return (
|
|
|
|
|
<LibRoutes>
|
|
|
|
|
<Route
|
|
|
|
|
path="/"
|
2024-12-12 14:43:57 -05:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
2026-02-10 19:21:57 +00:00
|
|
|
<RootLayout />
|
2024-12-12 14:43:57 -05:00
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
2024-12-12 00:09:41 -05:00
|
|
|
>
|
|
|
|
|
<Route
|
|
|
|
|
path="/"
|
2026-09-14 16:46:25 -06:00
|
|
|
element={<Navigate to="/uptime" />}
|
2026-09-10 18:00:12 -06:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="dashboard"
|
|
|
|
|
element={<Dashboard />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
2024-12-12 09:20:24 -05:00
|
|
|
path="/uptime"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<Uptime />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
2025-01-07 14:31:25 -08:00
|
|
|
|
2026-02-09 23:16:14 +00:00
|
|
|
<Route path="/uptime/bulk-import" />
|
2025-04-27 03:05:14 +05:30
|
|
|
|
2024-12-12 00:09:41 -05:00
|
|
|
<Route
|
2025-07-23 09:05:33 -04:00
|
|
|
path="/uptime/create"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<CreateMonitor />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
2024-12-12 09:20:24 -05:00
|
|
|
path="/uptime/:monitorId/"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<UptimeDetails />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
2024-12-12 09:20:24 -05:00
|
|
|
path="/uptime/configure/:monitorId/"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<CreateMonitor />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
2025-02-07 15:18:41 -08:00
|
|
|
|
2024-12-12 00:09:41 -05:00
|
|
|
<Route
|
|
|
|
|
path="pagespeed"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<PageSpeed />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="pagespeed/create"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<CreateMonitor />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="pagespeed/:monitorId"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<PageSpeedDetails />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="pagespeed/configure/:monitorId"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<CreateMonitor />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="infrastructure"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<Infrastructure />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="infrastructure/create"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<CreateMonitor />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
2025-05-02 15:53:33 -07:00
|
|
|
<Route
|
|
|
|
|
path="/infrastructure/configure/:monitorId"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<CreateMonitor />}
|
2025-03-14 21:40:12 -04:00
|
|
|
/>
|
2024-12-12 00:09:41 -05:00
|
|
|
<Route
|
|
|
|
|
path="infrastructure/:monitorId"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<InfrastructureDetails />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
2026-08-28 15:08:23 -07:00
|
|
|
<Route
|
|
|
|
|
path="docker"
|
|
|
|
|
element={<Docker />}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="docker/create"
|
|
|
|
|
element={<CreateMonitor />}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="/docker/configure/:monitorId"
|
|
|
|
|
element={<CreateMonitor />}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
2026-09-01 11:23:03 -07:00
|
|
|
path="docker/host/:monitorId/container/:containerName"
|
2026-08-28 15:08:23 -07:00
|
|
|
element={<DockerDetails />}
|
|
|
|
|
/>
|
2026-08-31 12:02:40 -07:00
|
|
|
<Route
|
|
|
|
|
path="docker/host/:monitorId"
|
|
|
|
|
element={<DockerHostDetails />}
|
|
|
|
|
/>
|
2025-12-17 18:51:34 -05:00
|
|
|
<Route
|
|
|
|
|
path="checks/:monitorId?"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<Checks />}
|
2025-12-17 18:51:34 -05:00
|
|
|
/>
|
2024-12-12 00:09:41 -05:00
|
|
|
<Route
|
|
|
|
|
path="incidents/:monitorId?"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<Incidents />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Route
|
|
|
|
|
path="status"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<StatusPages />}
|
2025-02-10 13:45:23 -08:00
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Route
|
2026-02-03 21:14:16 +00:00
|
|
|
path="status/:url"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<Status />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
2024-12-20 10:59:12 -05:00
|
|
|
|
2025-02-10 13:45:23 -08:00
|
|
|
<Route
|
2026-02-03 21:14:16 +00:00
|
|
|
path="status/create"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<CreateStatus />}
|
2025-02-02 21:26:48 -08:00
|
|
|
/>
|
2025-02-10 13:45:23 -08:00
|
|
|
|
|
|
|
|
<Route
|
2026-02-03 21:14:16 +00:00
|
|
|
path="status/configure/:url"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<CreateStatus />}
|
2025-02-05 10:56:21 -08:00
|
|
|
/>
|
2025-02-03 15:11:45 -08:00
|
|
|
|
2024-12-12 00:09:41 -05:00
|
|
|
<Route
|
2025-06-09 12:56:24 +08:00
|
|
|
path="notifications"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<Notifications />}
|
2025-06-09 12:56:24 +08:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="notifications/create"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<CreateNotifications />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
2025-06-10 11:13:19 +08:00
|
|
|
|
|
|
|
|
<Route
|
2026-01-29 21:08:26 +00:00
|
|
|
path="notifications/configure/:notificationId"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<CreateNotifications />}
|
2025-06-10 11:13:19 +08:00
|
|
|
/>
|
2026-05-20 10:29:25 -07:00
|
|
|
<Route
|
|
|
|
|
path="tags"
|
|
|
|
|
element={<Tags />}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="tags/create"
|
|
|
|
|
element={<CreateTags />}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="tags/configure/:tagId"
|
|
|
|
|
element={<CreateTags />}
|
|
|
|
|
/>
|
2025-06-10 11:13:19 +08:00
|
|
|
|
2026-08-21 15:13:34 -07:00
|
|
|
<Route
|
|
|
|
|
path="proxies"
|
|
|
|
|
element={<Proxies />}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="proxies/create"
|
|
|
|
|
element={<CreateProxies />}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="proxies/configure/:proxyId"
|
|
|
|
|
element={<CreateProxies />}
|
|
|
|
|
/>
|
|
|
|
|
|
2024-12-12 00:09:41 -05:00
|
|
|
<Route
|
|
|
|
|
path="maintenance"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<Maintenance />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="/maintenance/create/:maintenanceWindowId?"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<CreateNewMaintenanceWindow />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="settings"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<Settings />}
|
2026-02-18 19:59:03 +00:00
|
|
|
/>
|
2026-02-20 17:36:04 +00:00
|
|
|
|
2024-12-12 00:09:41 -05:00
|
|
|
<Route
|
|
|
|
|
path="account/profile"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<Account open={"profile"} />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="account/password"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<Account open={"password"} />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="account/team"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<Account open={"team"} />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
2025-07-22 12:27:06 -07:00
|
|
|
<Route
|
|
|
|
|
path="account/team/:userId"
|
|
|
|
|
element={
|
|
|
|
|
<RoleProtectedRoute roles={["superadmin"]}>
|
2026-02-20 17:59:08 +00:00
|
|
|
<EditUser />
|
2025-07-22 12:27:06 -07:00
|
|
|
</RoleProtectedRoute>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2025-06-23 11:07:12 +08:00
|
|
|
|
2025-06-20 14:28:33 +08:00
|
|
|
<Route
|
2025-06-23 11:07:12 +08:00
|
|
|
path="logs"
|
2025-06-25 12:38:57 +08:00
|
|
|
element={
|
|
|
|
|
<RoleProtectedRoute roles={["admin", "superadmin"]}>
|
2026-02-20 17:59:08 +00:00
|
|
|
<Logs />
|
2025-06-25 12:38:57 +08:00
|
|
|
</RoleProtectedRoute>
|
|
|
|
|
}
|
2025-06-20 14:28:33 +08:00
|
|
|
/>
|
2024-12-12 00:09:41 -05:00
|
|
|
</Route>
|
|
|
|
|
|
|
|
|
|
<Route
|
|
|
|
|
path="/login"
|
2026-02-06 20:32:10 +00:00
|
|
|
element={
|
|
|
|
|
<>
|
2026-02-20 17:59:08 +00:00
|
|
|
<AuthLogin />
|
2026-02-06 20:32:10 +00:00
|
|
|
</>
|
|
|
|
|
}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Route
|
|
|
|
|
path="/register"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<AuthRegister />}
|
2026-02-06 22:34:50 +00:00
|
|
|
/>
|
2024-12-12 00:09:41 -05:00
|
|
|
|
|
|
|
|
<Route
|
|
|
|
|
path="/register/:token"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<AuthRegister />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Route
|
|
|
|
|
path="/forgot-password"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<AuthForgotPassword />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="/set-new-password/:token"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<AuthSetNewPassword />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
2025-02-04 13:06:42 -08:00
|
|
|
<Route
|
2026-02-03 21:14:16 +00:00
|
|
|
path="/status/public/:url"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<Status />}
|
2025-02-04 13:06:42 -08:00
|
|
|
/>
|
2024-12-12 08:24:10 -05:00
|
|
|
|
|
|
|
|
<Route
|
|
|
|
|
path="*"
|
2026-02-20 17:59:08 +00:00
|
|
|
element={<NotFound />}
|
2024-12-12 08:24:10 -05:00
|
|
|
/>
|
2024-12-12 00:09:41 -05:00
|
|
|
</LibRoutes>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export { Routes };
|