2016-08-10 05:15:44 +00:00
|
|
|
import React from 'react';
|
2016-09-07 20:07:45 +00:00
|
|
|
import { browserHistory, IndexRoute, Route, Router } from 'react-router';
|
|
|
|
import { Provider } from 'react-redux';
|
2016-09-07 00:04:02 +00:00
|
|
|
import { syncHistoryWithStore } from 'react-router-redux';
|
2016-10-19 20:22:18 +00:00
|
|
|
|
2016-11-16 16:58:25 +00:00
|
|
|
import AdminUserManagementPage from 'pages/Admin/UserManagementPage';
|
2016-11-21 19:49:36 +00:00
|
|
|
import AllPacksPage from 'pages/packs/AllPacksPage';
|
2016-11-16 16:58:25 +00:00
|
|
|
import App from 'components/App';
|
|
|
|
import AuthenticatedAdminRoutes from 'components/AuthenticatedAdminRoutes';
|
|
|
|
import AuthenticatedRoutes from 'components/AuthenticatedRoutes';
|
|
|
|
import CoreLayout from 'layouts/CoreLayout';
|
|
|
|
import HomePage from 'pages/HomePage';
|
|
|
|
import LoginRoutes from 'components/LoginRoutes';
|
|
|
|
import LogoutPage from 'pages/LogoutPage';
|
|
|
|
import ManageHostsPage from 'pages/hosts/ManageHostsPage';
|
|
|
|
import NewHostPage from 'pages/hosts/NewHostPage';
|
2016-12-13 15:24:58 +00:00
|
|
|
import PackPageWrapper from 'components/packs/PackPageWrapper';
|
2016-11-16 16:58:25 +00:00
|
|
|
import QueryPage from 'pages/queries/QueryPage';
|
|
|
|
import QueryPageWrapper from 'components/queries/QueryPageWrapper';
|
|
|
|
import RegistrationPage from 'pages/RegistrationPage';
|
|
|
|
import store from 'redux/store';
|
2016-12-13 15:24:58 +00:00
|
|
|
import UserSettingsPage from 'pages/UserSettingsPage';
|
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}>
|
2016-11-03 19:40:54 +00:00
|
|
|
<Route path="/" 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-06 16:55:48 +00:00
|
|
|
<Route path="forgot" />
|
|
|
|
<Route path="reset" />
|
2016-11-03 19:40:54 +00:00
|
|
|
</Route>
|
|
|
|
<Route component={AuthenticatedRoutes}>
|
|
|
|
<Route path="logout" component={LogoutPage} />
|
|
|
|
<Route component={CoreLayout}>
|
|
|
|
<IndexRoute component={HomePage} />
|
|
|
|
<Route path="admin" component={AuthenticatedAdminRoutes}>
|
|
|
|
<Route path="users" component={AdminUserManagementPage} />
|
|
|
|
</Route>
|
|
|
|
<Route path="queries" component={QueryPageWrapper}>
|
2016-11-07 16:42:39 +00:00
|
|
|
<Route path="new" component={QueryPage} />
|
|
|
|
<Route path=":id" component={QueryPage} />
|
2016-11-03 19:40:54 +00:00
|
|
|
</Route>
|
2016-11-21 19:49:36 +00:00
|
|
|
<Route path="packs" component={PackPageWrapper}>
|
|
|
|
<Route path="all" component={AllPacksPage} />
|
|
|
|
</Route>
|
2016-11-03 19:40:54 +00:00
|
|
|
<Route path="hosts">
|
|
|
|
<Route path="new" component={NewHostPage} />
|
2016-12-12 16:48:50 +00:00
|
|
|
<Route path="manage(/:active_label)" component={ManageHostsPage} />
|
2016-09-30 18:55:15 +00:00
|
|
|
</Route>
|
2016-12-13 15:24:58 +00:00
|
|
|
<Route path="settings" 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>
|
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;
|