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