Repository: cloudstack
Updated Branches:
  refs/heads/4.4 9427f6163 -> c78e7a01e


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

Branch: refs/heads/4.4
Commit: c78e7a01e1dea7044dd28d602e2ed2bec32c2e8a
Parents: 9427f61
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:03 2014 -0700

----------------------------------------------------------------------
 ui/scripts/ui-custom/instanceWizard.js | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c78e7a01/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() {

Reply via email to