mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Redirect to manage hosts page after login (#715)
This commit is contained in:
parent
a6d6b20484
commit
fc6a7a7921
4 changed files with 2 additions and 54 deletions
|
|
@ -1,37 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { Link } from 'react-router';
|
||||
|
||||
import Avatar from 'components/Avatar';
|
||||
import paths from 'router/paths';
|
||||
import ProgressBar from 'components/ProgressBar';
|
||||
import userInterface from 'interfaces/user';
|
||||
|
||||
export class HomePage extends Component {
|
||||
static propTypes = {
|
||||
user: userInterface,
|
||||
};
|
||||
|
||||
render () {
|
||||
const { user } = this.props;
|
||||
const { LOGOUT } = paths;
|
||||
const baseClass = 'home-page';
|
||||
|
||||
return (
|
||||
<div className={`${baseClass} body-wrap`}>
|
||||
{user && <Avatar size="small" className={`${baseClass}__avatar`} user={user} />}
|
||||
<span>You are successfully logged in! </span>
|
||||
{user && <Link to={LOGOUT}>Logout</Link>}
|
||||
<ProgressBar className={`${baseClass}__progress-bar`} max={100} value={35} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
const { user } = state.auth;
|
||||
|
||||
return { user };
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(HomePage);
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.home-page {
|
||||
padding-left: 24px;
|
||||
|
||||
&__avatar {
|
||||
margin-right: $pad-xsmall;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
&__progress-bar {
|
||||
margin-top: $pad-base;
|
||||
width: 378px;
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
export default from './HomePage';
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import { browserHistory, IndexRoute, Route, Router } from 'react-router';
|
||||
import { browserHistory, IndexRedirect, IndexRoute, Route, Router } from 'react-router';
|
||||
import { Provider } from 'react-redux';
|
||||
import { syncHistoryWithStore } from 'react-router-redux';
|
||||
|
||||
|
|
@ -11,7 +11,6 @@ import AuthenticatedAdminRoutes from 'components/AuthenticatedAdminRoutes';
|
|||
import AuthenticatedRoutes from 'components/AuthenticatedRoutes';
|
||||
import CoreLayout from 'layouts/CoreLayout';
|
||||
import EditPackPage from 'pages/packs/EditPackPage';
|
||||
import HomePage from 'pages/HomePage';
|
||||
import LoginRoutes from 'components/LoginRoutes';
|
||||
import LogoutPage from 'pages/LogoutPage';
|
||||
import ManageHostsPage from 'pages/hosts/ManageHostsPage';
|
||||
|
|
@ -38,7 +37,7 @@ const routes = (
|
|||
<Route component={AuthenticatedRoutes}>
|
||||
<Route path="logout" component={LogoutPage} />
|
||||
<Route component={CoreLayout}>
|
||||
<IndexRoute component={HomePage} />
|
||||
<IndexRedirect to="/hosts/manage" />
|
||||
<Route path="admin" component={AuthenticatedAdminRoutes}>
|
||||
<Route path="users" component={AdminUserManagementPage} />
|
||||
<Route path="settings" component={AdminAppSettingsPage} />
|
||||
|
|
|
|||
Loading…
Reference in a new issue