2021-04-12 13:32:25 +00:00
|
|
|
import React from "react";
|
|
|
|
import {
|
|
|
|
browserHistory,
|
|
|
|
IndexRedirect,
|
|
|
|
IndexRoute,
|
|
|
|
Route,
|
|
|
|
Router,
|
|
|
|
} from "react-router";
|
|
|
|
import { Provider } from "react-redux";
|
|
|
|
import { syncHistoryWithStore } from "react-router-redux";
|
2021-03-08 16:48:29 +00:00
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
import AdminAppSettingsPage from "pages/admin/AppSettingsPage";
|
|
|
|
import AdminUserManagementPage from "pages/admin/UserManagementPage";
|
2021-04-14 16:52:15 +00:00
|
|
|
import AdminTeamManagementPage from "pages/admin/TeamManagementPage";
|
2021-04-29 13:47:33 +00:00
|
|
|
import TeamDetailsWrapper from "pages/admin/TeamManagementPage/TeamDetailsWrapper";
|
2021-04-12 13:32:25 +00:00
|
|
|
import AllPacksPage from "pages/packs/AllPacksPage";
|
|
|
|
import App from "components/App";
|
|
|
|
import AuthenticatedAdminRoutes from "components/AuthenticatedAdminRoutes";
|
|
|
|
import AuthenticatedRoutes from "components/AuthenticatedRoutes";
|
2021-06-04 13:00:14 +00:00
|
|
|
import AuthGlobalAdminMaintainerRoutes from "components/AuthGlobalAdminMaintainerRoutes";
|
|
|
|
import AuthAnyMaintainerGlobalAdminRoutes from "components/AuthAnyMaintainerGlobalAdminRoutes";
|
|
|
|
import BasicTierRoutes from "components/BasicTierRoutes";
|
2021-04-12 13:32:25 +00:00
|
|
|
import ConfirmInvitePage from "pages/ConfirmInvitePage";
|
|
|
|
import ConfirmSSOInvitePage from "pages/ConfirmSSOInvitePage";
|
|
|
|
import CoreLayout from "layouts/CoreLayout";
|
|
|
|
import EditPackPage from "pages/packs/EditPackPage";
|
|
|
|
import EmailTokenRedirect from "components/EmailTokenRedirect";
|
|
|
|
import HostDetailsPage from "pages/hosts/HostDetailsPage";
|
2021-07-12 17:15:47 +00:00
|
|
|
import Homepage from "pages/Homepage";
|
2021-04-12 13:32:25 +00:00
|
|
|
import LoginRoutes from "components/LoginRoutes";
|
|
|
|
import LogoutPage from "pages/LogoutPage";
|
|
|
|
import ManageHostsPage from "pages/hosts/ManageHostsPage";
|
|
|
|
import ManageQueriesPage from "pages/queries/ManageQueriesPage";
|
2021-07-26 18:41:36 +00:00
|
|
|
import ManageSchedulePage from "pages/schedule/ManageSchedulePage";
|
2021-04-12 13:32:25 +00:00
|
|
|
import PackPageWrapper from "components/packs/PackPageWrapper";
|
|
|
|
import PackComposerPage from "pages/packs/PackComposerPage";
|
|
|
|
import QueryPage from "pages/queries/QueryPage";
|
|
|
|
import QueryPageWrapper from "components/queries/QueryPageWrapper";
|
|
|
|
import RegistrationPage from "pages/RegistrationPage";
|
2021-07-26 18:41:36 +00:00
|
|
|
import SchedulePageWrapper from "components/schedule/SchedulePageWrapper";
|
2021-06-17 15:11:28 +00:00
|
|
|
import ApiOnlyUser from "pages/ApiOnlyUser";
|
2021-06-04 16:34:27 +00:00
|
|
|
import Fleet403 from "pages/Fleet403";
|
2021-04-12 13:32:25 +00:00
|
|
|
import Fleet404 from "pages/Fleet404";
|
|
|
|
import Fleet500 from "pages/Fleet500";
|
|
|
|
import UserSettingsPage from "pages/UserSettingsPage";
|
|
|
|
import SettingsWrapper from "pages/admin/SettingsWrapper/SettingsWrapper";
|
2021-04-29 13:47:33 +00:00
|
|
|
import MembersPage from "pages/admin/TeamManagementPage/TeamDetailsWrapper/MembersPagePage";
|
|
|
|
import AgentOptionsPage from "pages/admin/TeamManagementPage/TeamDetailsWrapper/AgentOptionsPage";
|
2021-04-12 13:32:25 +00:00
|
|
|
import PATHS from "router/paths";
|
|
|
|
import store from "redux/store";
|
2016-09-06 18:41:16 +00:00
|
|
|
|
2016-09-07 00:04:02 +00:00
|
|
|
const history = syncHistoryWithStore(browserHistory, store);
|
2016-08-10 05:15:44 +00:00
|
|
|
|
2016-09-07 00:04:02 +00:00
|
|
|
const routes = (
|
2016-09-07 20:07:45 +00:00
|
|
|
<Provider store={store}>
|
|
|
|
<Router history={history}>
|
2019-10-16 23:40:45 +00:00
|
|
|
<Route path={PATHS.HOME} component={App}>
|
2016-11-16 16:58:25 +00:00
|
|
|
<Route path="setup" component={RegistrationPage} />
|
2016-11-03 19:40:54 +00:00
|
|
|
<Route path="login" component={LoginRoutes}>
|
2016-12-29 20:27:43 +00:00
|
|
|
<Route path="invites/:invite_token" component={ConfirmInvitePage} />
|
2021-04-12 13:32:25 +00:00
|
|
|
<Route
|
|
|
|
path="ssoinvites/:invite_token"
|
|
|
|
component={ConfirmSSOInvitePage}
|
|
|
|
/>
|
2016-12-06 16:55:48 +00:00
|
|
|
<Route path="forgot" />
|
|
|
|
<Route path="reset" />
|
2016-11-03 19:40:54 +00:00
|
|
|
</Route>
|
|
|
|
<Route component={AuthenticatedRoutes}>
|
2017-02-24 15:08:59 +00:00
|
|
|
<Route path="email/change/:token" component={EmailTokenRedirect} />
|
2016-11-03 19:40:54 +00:00
|
|
|
<Route path="logout" component={LogoutPage} />
|
|
|
|
<Route component={CoreLayout}>
|
2019-10-16 23:40:45 +00:00
|
|
|
<IndexRedirect to={PATHS.MANAGE_HOSTS} />
|
2021-07-26 20:04:35 +00:00
|
|
|
<Route path="home/dashboard" component={Homepage} />
|
2021-03-08 16:48:29 +00:00
|
|
|
<Route path="settings" component={AuthenticatedAdminRoutes}>
|
|
|
|
<Route component={SettingsWrapper}>
|
|
|
|
<Route path="organization" component={AdminAppSettingsPage} />
|
|
|
|
<Route path="users" component={AdminUserManagementPage} />
|
2021-06-04 13:00:14 +00:00
|
|
|
<Route component={BasicTierRoutes}>
|
|
|
|
<Route path="teams" component={AdminTeamManagementPage} />
|
|
|
|
</Route>
|
2021-03-08 16:48:29 +00:00
|
|
|
</Route>
|
2021-04-29 13:47:33 +00:00
|
|
|
<Route path="teams/:team_id" component={TeamDetailsWrapper}>
|
|
|
|
<Route path="members" component={MembersPage} />
|
|
|
|
<Route path="options" component={AgentOptionsPage} />
|
|
|
|
</Route>
|
2016-11-03 19:40:54 +00:00
|
|
|
</Route>
|
2016-12-21 17:25:54 +00:00
|
|
|
<Route path="hosts">
|
|
|
|
<Route path="manage" component={ManageHostsPage} />
|
2021-04-12 13:32:25 +00:00
|
|
|
<Route
|
|
|
|
path="manage/labels/:label_id"
|
|
|
|
component={ManageHostsPage}
|
|
|
|
/>
|
2020-03-30 02:19:54 +00:00
|
|
|
<Route path="manage/:active_label" component={ManageHostsPage} />
|
2021-01-28 20:44:48 +00:00
|
|
|
<Route path=":host_id" component={HostDetailsPage} />
|
2016-11-03 19:40:54 +00:00
|
|
|
</Route>
|
2021-06-04 13:00:14 +00:00
|
|
|
<Route component={AuthGlobalAdminMaintainerRoutes}>
|
|
|
|
<Route path="packs" component={PackPageWrapper}>
|
|
|
|
<Route path="manage" component={AllPacksPage} />
|
|
|
|
<Route path="new" component={PackComposerPage} />
|
|
|
|
<Route path=":id">
|
|
|
|
<IndexRoute component={EditPackPage} />
|
|
|
|
<Route path="edit" component={EditPackPage} />
|
|
|
|
</Route>
|
2016-12-21 17:25:54 +00:00
|
|
|
</Route>
|
2021-07-26 18:41:36 +00:00
|
|
|
<Route path="schedule" component={SchedulePageWrapper}>
|
|
|
|
<Route path="manage" component={ManageSchedulePage} />
|
|
|
|
</Route>
|
2016-11-21 19:49:36 +00:00
|
|
|
</Route>
|
2016-12-21 17:25:54 +00:00
|
|
|
<Route path="queries" component={QueryPageWrapper}>
|
2017-01-06 20:57:44 +00:00
|
|
|
<Route path="manage" component={ManageQueriesPage} />
|
2021-06-04 13:00:14 +00:00
|
|
|
<Route component={AuthAnyMaintainerGlobalAdminRoutes}>
|
|
|
|
<Route path="new" component={QueryPage} />
|
|
|
|
</Route>
|
2016-12-21 17:25:54 +00:00
|
|
|
<Route path=":id" component={QueryPage} />
|
|
|
|
</Route>
|
2021-03-08 16:48:29 +00:00
|
|
|
<Route path="profile" component={UserSettingsPage} />
|
2016-09-21 03:07:32 +00:00
|
|
|
</Route>
|
2016-09-20 18:17:31 +00:00
|
|
|
</Route>
|
2016-11-03 19:40:54 +00:00
|
|
|
</Route>
|
2021-06-17 15:11:28 +00:00
|
|
|
<Route path="/apionlyuser" component={ApiOnlyUser} />
|
2020-12-09 01:45:08 +00:00
|
|
|
<Route path="/500" component={Fleet500} />
|
|
|
|
<Route path="/404" component={Fleet404} />
|
2021-06-04 16:34:27 +00:00
|
|
|
<Route path="/403" component={Fleet403} />
|
2020-12-09 01:45:08 +00:00
|
|
|
<Route path="*" component={Fleet404} />
|
2016-09-07 20:07:45 +00:00
|
|
|
</Router>
|
|
|
|
</Provider>
|
2016-09-07 00:04:02 +00:00
|
|
|
);
|
2016-08-10 05:15:44 +00:00
|
|
|
|
2016-09-07 00:04:02 +00:00
|
|
|
export default routes;
|