added sensor

This commit is contained in:
snoop 2017-07-24 17:32:21 +09:00
parent b12aa72909
commit fa7cb087e8
3 changed files with 58 additions and 0 deletions

View File

@ -3,6 +3,7 @@ import { Route, Switch } from 'react-router-dom';
import AccountLayout from './layout/AccountLayout'; import AccountLayout from './layout/AccountLayout';
import ProbeDetailLayout from './layout/ProbeDetailLayout'; import ProbeDetailLayout from './layout/ProbeDetailLayout';
import SensorDetailLayout from './layout/SensorDetailLayout';
import AppLayout from './layout/AppLayout'; import AppLayout from './layout/AppLayout';
import ErrorLayout from './layout/ErrorLayout'; import ErrorLayout from './layout/ErrorLayout';
@ -27,6 +28,7 @@ class App extends React.Component<Props, State> {
<Route path='/error' component={ErrorLayout}/> <Route path='/error' component={ErrorLayout}/>
<Route path='/account' component={AccountLayout}/> <Route path='/account' component={AccountLayout}/>
<Route path='/probe' component={ProbeDetailLayout}/> <Route path='/probe' component={ProbeDetailLayout}/>
<Route path='/sensor' component={SensorDetailLayout}/>
<Route path='/' component={AppLayout}/> <Route path='/' component={AppLayout}/>
</Switch> </Switch>
); );

View File

@ -8,6 +8,7 @@ import LeftMenu from './LeftMenu';
import Home from '../Home'; import Home from '../Home';
import ProbeList from '../../views/monitoring/probe/List'; import ProbeList from '../../views/monitoring/probe/List';
import SensorList from '../monitoring/sensor/List';
export interface Props extends RouteComponentProps<any> { export interface Props extends RouteComponentProps<any> {
} }
@ -40,6 +41,7 @@ export class AppLayout extends React.Component<Props, State> {
<Switch> <Switch>
<Route exact={true} path={`${this.props.match.url}`} component={Home}/> <Route exact={true} path={`${this.props.match.url}`} component={Home}/>
<Route exact={true} path={`${this.props.match.url}probes`} component={ProbeList}/> <Route exact={true} path={`${this.props.match.url}probes`} component={ProbeList}/>
<Route exact={true} path={`${this.props.match.url}sensors`} component={SensorList}/>
<Redirect to='/error/404' /> <Redirect to='/error/404' />
</Switch> </Switch>
<Footer /> <Footer />

View File

@ -0,0 +1,54 @@
import * as React from 'react';
import { RouteComponentProps, RouteProps, Route, Switch } from 'react-router-dom';
import { Container, Menu, Sidebar, Segment, Icon, Breadcrumb, Grid, Dropdown } from 'semantic-ui-react';
import { Header } from './Header';
import { Footer } from './Footer';
import { TitleBar } from './TitleBar';
import LeftMenu from './LeftMenu';
import SensorSetup from '../monitoring/sensor/Setup';
export interface Props extends RouteComponentProps<any> {
}
export interface State {
}
class SensorDetailLayout extends React.Component<Props, State> {
public constructor(props?: Props, context?: State) {
super(props, context);
}
public render(): JSX.Element {
const sub = [
{
'name': 'Info',
'path': `${this.props.location.pathname}`,
},
{
'name': 'History',
'path': `${this.props.location.pathname}/history`,
},
];
return (
<Container fluid>
<LeftMenu />
<Segment vertical style={{ margin: '0 0 0 210px', padding: '0' }}>
<Header />
<TitleBar title='Probe Details' sub={sub} />
<Switch>
{/*<Route path={`${this.props.match.url}/:id/`} component={SignIn}/>
<Route path={`${this.props.match.url}/:id/info/`} component={SignUp}/>
<Route path={`${this.props.match.url}/:id/history/`} component={EmailConfirm}/>*/}
<Route path={`${this.props.match.url}/setup/`} component={SensorSetup} />
</Switch>
<Footer />
</Segment>
</Container >
);
}
}
export default SensorDetailLayout;