Fork of the excellent esp8266-react - https://github.com/rjwats/esp8266-react
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.2 KiB

  1. import React, { Component } from 'react';
  2. import { Redirect, Switch } from 'react-router-dom'
  3. import Tabs from '@material-ui/core/Tabs';
  4. import Tab from '@material-ui/core/Tab';
  5. import AuthenticatedRoute from '../authentication/AuthenticatedRoute';
  6. import MenuAppBar from '../components/MenuAppBar';
  7. import ManageUsers from './ManageUsers';
  8. import SecuritySettings from './SecuritySettings';
  9. class Security extends Component {
  10. handleTabChange = (event, path) => {
  11. this.props.history.push(path);
  12. };
  13. render() {
  14. return (
  15. <MenuAppBar sectionTitle="Security">
  16. <Tabs value={this.props.match.url} onChange={this.handleTabChange} indicatorColor="primary" textColor="primary" variant="fullWidth">
  17. <Tab value="/security/users" label="Manage Users" />
  18. <Tab value="/security/settings" label="Security Settings" />
  19. </Tabs>
  20. <Switch>
  21. <AuthenticatedRoute exact={true} path="/security/users" component={ManageUsers} />
  22. <AuthenticatedRoute exact={true} path="/security/settings" component={SecuritySettings} />
  23. <Redirect to="/security/users" />
  24. </Switch>
  25. </MenuAppBar>
  26. )
  27. }
  28. }
  29. export default Security;