You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ml...@apache.org on 2014/03/14 06:34:05 UTC

[13/53] [abbrv] git commit: updated refs/heads/resize-root to f52c743

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/resize-root
Commit: e7ad33c456d79cab6241c7f3ab83415cd7f3e942
Parents: 3e097a0
Author: Jessica Wang <je...@apache.org>
Authored: Tue Mar 11 15:15:17 2014 -0700
Committer: Jessica Wang <je...@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") })
+                                            }                                            
                                         }
                                     });
                                 },