You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pr...@apache.org on 2013/05/31 06:35:56 UTC

[06/25] git commit: updated refs/heads/master to 2f29185

Explicit Dedication - Host UI/API Integration code


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

Branch: refs/heads/master
Commit: 60ff005939fa81d9820ffaab0f58126a33af67e2
Parents: 97cb514
Author: Pranav Saxena <pr...@citrix.com>
Authored: Wed May 15 10:48:43 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:10 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |   35 +++++++++++++++++++++++++++++++----
 1 files changed, 31 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/60ff0059/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index b0bc9a1..8133509 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8599,7 +8599,7 @@
                          url:createURL("dedicatePod&podId=" +podId +"&domainId=" +args.data.domainId + array2.join("")),
                          dataType:"json",
                          success:function(json){
-                             var dedicatedObj = json.dedicatepodresponse.host;
+                             var dedicatedObj = json.dedicatepodresponse.pod;
                              args.response.success({ data: $.extend(item, dedicatedObj)});
 
                          },
@@ -10354,21 +10354,48 @@
 										});									
                   }
                 }
-
+             
+                var hostId = null;
                 $.ajax({
                   url: createURL("addHost"),
                   type: "POST",
 									data: data,
                   success: function(json) {
                     var item = json.addhostresponse.host[0];
-                    args.response.success({
+                    hostId = json.addhostresponse.host[0].id;
+
+               /*     args.response.success({
                       data: item
                     });
                   },
                   error: function(XMLHttpResponse) {
                     var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                     args.response.error(errorMsg);
-                  }
+                  }*/
+
+                       //EXPLICIT DEDICATION
+                if(args.$form.find('.form-item[rel=isDedicated]').find('input[type=checkbox]').is(':Checked')== true){
+                      var array2 = [];
+                      if(args.data.accountId != "")
+                        array2.push("&accountId=" +todb(args.data.accountId));
+                    }
+
+                    if(hostId != null){
+                      $.ajax({
+                         url:createURL("dedicateHost&hostId=" +hostId +"&domainId=" +args.data.domainId + array2.join("")),
+                         dataType:"json",
+                         success:function(json){
+                             var dedicatedObj = json.dedicatehostresponse.host;
+                             args.response.success({  data: $.extend(item, dedicatedObj) });
+
+                         },
+
+                         error:function(json){
+                           args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+                         }
+                       });
+                   }
+                 }
                 });
               },