mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	cloudstack 3.0 new UI - instance page - reset password - check whether the instance is password enabled and its state before popping up confirmation box.
This commit is contained in:
		
							parent
							
								
									ee95608741
								
							
						
					
					
						commit
						ad811df23e
					
				| @ -1082,28 +1082,7 @@ | |||||||
|             label: 'Reset password', |             label: 'Reset password', | ||||||
|             messages: { |             messages: { | ||||||
|               confirm: function(args) {                 |               confirm: function(args) {                 | ||||||
|                 /* |                 return 'Please confirm that you want to reset password.'; | ||||||
|                  if (jsonObj.passwordenabled == false) { |  | ||||||
|                  $("#dialog_info") |  | ||||||
|                  .text(dictionary["message.action.reset.password.off"]) |  | ||||||
|                  .dialog('option', 'buttons', { |  | ||||||
|                  "OK": function() { |  | ||||||
|                  $(this).dialog("close"); |  | ||||||
|                  } |  | ||||||
|                  }).dialog("open"); |  | ||||||
|                  return; |  | ||||||
|                  } else if (jsonObj.state != 'Stopped') { |  | ||||||
|                  $("#dialog_info") |  | ||||||
|                  .text(dictionary["message.action.reset.password.warning"]) |  | ||||||
|                  .dialog('option', 'buttons', { |  | ||||||
|                  "OK": function() { |  | ||||||
|                  $(this).dialog("close"); |  | ||||||
|                  } |  | ||||||
|                  }).dialog("open"); |  | ||||||
|                  return; |  | ||||||
|                  } |  | ||||||
|                  */ |  | ||||||
|                 return 'Are you sure you want to reset password?'; |  | ||||||
|               }, |               }, | ||||||
|               success: function(args) { |               success: function(args) { | ||||||
|                 return 'Password is being reset.'; |                 return 'Password is being reset.'; | ||||||
| @ -1115,6 +1094,19 @@ | |||||||
|                 return 'Password has been reset to ' + args.password; |                 return 'Password has been reset to ' + args.password; | ||||||
|               } |               } | ||||||
|             }, |             }, | ||||||
|  | 												 | ||||||
|  | 						preAction: function(args) {     | ||||||
|  | 							var jsonObj = args.context.instances[0];							 | ||||||
|  | 							if (jsonObj.passwordenabled == false) { | ||||||
|  | 							  cloudStack.dialog.notice({ message: 'The template this instance was created with is not password enabled' });							 | ||||||
|  | 								return false; | ||||||
|  | 							}  | ||||||
|  | 							else if (jsonObj.state != 'Stopped') { | ||||||
|  | 								cloudStack.dialog.notice({ message: 'Your instance must be stopped before attempting to change its current password' }); | ||||||
|  | 								return false; | ||||||
|  | 							} | ||||||
|  |             }, | ||||||
|  | 												 | ||||||
|             action: function(args) { |             action: function(args) { | ||||||
|               $.ajax({ |               $.ajax({ | ||||||
|                 url: createURL("resetPasswordForVirtualMachine&id=" + args.data.id), |                 url: createURL("resetPasswordForVirtualMachine&id=" + args.data.id), | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user