fixed sensor
This commit is contained in:
parent
763db4283f
commit
ed11bb6619
|
@ -39,10 +39,6 @@ class SensorDetailLayout extends React.Component<Props, State> {
|
||||||
'name': 'Setup',
|
'name': 'Setup',
|
||||||
'path': this.state.currUrl + '/setup',
|
'path': this.state.currUrl + '/setup',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
'name': 'Tree',
|
|
||||||
'path': this.state.currUrl + '/tree',
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
return (
|
return (
|
||||||
<Container fluid>
|
<Container fluid>
|
||||||
|
@ -57,6 +53,7 @@ class SensorDetailLayout extends React.Component<Props, State> {
|
||||||
<Route exact={true} path={`${this.props.match.url}/:id/items`} component={SensorDetailItems} />
|
<Route exact={true} path={`${this.props.match.url}/:id/items`} component={SensorDetailItems} />
|
||||||
{/*<Route path={`${this.props.match.url}/:id/history/`} component={EmailConfirm}/>*/}
|
{/*<Route path={`${this.props.match.url}/:id/history/`} component={EmailConfirm}/>*/}
|
||||||
<Route exact={true} path={`${this.props.match.url}/:id/setup`} component={SensorSetup} />
|
<Route exact={true} path={`${this.props.match.url}/:id/setup`} component={SensorSetup} />
|
||||||
|
<Route exact={true} path={`${this.props.match.url}/setup`} component={SensorSetup} />
|
||||||
<Route exact={true} path={`${this.props.match.url}/:id/tree`} component={SensorItemTree} />
|
<Route exact={true} path={`${this.props.match.url}/:id/tree`} component={SensorItemTree} />
|
||||||
</Switch>
|
</Switch>
|
||||||
<Footer />
|
<Footer />
|
||||||
|
|
|
@ -37,7 +37,7 @@ export function mapDispatchToProps(dispatch: Dispatch<any>): SensorListDispatchP
|
||||||
dispatch(routerPush('/sensor/' + String(id)));
|
dispatch(routerPush('/sensor/' + String(id)));
|
||||||
},
|
},
|
||||||
onAddSensor: (target: Target) => {
|
onAddSensor: (target: Target) => {
|
||||||
dispatch(routerPush('/sensor/' + String(11)));
|
dispatch(routerPush('/sensor/setup'));
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@ export class SensorList extends React.Component<SensorListProps, SensorListState
|
||||||
console.log(event);
|
console.log(event);
|
||||||
}
|
}
|
||||||
public handleAddSensor(): void {
|
public handleAddSensor(): void {
|
||||||
console.log('adding a sensor');
|
this.props.onAddSensor(this.props.target);
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
@ -148,8 +148,11 @@ export class SensorList extends React.Component<SensorListProps, SensorListState
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
))}
|
))}
|
||||||
</Table.Body>
|
</Table.Body>
|
||||||
|
<Table.Footer>
|
||||||
|
<Button content='Add' icon='add' labelPosition='left' floated='right' positive onClick={this.handleAddSensor.bind(this)} />
|
||||||
|
</Table.Footer>
|
||||||
</Table>
|
</Table>
|
||||||
<Button content='Add' icon='add' labelPosition='left' floated='right' positive onClick={this.handleAddSensor.bind(this)} />
|
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user