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-10-03 17:54:22 +00:00
|
|
|
import AdminUserManagementPage from '../pages/Admin/UserManagementPage';
|
2016-09-07 20:07:45 +00:00
|
|
|
import App from '../components/App';
|
2016-09-21 03:07:32 +00:00
|
|
|
import AuthenticatedAdminRoutes from '../components/AuthenticatedAdminRoutes';
|
2016-09-19 23:43:35 +00:00
|
|
|
import AuthenticatedRoutes from '../components/AuthenticatedRoutes';
|
2016-09-21 03:07:32 +00:00
|
|
|
import CoreLayout from '../layouts/CoreLayout';
|
2016-09-14 20:31:54 +00:00
|
|
|
import ForgotPasswordPage from '../pages/ForgotPasswordPage';
|
2016-09-07 20:07:45 +00:00
|
|
|
import HomePage from '../pages/HomePage';
|
2016-09-14 20:31:54 +00:00
|
|
|
import LoginRoutes from '../components/LoginRoutes';
|
2016-09-19 23:43:35 +00:00
|
|
|
import LogoutPage from '../pages/LogoutPage';
|
2016-10-17 18:55:03 +00:00
|
|
|
import ManageHostsPage from '../pages/hosts/ManageHostsPage';
|
2016-10-11 16:10:41 +00:00
|
|
|
import NewHostPage from '../pages/hosts/NewHostPage';
|
2016-11-07 16:42:39 +00:00
|
|
|
import QueryPage from '../pages/queries/QueryPage';
|
2016-10-21 21:58:13 +00:00
|
|
|
import QueryPageWrapper from '../components/queries/QueryPageWrapper';
|
2016-09-16 21:19:37 +00:00
|
|
|
import ResetPasswordPage from '../pages/ResetPasswordPage';
|
2016-09-07 00:04:02 +00:00
|
|
|
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}>
|
2016-11-03 19:40:54 +00:00
|
|
|
<Route path="/" component={App}>
|
|
|
|
<Route path="login" component={LoginRoutes}>
|
|
|
|
<Route path="forgot" component={ForgotPasswordPage} />
|
|
|
|
<Route path="reset" component={ResetPasswordPage} />
|
|
|
|
</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>
|
|
|
|
<Route path="hosts">
|
|
|
|
<Route path="new" component={NewHostPage} />
|
|
|
|
<Route path="manage" component={ManageHostsPage} />
|
2016-09-30 18:55:15 +00:00
|
|
|
</Route>
|
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;
|