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/15 07:49:55 UTC
git commit: updated refs/heads/UI-explicitDedication to f4d9a8a
Updated Branches:
refs/heads/UI-explicitDedication 79e41fa71 -> f4d9a8aaf
Explicit Dedication - Cluster 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/f4d9a8aa
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f4d9a8aa
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f4d9a8aa
Branch: refs/heads/UI-explicitDedication
Commit: f4d9a8aaf6dff3673b4063c48629c9b689071457
Parents: 79e41fa
Author: Pranav Saxena <pr...@citrix.com>
Authored: Wed May 15 11:19:18 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Wed May 15 11:19:18 2013 +0530
----------------------------------------------------------------------
ui/scripts/system.js | 32 +++++++++++++++++++++++++++++---
1 files changed, 29 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f4d9a8aa/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 1c1bd07..119e8f6 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8895,21 +8895,47 @@
clusterName = hostname + "/" + dcName + "/" + clusterName; //override clusterName
}
array1.push("&clustername=" + todb(clusterName));
-
+ var clusterId = null;
$.ajax({
url: createURL("addCluster" + array1.join("")),
dataType: "json",
async: true,
success: function(json) {
var item = json.addclusterresponse.cluster[0];
- args.response.success({
+ clusterId= json.addclusterresponse.cluster[0].id;
+ /* args.response.success({
data: $.extend(item, { state: 'Enabled' })
});
},
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("dedicateCluster&clusterId=" +clusterId +"&domainId=" +args.data.domainId + array2.join("")),
+ dataType:"json",
+ success:function(json){
+ var dedicatedObj = json.dedicateclusterresponse.cluster;
+ args.response.success({ data: $.extend(item, dedicatedObj , {state:'Enabled'}) });
+
+ },
+
+ error:function(json){
+ args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+ }
+ });
+ }
+ }
+
});
},