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