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