From c53bc7961cbe268bef7277cfb76427ff847d92ed Mon Sep 17 00:00:00 2001 From: snoop Date: Tue, 22 Aug 2017 21:09:23 +0900 Subject: [PATCH] added discovery result --- src/ts/@overflow/app/config/index.ts | 3 + .../discovery/api/model/DiscoveryStartInfo.ts | 2 +- .../@overflow/discovery/react/Discovery.tsx | 6 +- .../discovery/react/DiscoveryTree.tsx | 1 + .../discovery/react/components/Discovery.tsx | 8 ++- .../react/components/DiscoveryTree.tsx | 56 +++++++++++++++++-- .../target/react/components/TargetList.tsx | 8 ++- 7 files changed, 75 insertions(+), 9 deletions(-) diff --git a/src/ts/@overflow/app/config/index.ts b/src/ts/@overflow/app/config/index.ts index c491900..074e7e4 100644 --- a/src/ts/@overflow/app/config/index.ts +++ b/src/ts/@overflow/app/config/index.ts @@ -33,6 +33,8 @@ import CrawlerAuthInputsReducer from '@overflow/meta/redux/reducer/crawler_auth_ import MetaSensorItemReadAllReducer from '@overflow/meta/redux/reducer/sensor_item_read_all'; import MetaSensorItemTypeReadAllReducer from '@overflow/meta/redux/reducer/sensor_item_type_read_all'; +import DiscoveryInfraTargetRegistAllReducer from '@overflow/discovery/redux/reducer/infra_target_regist_all'; + import AsyncRequest from '@overflow/app/redux/saga/AsyncRequest'; // Container Configuration @@ -91,6 +93,7 @@ const reduxConfig: ReduxConfig = { noauthAcceptReducer, noauthDenyReducer, modifyProbeReducer, + DiscoveryInfraTargetRegistAllReducer, ], sagaWatchers: [ AsyncRequest, diff --git a/src/ts/@overflow/discovery/api/model/DiscoveryStartInfo.ts b/src/ts/@overflow/discovery/api/model/DiscoveryStartInfo.ts index 1cff7ac..8bc3085 100644 --- a/src/ts/@overflow/discovery/api/model/DiscoveryStartInfo.ts +++ b/src/ts/@overflow/discovery/api/model/DiscoveryStartInfo.ts @@ -5,7 +5,7 @@ interface DiscoveryStartInfo { excludeIp: string; startPort: string; endPort: string; - selectedServices: Array; + services: Array; } export default DiscoveryStartInfo; diff --git a/src/ts/@overflow/discovery/react/Discovery.tsx b/src/ts/@overflow/discovery/react/Discovery.tsx index 6a937e1..ff7e8d0 100644 --- a/src/ts/@overflow/discovery/react/Discovery.tsx +++ b/src/ts/@overflow/discovery/react/Discovery.tsx @@ -5,6 +5,11 @@ import { DispatchProps as DiscoveryDispatchProps, } from './components/Discovery'; +import Host from '@overflow/discovery/api/model/Host'; +import Probe from '@overflow/probe/api/model/Probe'; + +import * as InfraTargetRegistAllActionTypes from '../redux/action/infra_target_regist_all'; +import * as asyncRequestActions from '@overflow/commons/redux/action/asyncRequest'; export function mapStateToProps(state: any, props: any): DiscoveryStateProps { return { @@ -14,7 +19,6 @@ export function mapStateToProps(state: any, props: any): DiscoveryStateProps { export function mapDispatchToProps(dispatch: Dispatch): DiscoveryDispatchProps { return { - }; } diff --git a/src/ts/@overflow/discovery/react/DiscoveryTree.tsx b/src/ts/@overflow/discovery/react/DiscoveryTree.tsx index 9667aef..df13bb8 100644 --- a/src/ts/@overflow/discovery/react/DiscoveryTree.tsx +++ b/src/ts/@overflow/discovery/react/DiscoveryTree.tsx @@ -16,6 +16,7 @@ import * as asyncRequestActions from '@overflow/commons/redux/action/asyncReques export function mapStateToProps(state: any, props: any): DiscoveryTreeStateProps { return { probeId: props.probeId, + isSuccess: state.isSuccess, }; } diff --git a/src/ts/@overflow/discovery/react/components/Discovery.tsx b/src/ts/@overflow/discovery/react/components/Discovery.tsx index 5343b20..560dfe4 100644 --- a/src/ts/@overflow/discovery/react/components/Discovery.tsx +++ b/src/ts/@overflow/discovery/react/components/Discovery.tsx @@ -11,12 +11,14 @@ import DiscoveryTableContainer from '../DiscoveryTable'; import DiscoveryTreeContainer from '../DiscoveryTree'; import Probe from '@overflow/probe/api/model/Probe'; +import Host from '@overflow/discovery/api/model/Host'; export interface StateProps { probeId?: Number; } export interface DispatchProps { + } export type Props = StateProps & DispatchProps; @@ -74,6 +76,10 @@ export class Discovery extends React.Component { console.log(this.submitData); } + // public onPropsCreateTarget = (hosts: Host[], probe: Probe) => { + // this.props.onCreateTarget(hosts, probe); + // } + public handleCancel= () => this.setState({ startPopup: false }); public handlePopupClose = () => this.setState({ startPopup: false }); @@ -90,7 +96,7 @@ export class Discovery extends React.Component { Discovery {/**/} - + diff --git a/src/ts/@overflow/discovery/react/components/DiscoveryTree.tsx b/src/ts/@overflow/discovery/react/components/DiscoveryTree.tsx index de930af..4250c9d 100644 --- a/src/ts/@overflow/discovery/react/components/DiscoveryTree.tsx +++ b/src/ts/@overflow/discovery/react/components/DiscoveryTree.tsx @@ -25,10 +25,11 @@ import * as Utils from '@overflow/commons/util/Utils'; export interface DiscoveryTreeStateProps { probeId: number; + isSuccess: boolean; } export interface DiscoveryTreeDispatchProps { - onCreateTarget?(hosts: Host[], probe: Probe): void; +onCreateTarget?(hosts: Host[], probe: Probe): void; } export type DiscoveryTreeProps = DiscoveryTreeStateProps & DiscoveryTreeDispatchProps; @@ -64,7 +65,7 @@ export class DiscoveryTree extends React.Component @@ -227,7 +232,8 @@ export class DiscoveryTree extends React.Component { {/*Adding a Target*/} {/**/} - +