discovery
This commit is contained in:
parent
c827892a86
commit
1275c1755d
|
@ -5,6 +5,7 @@ import {
|
|||
DispatchProps as ProbeDetailDispatchProps,
|
||||
} from './components/ProbeDetailInfo';
|
||||
import { push as routerPush } from 'react-router-redux';
|
||||
import Probe from '@overflow/probe/api/model/Probe';
|
||||
|
||||
|
||||
export function mapStateToProps(state: any, props: any): ProbeDetailStateProps {
|
||||
|
@ -15,6 +16,9 @@ export function mapStateToProps(state: any, props: any): ProbeDetailStateProps {
|
|||
|
||||
export function mapDispatchToProps(dispatch: Dispatch<any>): ProbeDetailDispatchProps {
|
||||
return {
|
||||
onDiscoveryClick: ( id: string) => {
|
||||
dispatch(routerPush( id + '/ targets' ));
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -15,14 +15,14 @@ export interface StateProps {
|
|||
}
|
||||
|
||||
export interface DispatchProps {
|
||||
// onDiscoverySelect(id:string):void;
|
||||
onDiscoveryClick(id:string):void;
|
||||
}
|
||||
|
||||
export type Props = StateProps & DispatchProps;
|
||||
|
||||
export interface State {
|
||||
probe: any; // todo. fix to Probe
|
||||
isDiscovery: boolean;
|
||||
// isDiscovery: boolean;
|
||||
}
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@ export class ProbeDetailInfo extends React.Component<Props, State> {
|
|||
super(props, context);
|
||||
this.state = {
|
||||
probe: null,
|
||||
isDiscovery: false,
|
||||
// isDiscovery: false,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ export class ProbeDetailInfo extends React.Component<Props, State> {
|
|||
|
||||
this.setState({
|
||||
probe: p,
|
||||
isDiscovery: false,
|
||||
// isDiscovery: false,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -77,15 +77,17 @@ export class ProbeDetailInfo extends React.Component<Props, State> {
|
|||
|
||||
public handleDiscovery = (event: any, data: any): void => {
|
||||
console.log(event);
|
||||
this.setState({ isDiscovery: true });
|
||||
// this.setState({ isDiscovery: true });
|
||||
this.props.onDiscoveryClick('11');
|
||||
}
|
||||
|
||||
public renderDiscovery(): JSX.Element {
|
||||
if (this.state.isDiscovery) {
|
||||
return <Discovery />;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// public renderDiscovery(): JSX.Element {
|
||||
// if (this.state.isDiscovery) {
|
||||
// return <Discovery />;
|
||||
// }
|
||||
// return null;
|
||||
//
|
||||
// }
|
||||
|
||||
public showStartStopBtn(): JSX.Element {
|
||||
if (this.state.probe.status.name === 'STARTED') {
|
||||
|
|
Loading…
Reference in New Issue
Block a user