added test discovery button
This commit is contained in:
parent
aeb077e709
commit
8e7af6db75
|
@ -17,6 +17,10 @@ export class DiscoveryService extends Service {
|
|||
// state change test
|
||||
}
|
||||
|
||||
public discoveryIngTest(params: any): void {
|
||||
console.log(params);
|
||||
}
|
||||
|
||||
public discoveryIngHost(params: any): void {
|
||||
|
||||
let host: Host = params;
|
||||
|
|
|
@ -26,6 +26,10 @@ export function mapDispatchToProps(dispatch: Dispatch<any>): DiscoveryDispatchPr
|
|||
dispatch(asyncRequestActions.request('TargetDiscoveryService', 'saveAllTarget',
|
||||
InfraTargetRegistAllActionTypes.REQUEST, JSON.stringify(hosts), JSON.stringify(probe)));
|
||||
},
|
||||
onTestDiscovery: (types: string, obj: string) => {
|
||||
dispatch(asyncRequestActions.request('DiscoveryService', 'testDiscovery',
|
||||
'DiscoveryTTTTTEEEESSSTTT', types, obj));
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ export interface StateProps {
|
|||
|
||||
export interface DispatchProps {
|
||||
onCreateTarget?(hosts: Host[], probe: Probe): void;
|
||||
onTestDiscovery?(types: string, obj: string): void;
|
||||
}
|
||||
|
||||
export type Props = StateProps & DispatchProps;
|
||||
|
@ -78,6 +79,10 @@ export class Discovery extends React.Component<Props, State> {
|
|||
|
||||
public handleCancel = () => this.setState({ startPopup: false });
|
||||
|
||||
public handleTest = () => {
|
||||
this.props.onTestDiscovery('1', 'host json');
|
||||
}
|
||||
|
||||
public handlePopupClose = () => this.setState({ startPopup: false });
|
||||
|
||||
public render(): JSX.Element {
|
||||
|
@ -98,6 +103,7 @@ export class Discovery extends React.Component<Props, State> {
|
|||
</Modal.Content>
|
||||
<Modal.Actions>
|
||||
<Button onClick={this.handleCancel}> Cancel </Button>
|
||||
<Button onClick={this.handleTest}> Test </Button>
|
||||
<Button onClick={this.handleSubmit.bind(this)} primary> Submit </Button>
|
||||
</Modal.Actions>
|
||||
</Modal>
|
||||
|
|
Loading…
Reference in New Issue
Block a user