sensor regist after~
This commit is contained in:
parent
fa5bb021af
commit
fdaef45234
|
@ -52,7 +52,7 @@ export class CrawlerSelector extends React.Component<CrawlerSelectorProps, Crawl
|
||||||
} else {
|
} else {
|
||||||
target = { id: this.props.targetId };
|
target = { id: this.props.targetId };
|
||||||
}
|
}
|
||||||
|
this.selectOptions = [];
|
||||||
this.props.onCrawlerReadAllByTarget(target);
|
this.props.onCrawlerReadAllByTarget(target);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import {
|
||||||
SensorConfigStepperDispatchProps,
|
SensorConfigStepperDispatchProps,
|
||||||
} from './components/SensorConfigStepper';
|
} from './components/SensorConfigStepper';
|
||||||
// import State from '../redux/state/ReadAllByTarget';
|
// import State from '../redux/state/ReadAllByTarget';
|
||||||
|
import { push as routerPush } from 'react-router-redux';
|
||||||
|
|
||||||
import Target from '@overflow/target/api/model/Target';
|
import Target from '@overflow/target/api/model/Target';
|
||||||
import Sensor from '@overflow/sensor/api/model/Sensor';
|
import Sensor from '@overflow/sensor/api/model/Sensor';
|
||||||
|
@ -32,6 +33,12 @@ export function mapDispatchToProps(dispatch: Dispatch<any>): SensorConfigStepper
|
||||||
dispatch(asyncRequestActions.request('SensorService', 'registSensorConfig', RegistSensorConfigActions.REQUEST,
|
dispatch(asyncRequestActions.request('SensorService', 'registSensorConfig', RegistSensorConfigActions.REQUEST,
|
||||||
JSON.stringify(sensor), JSON.stringify(sensorItemList)));
|
JSON.stringify(sensor), JSON.stringify(sensorItemList)));
|
||||||
},
|
},
|
||||||
|
onMoveSensors: () => {
|
||||||
|
dispatch(routerPush('/sensors'));
|
||||||
|
},
|
||||||
|
onMoveTargetSensors: (infraId: number) => {
|
||||||
|
dispatch(routerPush('/target/' + String(infraId) + '/sensor'));
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,8 @@ export interface SensorConfigStepperStateProps {
|
||||||
|
|
||||||
export interface SensorConfigStepperDispatchProps {
|
export interface SensorConfigStepperDispatchProps {
|
||||||
onRegistSensorConfig?(sensor: Sensor, sensorItemList: SensorItem[]): void;
|
onRegistSensorConfig?(sensor: Sensor, sensorItemList: SensorItem[]): void;
|
||||||
|
onMoveSensors?(): void;
|
||||||
|
onMoveTargetSensors?(targetId: number): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SensorConfigStepperProps = SensorConfigStepperStateProps & SensorConfigStepperDispatchProps;
|
export type SensorConfigStepperProps = SensorConfigStepperStateProps & SensorConfigStepperDispatchProps;
|
||||||
|
@ -115,6 +117,12 @@ export class SensorConfigStepper extends React.Component<SensorConfigStepperProp
|
||||||
console.log('Done');
|
console.log('Done');
|
||||||
console.log(this.props.getSensor());
|
console.log(this.props.getSensor());
|
||||||
this.registSensor();
|
this.registSensor();
|
||||||
|
if (this.props.infraId === undefined) {
|
||||||
|
this.props.onMoveSensors();
|
||||||
|
} else {
|
||||||
|
this.props.onMoveTargetSensors(this.props.infraId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user