added router

This commit is contained in:
snoop 2017-07-21 11:27:22 +09:00
parent 27ed41d4fb
commit b9c90bb7f9
4 changed files with 34 additions and 2 deletions

View File

@ -49,6 +49,7 @@ const routes = (
<Route exact path='/test2' component={SignUp} /> <Route exact path='/test2' component={SignUp} />
<Route exact path='/test3' component={SignIn} /> <Route exact path='/test3' component={SignIn} />
<Route exact path='/probe_list' component={ProbeList} /> <Route exact path='/probe_list' component={ProbeList} />
<Route exact path='/sensor_list' component={SensorList} />
</Switch> </Switch>

View File

@ -3,11 +3,13 @@
export function int2ip(ipInt: number): string { export function int2ip(ipInt: number): string {
// tslint:disable-next-line:no-bitwise
return ((ipInt >>> 24) + '.' + (ipInt >> 16 & 255) + '.' + (ipInt >> 8 & 255) + '.' + (ipInt & 255)); return ((ipInt >>> 24) + '.' + (ipInt >> 16 & 255) + '.' + (ipInt >> 8 & 255) + '.' + (ipInt & 255));
} }
export function ip2int(ip: string): number { export function ip2int(ip: string): number {
return ip.split('.').reduce(function (ipInt, octet) { return (ipInt << 8) + parseInt(octet, 10); }, 0) >>> 0; // tslint:disable-next-line:no-bitwise
return ip.split('.').reduce<number>(function (ipInt: number, octet: string) { return (ipInt << 8) + parseInt(octet, 10); }, 0) >>> 0;
} }
export function sec2date(ms: number): string { export function sec2date(ms: number): string {

View File

@ -0,0 +1,23 @@
import { connect, Dispatch } from 'react-redux';
import {
SensorConfiguration,
SensorConfigurationStateProps,
SensorConfigurationDispatchProps,
} from './components/SensorConfiguration';
// import State from '../redux/state/ReadAllByTarget';
// import * as ReadAllByTargetActions from '../redux/action/read_all_by_target';
// FIXME::....
export function mapStateToProps(state: any): SensorConfigurationStateProps {
return {
};
}
export function mapDispatchToProps(dispatch: Dispatch<any>): SensorConfigurationDispatchProps {
return {
};
}
export default connect(mapStateToProps, mapDispatchToProps)(SensorConfiguration);

View File

@ -4,7 +4,11 @@ import { Grid, Image, Label, Segment, Dropdown, Input, List, Accordion, Loader }
import MetaCrawler from '@overflow/meta/api/model/MetaCrawler'; import MetaCrawler from '@overflow/meta/api/model/MetaCrawler';
export interface SensorConfigurationProps { export interface SensorConfigurationStateProps {
}
export interface SensorConfigurationDispatchProps {
} }
@ -12,6 +16,8 @@ export interface SensorConfigurationState {
} }
export type SensorConfigurationProps = SensorConfigurationStateProps & SensorConfigurationDispatchProps;
export class SensorConfiguration extends React.Component<SensorConfigurationProps, SensorConfigurationState> { export class SensorConfiguration extends React.Component<SensorConfigurationProps, SensorConfigurationState> {
constructor(props: SensorConfigurationProps, context: SensorConfigurationState) { constructor(props: SensorConfigurationProps, context: SensorConfigurationState) {