cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/master to e7ad33c
Date Tue, 11 Mar 2014 22:39:44 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 3e097a0fb -> e7ad33c45


CLOUDSTACK-6229: UI > Delete Host action > if hypervisor is XenServer, display 'The
host has been deleted. Please eject the host from XenServer Pool'.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e7ad33c4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e7ad33c4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e7ad33c4

Branch: refs/heads/master
Commit: e7ad33c456d79cab6241c7f3ab83415cd7f3e942
Parents: 3e097a0
Author: Jessica Wang <jessicawang@apache.org>
Authored: Tue Mar 11 15:15:17 2014 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Tue Mar 11 15:15:17 2014 -0700

----------------------------------------------------------------------
 ui/scripts/system.js | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e7ad33c4/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index bfdc8d5..cdd02b2 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -14762,9 +14762,9 @@
                                         return 'label.action.remove.host';
                                     }
                                 },
-                                preFilter: function (args) {
-                                    if (isAdmin()) {
-                                        args.$form.find('.form-item[rel=isForced]').css('display',
'inline-block');
+                                preFilter: function(args) { //bug to fix: preFilter is not
picked up from here                              
+                                	if (!isAdmin()) {
+                                        args.$form.find('.form-item[rel=isForced]').hide();
                                     }
                                 },
                                 createForm: {
@@ -14774,25 +14774,33 @@
                                         isForced: {
                                             label: 'force.remove',
                                             isBoolean: true,
-                                            isHidden: true
+                                            isHidden: false
                                         }
                                     }
                                 },
                                 action: function (args) {
-                                    var array1 =[];
-                                    //if(args.$form.find('.form-item[rel=isForced]').css("display")
!= "none") //uncomment after Brian fix it to include $form in args
-                                    array1.push("&forced=" + (args.data.isForced == "on"));
+                                    var data = {
+                                    	id: args.context.hosts[0].id
+                                    };                                    
+                                    if(args.$form.find('.form-item[rel=isForced]').css("display")
!= "none") {
+                                    	$.extend(data, {
+                                    		forced: (args.data.isForced == "on")
+                                    	});                                    	
+                                    }
                                     
                                     $.ajax({
-                                        url: createURL("deleteHost&id=" + args.context.hosts[0].id
+ array1.join("")),
-                                        dataType: "json",
-                                        async: true,
+                                        url: createURL("deleteHost"),
+                                        data: data,
                                         success: function (json) {
                                             //{ "deletehostresponse" : { "success" : "true"}
 }
                                             args.response.success({
                                                 data: {
                                                 }
                                             });
+                                            
+                                            if (args.context.hosts[0].hypervisor == "XenServer"){
+                                            	cloudStack.dialog.notice({ message: _s("The
host has been deleted. Please eject the host from XenServer Pool") })
+                                            }                                           

                                         }
                                     });
                                 },


Mime
View raw message