gggggggggggggggggggg
This commit is contained in:
commit
547fc2a84b
|
@ -7,6 +7,8 @@ import LeftMenu from './LeftMenu';
|
|||
|
||||
import ProbeList from '../monitoring/probe/List';
|
||||
import ProbeDetail from '../monitoring/probe/Detail';
|
||||
import SensorList from '../monitoring/sensor/List';
|
||||
import SensorSetup from '../monitoring/sensor/Setup';
|
||||
|
||||
export interface Props extends RouteComponentProps<any> {
|
||||
}
|
||||
|
@ -38,6 +40,9 @@ export class AppLayout extends React.Component<Props, State> {
|
|||
|
||||
<Route exact path={`${this.props.match.url}/probe`} component={ProbeList} />
|
||||
<Route exact path={`${this.props.match.url}/probe/:id`} component={ProbeDetail} />
|
||||
<Route path={`${this.props.match.url}/probe`} component={ProbeList} />
|
||||
<Route path={`${this.props.match.url}/sensor_list`} component={SensorList} />
|
||||
<Route path={`${this.props.match.url}/sensor_setup`} component={SensorSetup} />
|
||||
|
||||
<Footer />
|
||||
</Segment>
|
||||
|
|
|
@ -7,8 +7,12 @@ import {
|
|||
import State from '../redux/state/ReadAllByTarget';
|
||||
|
||||
import * as ReadAllByTargetActions from '../redux/action/read_all_by_target';
|
||||
import * as ReadAllByProbeActions from '../redux/action/read_all_by_probe';
|
||||
import * as ReadAllByDomainActions from '../redux/action/read_all_by_domain';
|
||||
import Target from '@overflow/target/api/model/Target';
|
||||
import Sensor from '@overflow/sensor/api/model/Sensor';
|
||||
import Probe from '@overflow/probe/api/model/Probe';
|
||||
import Domain from '@overflow/domain/api/model/Domain';
|
||||
|
||||
export function mapStateToProps(state: any): SensorListStateProps {
|
||||
return {
|
||||
|
@ -20,6 +24,12 @@ export function mapDispatchToProps(dispatch: Dispatch<any>): SensorListDispatchP
|
|||
onReadAllByTarget: (target: Target) => {
|
||||
dispatch(ReadAllByTargetActions.request(target));
|
||||
},
|
||||
onReadAllByProbe: (probe: Probe) => {
|
||||
dispatch(ReadAllByProbeActions.request(probe));
|
||||
},
|
||||
onReadAllByDomain: (domain: Domain) => {
|
||||
dispatch(ReadAllByDomainActions.request(domain));
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -5,13 +5,17 @@ import SensorDetailContainer from '../SensorDetail';
|
|||
import Probe from '@overflow/probe/api/model/Probe';
|
||||
import Sensor from '@overflow/sensor/api/model/Sensor';
|
||||
import Target from '@overflow/target/api/model/Target';
|
||||
import Domain from '@overflow/domain/api/model/Domain';
|
||||
|
||||
export interface StateProps {
|
||||
probe?: Probe;
|
||||
target?: Target;
|
||||
}
|
||||
|
||||
export interface DispatchProps {
|
||||
onReadAllByTarget?(target: Target): void;
|
||||
onReadAllByProbe?(probe: Probe): void;
|
||||
onReadAllByDomain?(domain: Domain): void;
|
||||
}
|
||||
|
||||
export type SensorListProps = StateProps & DispatchProps;
|
||||
|
|
43
src/ts/@overflow/sensor/redux/action/read_all_by_domain.ts
Normal file
43
src/ts/@overflow/sensor/redux/action/read_all_by_domain.ts
Normal file
|
@ -0,0 +1,43 @@
|
|||
import Action from '@overflow/commons/redux/Action';
|
||||
import Sensor from '../../api/model/Sensor';
|
||||
import ReadAllByDomainPayload from '../payload/ReadAllByDomainPayload';
|
||||
import Domain from '@overflow/domain/api/model/Domain';
|
||||
|
||||
// Action Type
|
||||
export type REQUEST = '@overflow/sensor/read_all_by_domain/REQUEST';
|
||||
export type REQUEST_SUCCESS = '@overflow/sensor/read_all_by_domain/REQUEST_SUCCESS';
|
||||
export type REQUEST_FAILURE = '@overflow/sensor/read_all_by_domain/REQUEST_FAILURE';
|
||||
|
||||
export const REQUEST: REQUEST = '@overflow/sensor/read_all_by_domain/REQUEST';
|
||||
export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/sensor/read_all_by_domain/REQUEST_SUCCESS';
|
||||
export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/sensor/read_all_by_domain/REQUEST_FAILURE';
|
||||
|
||||
// Action Creater
|
||||
export type request = (domain: Domain) => Action<ReadAllByDomainPayload>;
|
||||
export type requestSuccess = (sensors: Sensor[]) => Action<Sensor[]>;
|
||||
export type requestFailure = (error: Error) => Action;
|
||||
|
||||
|
||||
|
||||
export const request: request = (domain: Domain): Action<ReadAllByDomainPayload> => {
|
||||
return {
|
||||
type: REQUEST,
|
||||
payload: {
|
||||
domain: domain,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export const requestSuccess: requestSuccess = (sensors: Sensor[]): Action<Sensor[]> => {
|
||||
return {
|
||||
type: REQUEST_SUCCESS,
|
||||
payload: sensors,
|
||||
};
|
||||
};
|
||||
|
||||
export const requestFailure: requestFailure = (error: Error): Action => {
|
||||
return {
|
||||
type: REQUEST_FAILURE,
|
||||
error: error,
|
||||
};
|
||||
};
|
43
src/ts/@overflow/sensor/redux/action/read_all_by_probe.ts
Normal file
43
src/ts/@overflow/sensor/redux/action/read_all_by_probe.ts
Normal file
|
@ -0,0 +1,43 @@
|
|||
import Action from '@overflow/commons/redux/Action';
|
||||
import Sensor from '../../api/model/Sensor';
|
||||
import ReadAllByProbePayload from '../payload/ReadAllByProbePayload';
|
||||
import Probe from '@overflow/probe/api/model/Probe';
|
||||
|
||||
// Action Type
|
||||
export type REQUEST = '@overflow/sensor/read_all_by_probe/REQUEST';
|
||||
export type REQUEST_SUCCESS = '@overflow/sensor/read_all_by_probe/REQUEST_SUCCESS';
|
||||
export type REQUEST_FAILURE = '@overflow/sensor/read_all_by_probe/REQUEST_FAILURE';
|
||||
|
||||
export const REQUEST: REQUEST = '@overflow/sensor/read_all_by_probe/REQUEST';
|
||||
export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/sensor/read_all_by_probe/REQUEST_SUCCESS';
|
||||
export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/sensor/read_all_by_probe/REQUEST_FAILURE';
|
||||
|
||||
// Action Creater
|
||||
export type request = (probe: Probe) => Action<ReadAllByProbePayload>;
|
||||
export type requestSuccess = (sensors: Sensor[]) => Action<Sensor[]>;
|
||||
export type requestFailure = (error: Error) => Action;
|
||||
|
||||
|
||||
|
||||
export const request: request = (probe: Probe): Action<ReadAllByProbePayload> => {
|
||||
return {
|
||||
type: REQUEST,
|
||||
payload: {
|
||||
probe: probe,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export const requestSuccess: requestSuccess = (sensors: Sensor[]): Action<Sensor[]> => {
|
||||
return {
|
||||
type: REQUEST_SUCCESS,
|
||||
payload: sensors,
|
||||
};
|
||||
};
|
||||
|
||||
export const requestFailure: requestFailure = (error: Error): Action => {
|
||||
return {
|
||||
type: REQUEST_FAILURE,
|
||||
error: error,
|
||||
};
|
||||
};
|
|
@ -0,0 +1,7 @@
|
|||
import Domain from '@overflow/domain/api/model/Domain';
|
||||
|
||||
interface ReadAllByDomainPayload {
|
||||
domain: Domain;
|
||||
}
|
||||
|
||||
export default ReadAllByDomainPayload;
|
|
@ -0,0 +1,7 @@
|
|||
import Probe from '@overflow/probe/api/model/Probe';
|
||||
|
||||
interface ReadAllByProbePayload {
|
||||
probe: Probe;
|
||||
}
|
||||
|
||||
export default ReadAllByProbePayload;
|
Loading…
Reference in New Issue
Block a user