From 4ee91fcccf1305ffed9dab8855735b5e8c359785 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Mon, 27 Aug 2012 15:20:03 -0700 Subject: [PATCH] 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 --- ui/scripts/configuration.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js index 47a1857e48a..b0bf1413427 100644 --- a/ui/scripts/configuration.js +++ b/ui/scripts/configuration.js @@ -1274,7 +1274,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',