diff --git a/src/ts/@overflow/app/config/index.ts b/src/ts/@overflow/app/config/index.ts index 514f45d..31c37a6 100644 --- a/src/ts/@overflow/app/config/index.ts +++ b/src/ts/@overflow/app/config/index.ts @@ -104,11 +104,8 @@ const reduxConfig: ReduxConfig = { modifyProbeReducer, DiscoveryInfraTargetRegistAllReducer, HistoryReadAllByProbeReducer, -<<<<<<< 15ea4947a2911a013b4ba1377088e49bd993a7fa HistoryReadAllByProbeAndTypeReducer, -======= readAllTargetByInfraReducer, ->>>>>>> fixed target / sensor ], sagaWatchers: [ AsyncRequest, diff --git a/src/ts/@overflow/sensor/react/SensorConfiguration.tsx b/src/ts/@overflow/sensor/react/SensorConfiguration.tsx index 9125dbf..8df04d4 100644 --- a/src/ts/@overflow/sensor/react/SensorConfiguration.tsx +++ b/src/ts/@overflow/sensor/react/SensorConfiguration.tsx @@ -8,6 +8,7 @@ import { import Target from '@overflow/target/api/model/Target'; import Sensor from '@overflow/sensor/api/model/Sensor'; +import Domain from '@overflow/domain/api/model/Domain'; import MetaSensorItem from '@overflow/meta/api/model/MetaSensorItem'; import * as CrawlerReadAllByTargetActions from '@overflow/meta/redux/action/crawler_read_all_by_target'; @@ -15,12 +16,14 @@ import * as SensorItemReadAllActions from '@overflow/meta/redux/action/sensor_it import * as RegistActions from '../redux/action/regist'; import * as asyncRequestActions from '@overflow/commons/redux/action/asyncRequest'; +import * as targetListActions from '@overflow/target/redux/action/read_all_by_probe'; // FIXME::.... export function mapStateToProps(state: any, props: any): SensorConfigurationStateProps { return { - targetId: props.params.id, + infraList: state.infraList, + infraId: props.params.id, }; } @@ -29,6 +32,9 @@ export function mapDispatchToProps(dispatch: Dispatch): SensorConfiguration onCrawlerReadAllByTarget: (target: Target) => { dispatch(asyncRequestActions.request('MetaCrawlerService', 'readAll', CrawlerReadAllByTargetActions.REQUEST)); }, + onReadAllTargetByDomain: (domain: Domain) => { + dispatch(asyncRequestActions.request('InfraService', 'readAllByDomain', targetListActions.REQUEST, JSON.stringify(domain))); + }, onCheckCrawlerAuth: (authInfo: string) => { // dispatch(ReadActions.request(id)); }, diff --git a/src/ts/@overflow/sensor/react/SensorList.tsx b/src/ts/@overflow/sensor/react/SensorList.tsx index 9f0a603..3c31795 100644 --- a/src/ts/@overflow/sensor/react/SensorList.tsx +++ b/src/ts/@overflow/sensor/react/SensorList.tsx @@ -24,7 +24,7 @@ import * as asyncRequestActions from '@overflow/commons/redux/action/asyncReques export function mapStateToProps(state: any, props: any): SensorListStateProps { return { sensorList:state.SensorList, - targetId: props.params.id, + infraId: props.params.id, }; } @@ -33,8 +33,8 @@ export function mapDispatchToProps(dispatch: Dispatch): SensorListDispatchP onReadAllByTarget: (target: Target) => { dispatch(asyncRequestActions.request('SensorService', 'readAllByTarget', ReadAllByTargetActions.REQUEST, JSON.stringify(target))); }, - onReadAllByInfra: (infra: Infra) => { - dispatch(asyncRequestActions.request('SensorService', 'readAllByInfra', ReadAllByInfraActions.REQUEST, JSON.stringify(infra))); + onReadAllByInfra: (infraId: number) => { + dispatch(asyncRequestActions.request('SensorService', 'readAllByInfra', ReadAllByInfraActions.REQUEST, infraId)); }, onReadAllByProbe: (probe: Probe) => { dispatch(ReadAllByProbeActions.request(probe)); @@ -45,8 +45,8 @@ export function mapDispatchToProps(dispatch: Dispatch): SensorListDispatchP onSelectSensor: (id: number) => { dispatch(routerPush('/sensor/' + String(id))); }, - onAddSensor: (targetId: string) => { - dispatch(routerPush('/sensor_setup/' + String(targetId))); + onAddSensor: (infraId: string) => { + dispatch(routerPush('/sensor_setup/' + String(infraId))); }, }; } diff --git a/src/ts/@overflow/sensor/react/components/SensorConfiguration.tsx b/src/ts/@overflow/sensor/react/components/SensorConfiguration.tsx index c676984..efb4959 100644 --- a/src/ts/@overflow/sensor/react/components/SensorConfiguration.tsx +++ b/src/ts/@overflow/sensor/react/components/SensorConfiguration.tsx @@ -3,16 +3,19 @@ import { Icon, Step, Button, Table, Radio, Form, Container, Checkbox } from 'sem import { Grid, Image, Label, Segment, Dropdown, Input, List, Accordion, Loader } from 'semantic-ui-react'; import MetaCrawler from '@overflow/meta/api/model/MetaCrawler'; +import Infra from '@overflow/infra/api/model/Infra'; +import Domain from '@overflow/domain/api/model/Domain'; import SensorItemTree from '@overflow/meta/react/SensorItemTree'; import CrawlerSelectorContainer from '@overflow/meta/react/CrawlerSelector'; export interface SensorConfigurationStateProps { - targetId: number; + infraId?: number; + infraList?: Infra[]; } export interface SensorConfigurationDispatchProps { - + onReadAllTargetByDomain?(domain: Domain): void; } export interface SensorConfigurationState { @@ -125,6 +128,18 @@ export class ConfigStepper extends React.Component = new Array; + + elems.push( + , + ); + + return null; + } + public render(): JSX.Element { return ( diff --git a/src/ts/@overflow/sensor/react/components/SensorList.tsx b/src/ts/@overflow/sensor/react/components/SensorList.tsx index 5425dcb..c0bd90f 100644 --- a/src/ts/@overflow/sensor/react/components/SensorList.tsx +++ b/src/ts/@overflow/sensor/react/components/SensorList.tsx @@ -12,7 +12,7 @@ export interface StateProps { probe?: Probe; target?: Target; sensorList?: Sensor[]; - targetId?: number; + infraId?: number; } export interface DispatchProps { @@ -44,16 +44,13 @@ export class SensorList extends React.Component