added test discovery button

This commit is contained in:
snoop 2017-10-13 18:03:24 +09:00
parent aeb077e709
commit 8e7af6db75
3 changed files with 14 additions and 0 deletions

View File

@ -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;

View File

@ -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));
},
};
}

View File

@ -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>