Updated Branches:
  refs/heads/master fbdc7fc59 -> 7e591a442

CS-15811: Network offering: filter by VPC supported services

Introduce a new checkbox which indicates that this service offering is
for VPC networks. If enabled, then only show the VpcVirtualRouter
option for all supported services. If disabled, then disable the
VpcVirtualRouter options

reviewed-by: jessica


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/7e591a44
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/7e591a44
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/7e591a44

Branch: refs/heads/master
Commit: 7e591a442d3db6b96e1b3135be593e86b2f0d64c
Parents: fbdc7fc
Author: Brian Federle <[email protected]>
Authored: Mon Aug 27 15:20:03 2012 -0700
Committer: Brian Federle <[email protected]>
Committed: Mon Aug 27 15:21:08 2012 -0700

----------------------------------------------------------------------
 ui/scripts/configuration.js |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7e591a44/ui/scripts/configuration.js
----------------------------------------------------------------------
diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js
index 85a169b..754a7b4 100644
--- a/ui/scripts/configuration.js
+++ b/ui/scripts/configuration.js
@@ -1269,7 +1269,28 @@
                     }
                   },
 
-                  specifyVlan: { label: 'label.specify.vlan', isBoolean: true 
},                                                                              
                                                 
+                  specifyVlan: { label: 'label.specify.vlan', isBoolean: true 
},
+
+                  useVpc: {
+                    label: 'VPC',
+                    isBoolean: true,
+                    onChange: function(args) {
+                      var $checkbox = args.$checkbox;
+                      var $selects = 
$checkbox.closest('form').find('.dynamic-input select');
+                      var $vpcOptions = 
$selects.find('option[value=VpcVirtualRouter]');
+                      
+                      if ($checkbox.is(':checked')) {
+                        $vpcOptions.siblings().attr('disabled', true);
+                        $selects.val('VpcVirtualRouter');
+                      } else {
+                        $vpcOptions.siblings().attr('disabled', false);
+                        $vpcOptions.attr('disabled', true);
+                        $selects.each(function() {
+                          $(this).val($(this).find('option:first'));
+                        });
+                      }
+                    }
+                  },
                                                                
                   supportedServices: {
                     label: 'label.supported.services',

Reply via email to