added discovery result
This commit is contained in:
parent
11c538ff8b
commit
c53bc7961c
|
@ -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 MetaSensorItemReadAllReducer from '@overflow/meta/redux/reducer/sensor_item_read_all';
|
||||||
import MetaSensorItemTypeReadAllReducer from '@overflow/meta/redux/reducer/sensor_item_type_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';
|
import AsyncRequest from '@overflow/app/redux/saga/AsyncRequest';
|
||||||
|
|
||||||
// Container Configuration
|
// Container Configuration
|
||||||
|
@ -91,6 +93,7 @@ const reduxConfig: ReduxConfig = {
|
||||||
noauthAcceptReducer,
|
noauthAcceptReducer,
|
||||||
noauthDenyReducer,
|
noauthDenyReducer,
|
||||||
modifyProbeReducer,
|
modifyProbeReducer,
|
||||||
|
DiscoveryInfraTargetRegistAllReducer,
|
||||||
],
|
],
|
||||||
sagaWatchers: [
|
sagaWatchers: [
|
||||||
AsyncRequest,
|
AsyncRequest,
|
||||||
|
|
|
@ -5,7 +5,7 @@ interface DiscoveryStartInfo {
|
||||||
excludeIp: string;
|
excludeIp: string;
|
||||||
startPort: string;
|
startPort: string;
|
||||||
endPort: string;
|
endPort: string;
|
||||||
selectedServices: Array<number | string>;
|
services: Array<number | string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default DiscoveryStartInfo;
|
export default DiscoveryStartInfo;
|
||||||
|
|
|
@ -5,6 +5,11 @@ import {
|
||||||
DispatchProps as DiscoveryDispatchProps,
|
DispatchProps as DiscoveryDispatchProps,
|
||||||
} from './components/Discovery';
|
} 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 {
|
export function mapStateToProps(state: any, props: any): DiscoveryStateProps {
|
||||||
return {
|
return {
|
||||||
|
@ -14,7 +19,6 @@ export function mapStateToProps(state: any, props: any): DiscoveryStateProps {
|
||||||
|
|
||||||
export function mapDispatchToProps(dispatch: Dispatch<any>): DiscoveryDispatchProps {
|
export function mapDispatchToProps(dispatch: Dispatch<any>): DiscoveryDispatchProps {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ import * as asyncRequestActions from '@overflow/commons/redux/action/asyncReques
|
||||||
export function mapStateToProps(state: any, props: any): DiscoveryTreeStateProps {
|
export function mapStateToProps(state: any, props: any): DiscoveryTreeStateProps {
|
||||||
return {
|
return {
|
||||||
probeId: props.probeId,
|
probeId: props.probeId,
|
||||||
|
isSuccess: state.isSuccess,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,14 @@ import DiscoveryTableContainer from '../DiscoveryTable';
|
||||||
import DiscoveryTreeContainer from '../DiscoveryTree';
|
import DiscoveryTreeContainer from '../DiscoveryTree';
|
||||||
|
|
||||||
import Probe from '@overflow/probe/api/model/Probe';
|
import Probe from '@overflow/probe/api/model/Probe';
|
||||||
|
import Host from '@overflow/discovery/api/model/Host';
|
||||||
|
|
||||||
export interface StateProps {
|
export interface StateProps {
|
||||||
probeId?: Number;
|
probeId?: Number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DispatchProps {
|
export interface DispatchProps {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Props = StateProps & DispatchProps;
|
export type Props = StateProps & DispatchProps;
|
||||||
|
@ -74,6 +76,10 @@ export class Discovery extends React.Component<Props, State> {
|
||||||
console.log(this.submitData);
|
console.log(this.submitData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public onPropsCreateTarget = (hosts: Host[], probe: Probe) => {
|
||||||
|
// this.props.onCreateTarget(hosts, probe);
|
||||||
|
// }
|
||||||
|
|
||||||
public handleCancel= () => this.setState({ startPopup: false });
|
public handleCancel= () => this.setState({ startPopup: false });
|
||||||
|
|
||||||
public handlePopupClose = () => this.setState({ startPopup: false });
|
public handlePopupClose = () => this.setState({ startPopup: false });
|
||||||
|
@ -90,7 +96,7 @@ export class Discovery extends React.Component<Props, State> {
|
||||||
<Modal.Header>Discovery</Modal.Header>
|
<Modal.Header>Discovery</Modal.Header>
|
||||||
<Modal.Content >
|
<Modal.Content >
|
||||||
{/*<Checkbox label='IP' />*/}
|
{/*<Checkbox label='IP' />*/}
|
||||||
<DiscoveryTreeContainer probeId={this.props.probeId}/>
|
<DiscoveryTreeContainer probeId={this.props.probeId} />
|
||||||
</Modal.Content>
|
</Modal.Content>
|
||||||
<Modal.Actions>
|
<Modal.Actions>
|
||||||
<Button onClick={this.handleCancel}> Cancel </Button>
|
<Button onClick={this.handleCancel}> Cancel </Button>
|
||||||
|
|
|
@ -25,10 +25,11 @@ import * as Utils from '@overflow/commons/util/Utils';
|
||||||
|
|
||||||
export interface DiscoveryTreeStateProps {
|
export interface DiscoveryTreeStateProps {
|
||||||
probeId: number;
|
probeId: number;
|
||||||
|
isSuccess: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DiscoveryTreeDispatchProps {
|
export interface DiscoveryTreeDispatchProps {
|
||||||
onCreateTarget?(hosts: Host[], probe: Probe): void;
|
onCreateTarget?(hosts: Host[], probe: Probe): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type DiscoveryTreeProps = DiscoveryTreeStateProps & DiscoveryTreeDispatchProps;
|
export type DiscoveryTreeProps = DiscoveryTreeStateProps & DiscoveryTreeDispatchProps;
|
||||||
|
@ -64,7 +65,7 @@ export class DiscoveryTree extends React.Component<DiscoveryTreeProps, Discovery
|
||||||
this.selectedHostState = new Map;
|
this.selectedHostState = new Map;
|
||||||
this.selectedPortState = new Map;
|
this.selectedPortState = new Map;
|
||||||
this.selectedServiceState = new Map;
|
this.selectedServiceState = new Map;
|
||||||
this.discoveryHosts = hostListJson;
|
this.discoveryHosts = hostListJsonMini;
|
||||||
// fs.readFile('../../../../../dh.json', this.handlJSONFile);
|
// fs.readFile('../../../../../dh.json', this.handlJSONFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,6 +199,10 @@ export class DiscoveryTree extends React.Component<DiscoveryTreeProps, Discovery
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
|
||||||
|
if(this.props.isSuccess !== undefined) {
|
||||||
|
alert('infra created');
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container fluid>
|
<Container fluid>
|
||||||
<List selection>
|
<List selection>
|
||||||
|
@ -227,7 +232,8 @@ export class DiscoveryTree extends React.Component<DiscoveryTreeProps, Discovery
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const hostListJson: any = [{
|
const hostListJson: any = [
|
||||||
|
{
|
||||||
'firstScanRange': 1,
|
'firstScanRange': 1,
|
||||||
'lastScanRange': 10000,
|
'lastScanRange': 10000,
|
||||||
'name': '',
|
'name': '',
|
||||||
|
@ -401,4 +407,46 @@ const hostListJson: any = [{
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const jsonData = hostListJson;
|
|
||||||
|
const hostListJsonMini: any = [
|
||||||
|
{
|
||||||
|
'firstScanRange': 1,
|
||||||
|
'lastScanRange': 10000,
|
||||||
|
'name': '',
|
||||||
|
'ip': 3232235797,
|
||||||
|
'mac': 91754662913,
|
||||||
|
'os': 'Windows',
|
||||||
|
'target': true,
|
||||||
|
'ports': [
|
||||||
|
{
|
||||||
|
'createDate': -62135596800000,
|
||||||
|
'updateDate': -62135596800000,
|
||||||
|
'services': [{
|
||||||
|
'createDate': -62135596800000,
|
||||||
|
'updateDate': -62135596800000,
|
||||||
|
'portType': 'TCP',
|
||||||
|
'serviceName': 'HTTP',
|
||||||
|
}],
|
||||||
|
'portType': 'TCP',
|
||||||
|
'portNumber': 3343,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'createDate': -62135596800000,
|
||||||
|
'updateDate': -62135596800000,
|
||||||
|
'services': [{
|
||||||
|
'createDate': -62135596800000,
|
||||||
|
'updateDate': -62135596800000,
|
||||||
|
'portType': 'TCP',
|
||||||
|
'serviceName': 'HTTP',
|
||||||
|
}],
|
||||||
|
'portType': 'TCP',
|
||||||
|
'portNumber': 443,
|
||||||
|
}],
|
||||||
|
'createDate': 1498470178000,
|
||||||
|
'updateDate': 1498470178000,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,8 @@ import Infra from '@overflow/infra/api/model/Infra';
|
||||||
import Probe from '@overflow/probe/api/model/Probe';
|
import Probe from '@overflow/probe/api/model/Probe';
|
||||||
import Domain from '@overflow/domain/api/model/Domain';
|
import Domain from '@overflow/domain/api/model/Domain';
|
||||||
import { ListContainer } from '@overflow/commons/react/component/ListContainer';
|
import { ListContainer } from '@overflow/commons/react/component/ListContainer';
|
||||||
import DiscoveryContainer from '../../../discovery/react/Discovery';
|
import DiscoveryContainer from '@overflow/discovery/react/Discovery';
|
||||||
|
import Host from '@overflow/discovery/api/model/Host';
|
||||||
|
|
||||||
import * as Utils from '@overflow/commons/util/Utils';
|
import * as Utils from '@overflow/commons/util/Utils';
|
||||||
|
|
||||||
|
@ -14,6 +15,9 @@ export interface StateProps {
|
||||||
infraList?: Infra[];
|
infraList?: Infra[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export interface DispatchProps {
|
export interface DispatchProps {
|
||||||
onReadAllByProbe?(probe: Probe): void;
|
onReadAllByProbe?(probe: Probe): void;
|
||||||
onReadAllByDomain?(domain: Domain): void;
|
onReadAllByDomain?(domain: Domain): void;
|
||||||
|
@ -133,7 +137,7 @@ export class TargetList extends React.Component<Props, State> {
|
||||||
{/*Adding a Target*/}
|
{/*Adding a Target*/}
|
||||||
{/*</Modal.Header>*/}
|
{/*</Modal.Header>*/}
|
||||||
<Modal.Content>
|
<Modal.Content>
|
||||||
<DiscoveryContainer probeId={Number(this.props.probeId)}/>
|
<DiscoveryContainer probeId={1}/>
|
||||||
</Modal.Content>
|
</Modal.Content>
|
||||||
<Modal.Actions>
|
<Modal.Actions>
|
||||||
<Button onClick={() => this.setState({ openAddTarget: false })}>Cancel</Button>
|
<Button onClick={() => this.setState({ openAddTarget: false })}>Cancel</Button>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user