Files
Checkmate/Client/src/Routes/index.jsx
T

221 lines
5.1 KiB
React
Raw Normal View History

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
import AuthLogin from "../Pages/Auth/Login/Login";
import AuthRegister from "../Pages/Auth/Register/Register";
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";
import UptimeConfigure from "../Pages/Uptime/Configure";
// PageSpeed
import PageSpeed from "../Pages/PageSpeed/Monitors";
import PageSpeedCreate from "../Pages/PageSpeed/Create";
import PageSpeedDetails from "../Pages/PageSpeed/Details";
import PageSpeedConfigure from "../Pages/PageSpeed/Configure";
// 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-02-05 14:00:27 -08:00
// Distributed Uptime
import DistributedUptimeMonitors from "../Pages/DistributedUptime/Monitors";
import CreateDistributedUptime from "../Pages/DistributedUptime/Create";
2025-02-05 14:58:34 -08:00
import DistributedUptimeDetails from "../Pages/DistributedUptime/Details";
// Incidents
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-04 14:07:24 -08:00
import Status from "../Pages/StatusPage/Status";
2025-02-02 21:26:48 -08:00
import Integrations from "../Pages/Integrations";
2025-01-28 11:04:11 -08:00
// Settings
import Account from "../Pages/Account";
import Settings from "../Pages/Settings";
2025-01-28 11:04:11 -08:00
import Maintenance from "../Pages/Maintenance";
2025-01-28 11:04:11 -08:00
import ProtectedRoute from "../Components/ProtectedRoute";
import CreateNewMaintenanceWindow from "../Pages/Maintenance/CreateMaintenance";
import withAdminCheck from "../Components/HOC/withAdminCheck";
const Routes = () => {
2025-01-28 11:04:11 -08:00
const AdminCheckedRegister = withAdminCheck(AuthRegister);
return (
<LibRoutes>
<Route
path="/"
element={
<ProtectedRoute>
<HomeLayout />
</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"
2025-01-27 14:55:55 -08:00
element={<Uptime />}
/>
2025-01-07 14:31:25 -08:00
<Route
2024-12-12 09:20:24 -05:00
path="/uptime/create/:monitorId?"
2025-01-28 11:04:11 -08:00
element={<UptimeCreate />}
/>
<Route
2024-12-12 09:20:24 -05:00
path="/uptime/:monitorId/"
2025-01-27 10:00:58 -08:00
element={<UptimeDetails />}
/>
<Route
2024-12-12 09:20:24 -05:00
path="/uptime/configure/:monitorId/"
2025-01-28 11:04:11 -08:00
element={<UptimeConfigure />}
/>
2025-02-05 14:00:27 -08:00
<Route
path="/distributed-uptime"
element={<DistributedUptimeMonitors />}
/>
<Route
path="/distributed-uptime/create"
element={<CreateDistributedUptime />}
/>
2025-02-05 14:58:34 -08:00
<Route
2025-02-05 14:00:27 -08:00
path="/distributed-uptime/:monitorId"
element={<DistributedUptimeDetails />}
2025-02-05 14:58:34 -08:00
/>
<Route
path="pagespeed"
element={<PageSpeed />}
/>
<Route
path="pagespeed/create"
2025-01-28 11:04:11 -08:00
element={<PageSpeedCreate />}
/>
<Route
path="pagespeed/:monitorId"
element={<PageSpeedDetails />}
/>
<Route
path="pagespeed/configure/:monitorId"
element={<PageSpeedConfigure />}
/>
<Route
path="infrastructure"
element={<Infrastructure />}
/>
<Route
path="infrastructure/create"
2025-01-28 11:04:11 -08:00
element={<InfrastructureCreate />}
/>
<Route
path="infrastructure/:monitorId"
element={<InfrastructureDetails />}
/>
<Route
path="incidents/:monitorId?"
element={<Incidents />}
/>
<Route
path="status"
2025-02-04 14:07:24 -08:00
element={<Status />}
/>
2024-12-20 10:59:12 -05:00
<Route
path="status/create"
2025-02-02 21:26:48 -08:00
element={<CreateStatus />}
/>
2025-02-05 10:56:21 -08:00
<Route
path="status/configure"
element={<CreateStatus />}
/>
2025-02-03 15:11:45 -08:00
<Route
path="integrations"
element={<Integrations />}
/>
<Route
path="maintenance"
element={<Maintenance />}
/>
<Route
path="/maintenance/create/:maintenanceWindowId?"
element={<CreateNewMaintenanceWindow />}
/>
<Route
path="settings"
element={<Settings />}
/>
<Route
path="account/profile"
element={<Account open={"profile"} />}
/>
<Route
path="account/password"
element={<Account open={"password"} />}
/>
<Route
path="account/team"
element={<Account open={"team"} />}
/>
</Route>
<Route
path="/login"
2025-01-28 11:04:11 -08:00
element={<AuthLogin />}
/>
<Route
path="/register"
element={<AdminCheckedRegister />}
/>
<Route
exact
path="/register/:token"
2025-01-28 11:04:11 -08:00
element={<AuthRegister />}
/>
<Route
path="/forgot-password"
2025-01-28 11:04:11 -08:00
element={<AuthForgotPassword />}
/>
<Route
path="/check-email"
2025-01-28 11:04:11 -08:00
element={<AuthCheckEmail />}
/>
<Route
path="/set-new-password/:token"
2025-01-28 11:04:11 -08:00
element={<AuthSetNewPassword />}
/>
<Route
path="/new-password-confirmed"
2025-01-28 11:04:11 -08:00
element={<AuthNewPasswordConfirmed />}
/>
2025-02-04 13:06:42 -08:00
<Route
path="/status/public"
2025-02-04 14:07:24 -08:00
element={<Status />}
2025-02-04 13:06:42 -08:00
/>
<Route
path="*"
element={<NotFound />}
/>
</LibRoutes>
);
};
export { Routes };