You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mu...@apache.org on 2012/12/06 09:09:09 UTC

[20/100] [abbrv] git commit: CLOUDSTACK-475: cloudstack UI - create network offering - Hide VPC checkbox when Guest Type is Shared. Show it when Guest Type is Isolated.

CLOUDSTACK-475: cloudstack UI - create network offering - Hide VPC checkbox when Guest Type is Shared. Show it when Guest Type is Isolated.


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

Branch: refs/heads/events-framework
Commit: 0f7266767e9ed2c2a2aeddb1e009b1c2e5f23a34
Parents: 9dea5f5
Author: Jessica Wang <je...@citrix.com>
Authored: Tue Nov 13 16:44:02 2012 -0800
Committer: Jessica Wang <je...@citrix.com>
Committed: Tue Nov 13 16:44:02 2012 -0800

----------------------------------------------------------------------
 ui/scripts/configuration.js |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0f726676/ui/scripts/configuration.js
----------------------------------------------------------------------
diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js
index 7d8e51c..ad27843 100644
--- a/ui/scripts/configuration.js
+++ b/ui/scripts/configuration.js
@@ -1132,7 +1132,21 @@
 									  //check whether to show or hide availability field
                     var $sourceNATField = args.$form.find('input[name=\"service.SourceNat.isEnabled\"]');
                     var $guestTypeField = args.$form.find('select[name=guestIpType]');
-                    		
+                    											
+                    if($guestTypeField.val() == 'Shared') { //Shared network offering
+                      args.$form.find('.form-item[rel=\"useVpc\"]').hide();
+																						
+											var $useVpcCb = args.$form.find('.form-item[rel=\"useVpc\"]').find("input[type=checkbox]");
+											if($useVpcCb.is(':checked')) { //if useVpc is checked,											  
+												$useVpcCb.removeAttr("checked");  //remove "checked" attribute in useVpc
+												$useVpcCb.trigger("click");  //trigger useVpc.onChange()
+											}
+										}
+										else { //Isolated network offering 
+                      args.$form.find('.form-item[rel=\"useVpc\"]').css('display', 'inline-block');
+										}
+										
+											
                     if (!requiredNetworkOfferingExists &&
                         $sourceNATField.is(':checked') &&
                         $guestTypeField.val() == 'Isolated') {
@@ -1367,7 +1381,7 @@
                       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');