Only submit import definitions if a file has been selected
rabbitmq-management#389
This commit is contained in:
		
							parent
							
								
									fc7f5183c7
								
							
						
					
					
						commit
						efedce7c99
					
				|  | @ -522,13 +522,17 @@ function show_popup(type, text, mode) { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| function submit_import(form) { | function submit_import(form) { | ||||||
|     var confirm_upload = confirm('Are you sure? Vhost configuration will be overriden.'); |     if (form.file.value) { | ||||||
|     if (confirm_upload == true) { |         var confirm_upload = confirm('Are you sure? Vhost configuration will be overriden.'); | ||||||
|         var idx = $("select[name='vhost-upload'] option:selected").index(); |         if (confirm_upload == true) { | ||||||
|         var vhost = ((idx <=0 ) ? "" : "/" + esc($("select[name='vhost-upload'] option:selected").val())); |             var idx = $("select[name='vhost-upload'] option:selected").index(); | ||||||
|         form.action ="api/definitions" + vhost + '?auth=' + get_cookie_value('auth'); |             var vhost = ((idx <=0 ) ? "" : "/" + esc($("select[name='vhost-upload'] option:selected").val())); | ||||||
|         form.submit(); |             form.action ="api/definitions" + vhost + '?auth=' + get_cookie_value('auth'); | ||||||
|         window.location.replace("../../#/import-succeeded"); |             form.submit(); | ||||||
|  |             window.location.replace("../../#/import-succeeded"); | ||||||
|  |         } else { | ||||||
|  |             return false; | ||||||
|  |         } | ||||||
|     } else { |     } else { | ||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue