|
|
@ -17,7 +17,7 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
import React from "react";
|
|
|
|
import React from "react";
|
|
|
|
import {Layout, Menu, Icon} from 'antd';
|
|
|
|
import {Layout, Menu, Icon, Typography} from 'antd';
|
|
|
|
import {Switch, Link} from "react-router-dom";
|
|
|
|
import {Switch, Link} from "react-router-dom";
|
|
|
|
import RouteWithSubRoutes from "../../components/RouteWithSubRoutes"
|
|
|
|
import RouteWithSubRoutes from "../../components/RouteWithSubRoutes"
|
|
|
|
import {Redirect} from 'react-router'
|
|
|
|
import {Redirect} from 'react-router'
|
|
|
@ -25,9 +25,10 @@ import "../../App.css";
|
|
|
|
import {withConfigContext} from "../../context/ConfigContext";
|
|
|
|
import {withConfigContext} from "../../context/ConfigContext";
|
|
|
|
import Logout from "./Logout/Logout";
|
|
|
|
import Logout from "./Logout/Logout";
|
|
|
|
|
|
|
|
|
|
|
|
const {Header, Content, Footer} = Layout;
|
|
|
|
const {Header, Content, Footer, Sider} = Layout;
|
|
|
|
const {SubMenu} = Menu;
|
|
|
|
const {SubMenu} = Menu;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const {Title} = Typography;
|
|
|
|
|
|
|
|
|
|
|
|
class Dashboard extends React.Component {
|
|
|
|
class Dashboard extends React.Component {
|
|
|
|
constructor(props) {
|
|
|
|
constructor(props) {
|
|
|
@ -35,29 +36,67 @@ class Dashboard extends React.Component {
|
|
|
|
this.state = {
|
|
|
|
this.state = {
|
|
|
|
routes: props.routes,
|
|
|
|
routes: props.routes,
|
|
|
|
selectedKeys: [],
|
|
|
|
selectedKeys: [],
|
|
|
|
deviceTypes: []
|
|
|
|
deviceTypes: [],
|
|
|
|
|
|
|
|
isNavBarCollapsed: false,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.logo = this.props.context.theme.logo;
|
|
|
|
this.logo = this.props.context.theme.logo;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
toggle = () => {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
isNavBarCollapsed: !this.state.isNavBarCollapsed,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<Layout className="layout">
|
|
|
|
<Layout className="layout" >
|
|
|
|
<Header style={{paddingLeft: 0, paddingRight: 0}}>
|
|
|
|
<Sider
|
|
|
|
|
|
|
|
trigger={null}
|
|
|
|
|
|
|
|
collapsible
|
|
|
|
|
|
|
|
collapsed={this.state.isNavBarCollapsed}>
|
|
|
|
<div className="logo-image">
|
|
|
|
<div className="logo-image">
|
|
|
|
<img alt="logo" src={this.logo}/>
|
|
|
|
<img alt="logo" src={this.logo}/>
|
|
|
|
|
|
|
|
<span className="brand">Entgra</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<Menu theme="dark" mode="inline" defaultSelectedKeys={['devices']}>
|
|
|
|
|
|
|
|
<Menu.Item key="devices">
|
|
|
|
|
|
|
|
<Link to="/entgra/devices">
|
|
|
|
|
|
|
|
<Icon type="appstore"/>
|
|
|
|
|
|
|
|
<span>Devices</span>
|
|
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
|
|
|
<Menu.Item key="geo">
|
|
|
|
|
|
|
|
<Link to="/entgra/geo">
|
|
|
|
|
|
|
|
<Icon type="environment"/>
|
|
|
|
|
|
|
|
<span>Geo</span>
|
|
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
|
|
|
<Menu.Item key="reports">
|
|
|
|
|
|
|
|
<Link to="/entgra/reports">
|
|
|
|
|
|
|
|
<Icon type="bar-chart"/>
|
|
|
|
|
|
|
|
<span>Reports</span>
|
|
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
|
|
|
</Menu>
|
|
|
|
|
|
|
|
</Sider>
|
|
|
|
|
|
|
|
<Layout>
|
|
|
|
|
|
|
|
<Header style={{background: '#fff', padding: 0}}>
|
|
|
|
|
|
|
|
<div className="trigger">
|
|
|
|
|
|
|
|
<Icon
|
|
|
|
|
|
|
|
type={this.state.isNavBarCollapsed ? 'menu-unfold' : 'menu-fold'}
|
|
|
|
|
|
|
|
onClick={this.toggle}
|
|
|
|
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<Menu
|
|
|
|
<Menu
|
|
|
|
theme="light"
|
|
|
|
theme="light"
|
|
|
|
mode="horizontal"
|
|
|
|
mode="horizontal"
|
|
|
|
defaultSelectedKeys={['1']}
|
|
|
|
|
|
|
|
style={{lineHeight: '64px'}}
|
|
|
|
style={{lineHeight: '64px'}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Menu.Item key="devices"><Link to="/entgra/devices"><Icon type="appstore"/>Devices</Link></Menu.Item>
|
|
|
|
<Menu.Item key="trigger">
|
|
|
|
<Menu.Item key="geo"><Link to="/entgra/geo"><Icon type="environment"/>Geo</Link></Menu.Item>
|
|
|
|
|
|
|
|
<Menu.Item key="reports"><Link to="/entgra/reports"><Icon type="bar-chart"/>Reports</Link></Menu.Item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Menu.Item>
|
|
|
|
<SubMenu className="profile"
|
|
|
|
<SubMenu className="profile"
|
|
|
|
title={
|
|
|
|
title={
|
|
|
|
<span className="submenu-title-wrapper">
|
|
|
|
<span className="submenu-title-wrapper">
|
|
|
@ -70,10 +109,7 @@ class Dashboard extends React.Component {
|
|
|
|
</SubMenu>
|
|
|
|
</SubMenu>
|
|
|
|
|
|
|
|
|
|
|
|
</Menu>
|
|
|
|
</Menu>
|
|
|
|
|
|
|
|
|
|
|
|
</Header>
|
|
|
|
</Header>
|
|
|
|
</Layout>
|
|
|
|
|
|
|
|
<Layout>
|
|
|
|
|
|
|
|
<Content style={{marginTop: 2}}>
|
|
|
|
<Content style={{marginTop: 2}}>
|
|
|
|
<Switch>
|
|
|
|
<Switch>
|
|
|
|
<Redirect exact from="/entgra" to="/entgra/devices"/>
|
|
|
|
<Redirect exact from="/entgra" to="/entgra/devices"/>
|
|
|
@ -86,6 +122,7 @@ class Dashboard extends React.Component {
|
|
|
|
©2019 entgra.io
|
|
|
|
©2019 entgra.io
|
|
|
|
</Footer>
|
|
|
|
</Footer>
|
|
|
|
</Layout>
|
|
|
|
</Layout>
|
|
|
|
|
|
|
|
</Layout>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|