From 7de33790e8c3b388c404621c10cb74241533be73 Mon Sep 17 00:00:00 2001 From: snoop Date: Tue, 25 Jul 2017 15:44:50 +0900 Subject: [PATCH] fixed sensor --- .../app/views/layout/SensorDetailLayout.tsx | 32 ++-- .../views/monitoring/sensor/DetailInfo.tsx | 30 ++++ .../views/monitoring/sensor/DetailItems.tsx | 30 ++++ .../sensor/react/SensorDetailInfo.tsx | 28 +++ .../sensor/react/SensorDetailItems.tsx | 26 +++ .../sensor/react/components/SensorDetail.tsx | 4 +- .../react/components/SensorDetailInfo.tsx | 160 ++++++++++++++++++ ...{SensorItems.tsx => SensorDetailItems.tsx} | 9 +- .../sensor/redux/action/item_read.ts | 4 +- .../sensor/redux/payload/ItemReadPayload.ts | 2 +- .../@overflow/sensor/redux/state/ItemRead.ts | 12 ++ 11 files changed, 317 insertions(+), 20 deletions(-) create mode 100644 src/ts/@overflow/app/views/monitoring/sensor/DetailInfo.tsx create mode 100644 src/ts/@overflow/app/views/monitoring/sensor/DetailItems.tsx create mode 100644 src/ts/@overflow/sensor/react/SensorDetailInfo.tsx create mode 100644 src/ts/@overflow/sensor/react/SensorDetailItems.tsx create mode 100644 src/ts/@overflow/sensor/react/components/SensorDetailInfo.tsx rename src/ts/@overflow/sensor/react/components/{SensorItems.tsx => SensorDetailItems.tsx} (96%) diff --git a/src/ts/@overflow/app/views/layout/SensorDetailLayout.tsx b/src/ts/@overflow/app/views/layout/SensorDetailLayout.tsx index 7396f0e..27b0e7f 100644 --- a/src/ts/@overflow/app/views/layout/SensorDetailLayout.tsx +++ b/src/ts/@overflow/app/views/layout/SensorDetailLayout.tsx @@ -3,45 +3,51 @@ 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 TitleBarContainer from './TitleBarContainer'; import LeftMenu from './LeftMenu'; import SensorSetup from '../monitoring/sensor/Setup'; -import SensorDetail from '../monitoring/sensor/Detail'; +import SensorDetailInfo from '../monitoring/sensor/DetailInfo'; +import SensorDetailItems from '../monitoring/sensor/DetailItems'; export interface Props extends RouteComponentProps { } export interface State { + currUrl: string; } class SensorDetailLayout extends React.Component { public constructor(props?: Props, context?: State) { super(props, context); - + this.state = { + currUrl: this.props.location.pathname, + }; } public render(): JSX.Element { const sub = [ - { + { 'name': 'Info', - 'path': `${this.props.location.pathname}`, + 'path': this.state.currUrl + 'info', }, { - 'name': 'History', - 'path': `${this.props.location.pathname}/history`, + 'name': 'Items', + 'path': this.state.currUrl + '/items', }, ]; return ( - +
- + + {/**/} - - - {/**/} - + + + + {/**/} +