cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pran...@apache.org
Subject git commit: updated refs/heads/UI-explicitDedication to 79e41fa
Date Wed, 15 May 2013 05:21:59 GMT
Updated Branches:
  refs/heads/UI-explicitDedication 6d2053170 -> 79e41fa71


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/79e41fa7
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/79e41fa7
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/79e41fa7

Branch: refs/heads/UI-explicitDedication
Commit: 79e41fa718188c43c0a6a1e6359e23d930e92c37
Parents: 6d20531
Author: Pranav Saxena <pranav.saxena@citrix.com>
Authored: Wed May 15 10:48:43 2013 +0530
Committer: Pranav Saxena <pranav.saxena@citrix.com>
Committed: Wed May 15 10:48:43 2013 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79e41fa7/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 592c238..1c1bd07 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8064,7 +8064,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)});
 
                          },
@@ -9819,21 +9819,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));
+                         }
+                       });
+                   }
+                 }
                 });
               },
 


Mime
View raw message