2024-12-12 00:09:41 -05:00
|
|
|
import { Navigate, Route, Routes as LibRoutes } from "react-router";
|
|
|
|
|
import HomeLayout from "../Components/Layouts/HomeLayout";
|
|
|
|
|
import NotFound from "../Pages/NotFound";
|
2025-01-28 11:04:11 -08:00
|
|
|
|
|
|
|
|
// Auth
|
2025-06-11 10:21:33 +08:00
|
|
|
import AuthLogin from "../Pages/Auth/Login";
|
2025-06-11 12:41:58 +08:00
|
|
|
import AuthRegister from "../Pages/Auth/Register/";
|
2025-01-28 11:04:11 -08:00
|
|
|
import AuthForgotPassword from "../Pages/Auth/ForgotPassword";
|
|
|
|
|
import AuthCheckEmail from "../Pages/Auth/CheckEmail";
|
|
|
|
|
import AuthSetNewPassword from "../Pages/Auth/SetNewPassword";
|
|
|
|
|
import AuthNewPasswordConfirmed from "../Pages/Auth/NewPasswordConfirmed";
|
|
|
|
|
|
|
|
|
|
// Uptime
|
2025-01-28 11:05:06 -08:00
|
|
|
import Uptime from "../Pages/Uptime/Monitors";
|
2025-01-27 14:55:55 -08:00
|
|
|
import UptimeDetails from "../Pages/Uptime/Details";
|
2025-01-28 11:04:11 -08:00
|
|
|
import UptimeCreate from "../Pages/Uptime/Create";
|
|
|
|
|
|
|
|
|
|
// PageSpeed
|
|
|
|
|
import PageSpeed from "../Pages/PageSpeed/Monitors";
|
|
|
|
|
import PageSpeedDetails from "../Pages/PageSpeed/Details";
|
2025-07-08 19:43:22 -04:00
|
|
|
import PageSpeedCreate from "../Pages/PageSpeed/Create";
|
2025-01-28 11:04:11 -08:00
|
|
|
|
|
|
|
|
// Infrastructure
|
2025-01-30 14:23:42 -08:00
|
|
|
import Infrastructure from "../Pages/Infrastructure/Monitors";
|
2025-01-28 11:04:11 -08:00
|
|
|
import InfrastructureCreate from "../Pages/Infrastructure/Create";
|
|
|
|
|
import InfrastructureDetails from "../Pages/Infrastructure/Details";
|
2025-01-27 14:55:55 -08:00
|
|
|
|
2025-05-04 22:54:55 -04:00
|
|
|
// Server Status
|
|
|
|
|
import ServerUnreachable from "../Pages/ServerUnreachable";
|
|
|
|
|
|
2025-02-05 14:58:34 -08:00
|
|
|
// Incidents
|
2024-12-12 00:09:41 -05:00
|
|
|
import Incidents from "../Pages/Incidents";
|
2025-01-29 15:06:41 -08:00
|
|
|
|
2025-02-05 14:58:34 -08:00
|
|
|
// Status pages
|
2025-02-02 21:26:48 -08:00
|
|
|
import CreateStatus from "../Pages/StatusPage/Create";
|
2025-02-10 13:45:23 -08:00
|
|
|
import StatusPages from "../Pages/StatusPage/StatusPages";
|
2025-02-04 14:07:24 -08:00
|
|
|
import Status from "../Pages/StatusPage/Status";
|
2025-02-02 21:26:48 -08:00
|
|
|
|
2025-06-09 12:56:24 +08:00
|
|
|
import Notifications from "../Pages/Notifications";
|
|
|
|
|
import CreateNotifications from "../Pages/Notifications/create";
|
2025-01-28 11:04:11 -08:00
|
|
|
|
|
|
|
|
// Settings
|
|
|
|
|
import Account from "../Pages/Account";
|
2025-07-22 12:27:06 -07:00
|
|
|
import EditUser from "../Pages/Account/EditUser";
|
2024-12-12 00:09:41 -05:00
|
|
|
import Settings from "../Pages/Settings";
|
2025-01-28 11:04:11 -08:00
|
|
|
|
2024-12-12 00:09:41 -05:00
|
|
|
import Maintenance from "../Pages/Maintenance";
|
2025-01-28 11:04:11 -08:00
|
|
|
|
|
|
|
|
import ProtectedRoute from "../Components/ProtectedRoute";
|
2025-06-25 12:38:57 +08:00
|
|
|
import RoleProtectedRoute from "../Components/RoleProtectedRoute";
|
2024-12-12 00:09:41 -05:00
|
|
|
import CreateNewMaintenanceWindow from "../Pages/Maintenance/CreateMaintenance";
|
|
|
|
|
import withAdminCheck from "../Components/HOC/withAdminCheck";
|
2025-04-27 03:05:14 +05:30
|
|
|
import BulkImport from "../Pages/Uptime/BulkImport";
|
2025-06-23 11:07:12 +08:00
|
|
|
import Logs from "../Pages/Logs";
|
2024-12-12 00:09:41 -05:00
|
|
|
|
|
|
|
|
const Routes = () => {
|
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
|
|
|
/>
|
|
|
|
|
<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
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="incidents/:monitorId?"
|
2024-12-12 08:24:10 -05:00
|
|
|
element={<Incidents />}
|
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-01-28 11:04:11 -08:00
|
|
|
element={<AuthRegister />}
|
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 };
|