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 <[email protected]> Authored: Wed May 15 11:19:18 2013 +0530 Committer: Pranav Saxena <[email protected]> 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)); + } + }); + } + } + }); },
