Repository: cloudstack Updated Branches: refs/heads/master c6190a1c6 -> 28aa9001c
Instance wizard UI: Pass data for multi-disk service offerings Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/28aa9001 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/28aa9001 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/28aa9001 Branch: refs/heads/master Commit: 28aa9001c5db2fcc9e6cff98d15d89a1a9170703 Parents: c6190a1 Author: Brian Federle <[email protected]> Authored: Thu Apr 3 14:52:03 2014 -0700 Committer: Brian Federle <[email protected]> Committed: Thu Apr 3 14:52:33 2014 -0700 ---------------------------------------------------------------------- ui/scripts/ui-custom/instanceWizard.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/28aa9001/ui/scripts/ui-custom/instanceWizard.js ---------------------------------------------------------------------- diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js index 0174cfc..527dc10 100644 --- a/ui/scripts/ui-custom/instanceWizard.js +++ b/ui/scripts/ui-custom/instanceWizard.js @@ -59,6 +59,24 @@ }); data['new-network-ip'] = $form.find('.new-network .select.advanced .specify-ip input[type=text]').val(); + // Handle multi-disk service offerings + if ($form.find('.multi-disk-select-container').size()) { + data['disk-offerings-multi'] = []; + + var $diskGroups = $form.find('.disk-select-group'); + var $selectedDisks = $.grep($diskGroups, function (diskGroup) { + return $(diskGroup).find('input[type=checkbox]:checked').size(); + }); + + $selectedDisks.map(function (disk) { + data['disk-offerings-multi'].push( + $.extend($(disk).data('json-obj'), { + _diskOfferingId: $(disk).find('input[type=radio]:checked').val() + }) + ); + }); + } + args.action({ // Populate data context: context, @@ -531,6 +549,7 @@ ).appendTo($group).addClass('multi-disk'); $group.appendTo($multiDiskSelect); + $group.data('json-obj', disk); // Show-hide disk group selects $checkbox.click(function() {
