Files
Checkmate/client/src/Routes/index.tsx
T

294 lines
5.9 KiB
TypeScript
Raw Normal View History

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
// 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-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";
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";
import { isCustomDomainHost } from "@/Utils/statusPageUrl";
const Routes = () => {
if (isCustomDomainHost()) {
return (
<LibRoutes>
<Route
path="/"
element={<Status />}
/>
<Route
path="*"
element={<Status />}
/>
</LibRoutes>
);
}
return (
<LibRoutes>
<Route
path="/"
element={
<ProtectedRoute>
2026-02-10 19:21:57 +00:00
<RootLayout />
</ProtectedRoute>
}
>
<Route
path="/"
2024-12-12 09:20:24 -05:00
element={<Navigate to="/uptime" />}
/>
<Route
2024-12-12 09:20:24 -05:00
path="/uptime"
2026-02-20 17:59:08 +00:00
element={<Uptime />}
/>
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
<Route
path="/uptime/create"
2026-02-20 17:59:08 +00:00
element={<CreateMonitor />}
/>
<Route
2024-12-12 09:20:24 -05:00
path="/uptime/:monitorId/"
2026-02-20 17:59:08 +00:00
element={<UptimeDetails />}
/>
<Route
2024-12-12 09:20:24 -05:00
path="/uptime/configure/:monitorId/"
2026-02-20 17:59:08 +00:00
element={<CreateMonitor />}
/>
2025-02-07 15:18:41 -08:00
<Route
path="pagespeed"
2026-02-20 17:59:08 +00:00
element={<PageSpeed />}
/>
<Route
path="pagespeed/create"
2026-02-20 17:59:08 +00:00
element={<CreateMonitor />}
/>
<Route
path="pagespeed/:monitorId"
2026-02-20 17:59:08 +00:00
element={<PageSpeedDetails />}
/>
<Route
path="pagespeed/configure/:monitorId"
2026-02-20 17:59:08 +00:00
element={<CreateMonitor />}
/>
<Route
path="infrastructure"
2026-02-20 17:59:08 +00:00
element={<Infrastructure />}
/>
<Route
path="infrastructure/create"
2026-02-20 17:59:08 +00:00
element={<CreateMonitor />}
/>
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
/>
<Route
path="infrastructure/:monitorId"
2026-02-20 17:59:08 +00:00
element={<InfrastructureDetails />}
/>
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
/>
<Route
path="incidents/:monitorId?"
2026-02-20 17:59:08 +00:00
element={<Incidents />}
/>
<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-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
<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 />}
/>
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 />}
/>
<Route
path="maintenance"
2026-02-20 17:59:08 +00:00
element={<Maintenance />}
/>
<Route
path="/maintenance/create/:maintenanceWindowId?"
2026-02-20 17:59:08 +00:00
element={<CreateNewMaintenanceWindow />}
/>
<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
<Route
path="account/profile"
2026-02-20 17:59:08 +00:00
element={<Account open={"profile"} />}
/>
<Route
path="account/password"
2026-02-20 17:59:08 +00:00
element={<Account open={"password"} />}
/>
<Route
path="account/team"
2026-02-20 17:59:08 +00:00
element={<Account open={"team"} />}
/>
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
/>
</Route>
<Route
path="/login"
element={
<>
2026-02-20 17:59:08 +00:00
<AuthLogin />
</>
}
/>
<Route
path="/register"
2026-02-20 17:59:08 +00:00
element={<AuthRegister />}
2026-02-06 22:34:50 +00:00
/>
<Route
path="/register/:token"
2026-02-20 17:59:08 +00:00
element={<AuthRegister />}
/>
<Route
path="/forgot-password"
2026-02-20 17:59:08 +00:00
element={<AuthForgotPassword />}
/>
<Route
path="/set-new-password/:token"
2026-02-20 17:59:08 +00:00
element={<AuthSetNewPassword />}
/>
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
/>
<Route
path="*"
2026-02-20 17:59:08 +00:00
element={<NotFound />}
/>
</LibRoutes>
);
};
export { Routes };