2025-09-25 16:06:52 -07:00
|
|
|
import { useSelector } from "react-redux";
|
2024-12-12 00:09:41 -05:00
|
|
|
import { Navigate, Route, Routes as LibRoutes } from "react-router";
|
2025-09-27 14:54:55 -07:00
|
|
|
import HomeLayout from "@/Components/v1/Layouts/HomeLayout";
|
2026-01-12 23:57:39 +00:00
|
|
|
import NotFound from "../Pages/NotFound/index.jsx";
|
2025-01-28 11:04:11 -08:00
|
|
|
// Auth
|
2026-01-12 23:57:39 +00:00
|
|
|
import AuthLogin from "../Pages/Auth/Login/index.jsx";
|
|
|
|
|
import AuthRegister from "../Pages/Auth/Register/index.jsx";
|
|
|
|
|
import AuthForgotPassword from "../Pages/Auth/ForgotPassword.jsx";
|
|
|
|
|
import AuthCheckEmail from "../Pages/Auth/CheckEmail.jsx";
|
|
|
|
|
import AuthSetNewPassword from "../Pages/Auth/SetNewPassword.jsx";
|
|
|
|
|
import AuthNewPasswordConfirmed from "../Pages/Auth/NewPasswordConfirmed.jsx";
|
2025-01-28 11:04:11 -08:00
|
|
|
|
|
|
|
|
// Uptime
|
2026-01-12 23:57:39 +00:00
|
|
|
import Uptime from "../Pages/Uptime/Monitors/index.jsx";
|
|
|
|
|
import UptimeDetails from "../Pages/Uptime/Details/index.jsx";
|
|
|
|
|
import UptimeCreate from "../Pages/Uptime/Create/index.jsx";
|
2025-01-28 11:04:11 -08:00
|
|
|
|
|
|
|
|
// PageSpeed
|
2026-01-12 23:57:39 +00:00
|
|
|
import PageSpeed from "../Pages/PageSpeed/Monitors/index.jsx";
|
|
|
|
|
import PageSpeedDetails from "../Pages/PageSpeed/Details/index.jsx";
|
|
|
|
|
import PageSpeedCreate from "../Pages/PageSpeed/Create/index.jsx";
|
2025-01-28 11:04:11 -08:00
|
|
|
|
|
|
|
|
// Infrastructure
|
2026-01-12 23:57:39 +00:00
|
|
|
import Infrastructure from "../Pages/Infrastructure/Monitors/index.jsx";
|
|
|
|
|
import InfrastructureCreate from "../Pages/Infrastructure/Create/index.jsx";
|
|
|
|
|
import InfrastructureDetails from "../Pages/Infrastructure/Details/index.jsx";
|
2025-01-27 14:55:55 -08:00
|
|
|
|
2025-05-04 22:54:55 -04:00
|
|
|
// Server Status
|
2026-01-12 23:57:39 +00:00
|
|
|
import ServerUnreachable from "../Pages/ServerUnreachable.jsx";
|
2025-05-04 22:54:55 -04:00
|
|
|
|
2025-02-05 14:58:34 -08:00
|
|
|
// Incidents
|
2026-01-12 23:57:39 +00:00
|
|
|
import Checks from "../Pages/Incidents";
|
|
|
|
|
import Incidents2 from "../Pages/Incidents2/index.jsx";
|
2025-01-29 15:06:41 -08:00
|
|
|
|
2025-02-05 14:58:34 -08:00
|
|
|
// Status pages
|
2026-01-12 23:57:39 +00:00
|
|
|
import CreateStatus from "../Pages/StatusPage/Create/index.jsx";
|
|
|
|
|
import StatusPages from "../Pages/StatusPage/StatusPages/index.jsx";
|
|
|
|
|
import Status from "../Pages/StatusPage/Status/index.jsx";
|
2025-02-02 21:26:48 -08:00
|
|
|
|
2026-01-12 23:57:39 +00:00
|
|
|
import Notifications from "../Pages/Notifications/index.jsx";
|
|
|
|
|
import CreateNotifications from "../Pages/Notifications/create/index.jsx";
|
2025-01-28 11:04:11 -08:00
|
|
|
|
|
|
|
|
// Settings
|
2026-01-12 23:57:39 +00:00
|
|
|
import Account from "../Pages/Account/index.jsx";
|
|
|
|
|
import EditUser from "../Pages/Account/EditUser/index.jsx";
|
|
|
|
|
import Settings from "../Pages/Settings";
|
2025-01-28 11:04:11 -08:00
|
|
|
|
2026-01-12 23:57:39 +00:00
|
|
|
import Maintenance from "../Pages/Maintenance/index.jsx";
|
2025-01-28 11:04:11 -08:00
|
|
|
|
2025-09-27 14:54:55 -07:00
|
|
|
import ProtectedRoute from "../Components/v1/ProtectedRoute";
|
|
|
|
|
import RoleProtectedRoute from "../Components/v1/RoleProtectedRoute";
|
2026-01-12 23:57:39 +00:00
|
|
|
import CreateNewMaintenanceWindow from "../Pages/Maintenance/CreateMaintenance/index.jsx";
|
2025-09-27 14:54:55 -07:00
|
|
|
import withAdminCheck from "@/Components/v1/HOC/withAdminCheck";
|
2026-01-12 23:57:39 +00:00
|
|
|
import BulkImport from "../Pages/Uptime/BulkImport/index.jsx";
|
|
|
|
|
import Logs from "../Pages/Logs/index.jsx";
|
2024-12-12 00:09:41 -05:00
|
|
|
|
|
|
|
|
const Routes = () => {
|
2025-09-25 16:06:52 -07:00
|
|
|
const mode = useSelector((state) => state.ui.mode);
|
2025-01-28 11:04:11 -08:00
|
|
|
const AdminCheckedRegister = withAdminCheck(AuthRegister);
|
2024-12-12 00:09:41 -05:00
|
|
|
return (
|
|
|
|
|
<LibRoutes>
|
|
|
|
|
<Route
|
|
|
|
|
path="/"
|
2024-12-12 14:43:57 -05:00
|
|
|
element={
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<HomeLayout />
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
}
|
2024-12-12 00:09:41 -05:00
|
|
|
>
|
|
|
|
|
<Route
|
|
|
|
|
path="/"
|
2024-12-12 09:20:24 -05:00
|
|
|
element={<Navigate to="/uptime" />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
2024-12-12 09:20:24 -05:00
|
|
|
path="/uptime"
|
2025-01-27 14:55:55 -08:00
|
|
|
element={<Uptime />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
2025-01-07 14:31:25 -08:00
|
|
|
|
2025-04-27 03:05:14 +05:30
|
|
|
<Route
|
|
|
|
|
path="/uptime/bulk-import"
|
|
|
|
|
element={<BulkImport />}
|
|
|
|
|
/>
|
|
|
|
|
|
2024-12-12 00:09:41 -05:00
|
|
|
<Route
|
2025-07-23 09:05:33 -04:00
|
|
|
path="/uptime/create"
|
2025-01-28 11:04:11 -08:00
|
|
|
element={<UptimeCreate />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
2025-07-25 11:11:39 -04:00
|
|
|
<Route
|
|
|
|
|
path="/uptime/create/:monitorId"
|
2025-07-25 13:37:17 -04:00
|
|
|
element={<UptimeCreate isClone={true} />}
|
2025-07-25 11:11:39 -04:00
|
|
|
/>
|
2024-12-12 00:09:41 -05:00
|
|
|
<Route
|
2024-12-12 09:20:24 -05:00
|
|
|
path="/uptime/:monitorId/"
|
2025-01-27 10:00:58 -08:00
|
|
|
element={<UptimeDetails />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
2024-12-12 09:20:24 -05:00
|
|
|
path="/uptime/configure/:monitorId/"
|
2025-07-23 09:05:33 -04:00
|
|
|
element={<UptimeCreate />}
|
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"
|
2024-12-12 09:07:11 -05:00
|
|
|
element={<PageSpeed />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="pagespeed/create"
|
2025-07-08 19:43:22 -04:00
|
|
|
element={<PageSpeedCreate />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="pagespeed/:monitorId"
|
2024-12-12 09:07:11 -05:00
|
|
|
element={<PageSpeedDetails />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="pagespeed/configure/:monitorId"
|
2025-07-09 15:47:01 -04:00
|
|
|
element={<PageSpeedCreate />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="infrastructure"
|
2024-12-12 08:24:10 -05:00
|
|
|
element={<Infrastructure />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="infrastructure/create"
|
2025-01-28 11:04:11 -08:00
|
|
|
element={<InfrastructureCreate />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
2025-05-02 15:53:33 -07:00
|
|
|
<Route
|
|
|
|
|
path="/infrastructure/configure/:monitorId"
|
|
|
|
|
element={<InfrastructureCreate />}
|
2025-03-14 21:40:12 -04:00
|
|
|
/>
|
2024-12-12 00:09:41 -05:00
|
|
|
<Route
|
|
|
|
|
path="infrastructure/:monitorId"
|
2024-12-12 09:07:11 -05:00
|
|
|
element={<InfrastructureDetails />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
2025-12-17 18:51:34 -05:00
|
|
|
<Route
|
|
|
|
|
path="checks/:monitorId?"
|
|
|
|
|
element={<Checks />}
|
|
|
|
|
/>
|
2024-12-12 00:09:41 -05:00
|
|
|
<Route
|
|
|
|
|
path="incidents/:monitorId?"
|
2025-12-17 18:51:34 -05:00
|
|
|
element={<Incidents2 />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Route
|
|
|
|
|
path="status"
|
2025-02-10 13:45:23 -08:00
|
|
|
element={<StatusPages />}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Route
|
|
|
|
|
path="status/uptime/:url"
|
2025-02-04 14:07:24 -08: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
|
|
|
|
|
path="status/uptime/create"
|
2025-02-02 21:26:48 -08:00
|
|
|
element={<CreateStatus />}
|
|
|
|
|
/>
|
2025-02-10 13:45:23 -08:00
|
|
|
|
|
|
|
|
<Route
|
|
|
|
|
path="status/uptime/configure/:url"
|
2025-02-05 10:56:21 -08:00
|
|
|
element={<CreateStatus />}
|
|
|
|
|
/>
|
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"
|
|
|
|
|
element={<Notifications />}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="notifications/create"
|
|
|
|
|
element={<CreateNotifications />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
2025-06-10 11:13:19 +08:00
|
|
|
|
|
|
|
|
<Route
|
|
|
|
|
path="notifications/:notificationId"
|
|
|
|
|
element={<CreateNotifications />}
|
|
|
|
|
/>
|
|
|
|
|
|
2024-12-12 00:09:41 -05:00
|
|
|
<Route
|
|
|
|
|
path="maintenance"
|
2024-12-12 09:07:11 -05:00
|
|
|
element={<Maintenance />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="/maintenance/create/:maintenanceWindowId?"
|
|
|
|
|
element={<CreateNewMaintenanceWindow />}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="settings"
|
2024-12-12 09:07:11 -05:00
|
|
|
element={<Settings />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="account/profile"
|
2024-12-12 08:24:10 -05:00
|
|
|
element={<Account open={"profile"} />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="account/password"
|
2024-12-12 09:07:11 -05:00
|
|
|
element={<Account open={"password"} />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="account/team"
|
2024-12-12 09:07:11 -05: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"]}>
|
|
|
|
|
<EditUser />
|
|
|
|
|
</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"]}>
|
|
|
|
|
<Logs />
|
|
|
|
|
</RoleProtectedRoute>
|
|
|
|
|
}
|
2025-06-20 14:28:33 +08:00
|
|
|
/>
|
2024-12-12 00:09:41 -05:00
|
|
|
</Route>
|
|
|
|
|
|
|
|
|
|
<Route
|
|
|
|
|
path="/login"
|
2025-01-28 11:04:11 -08:00
|
|
|
element={<AuthLogin />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Route
|
|
|
|
|
path="/register"
|
|
|
|
|
element={<AdminCheckedRegister />}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Route
|
|
|
|
|
exact
|
|
|
|
|
path="/register/:token"
|
2025-08-28 12:58:38 -04:00
|
|
|
element={<AuthRegister superAdminExists={true} />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Route
|
|
|
|
|
path="/forgot-password"
|
2025-01-28 11:04:11 -08:00
|
|
|
element={<AuthForgotPassword />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="/check-email"
|
2025-01-28 11:04:11 -08:00
|
|
|
element={<AuthCheckEmail />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="/set-new-password/:token"
|
2025-01-28 11:04:11 -08:00
|
|
|
element={<AuthSetNewPassword />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="/new-password-confirmed"
|
2025-01-28 11:04:11 -08:00
|
|
|
element={<AuthNewPasswordConfirmed />}
|
2024-12-12 00:09:41 -05:00
|
|
|
/>
|
2025-02-04 13:06:42 -08:00
|
|
|
<Route
|
2025-02-10 13:45:23 -08:00
|
|
|
path="/status/uptime/public/:url"
|
2025-02-04 14:07:24 -08:00
|
|
|
element={<Status />}
|
2025-02-04 13:06:42 -08:00
|
|
|
/>
|
2024-12-12 08:24:10 -05:00
|
|
|
|
2025-05-04 22:54:55 -04:00
|
|
|
<Route
|
|
|
|
|
path="/server-unreachable"
|
|
|
|
|
element={<ServerUnreachable />}
|
|
|
|
|
/>
|
2024-12-12 08:24:10 -05:00
|
|
|
<Route
|
|
|
|
|
path="*"
|
|
|
|
|
element={<NotFound />}
|
|
|
|
|
/>
|
2024-12-12 00:09:41 -05:00
|
|
|
</LibRoutes>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export { Routes };
|