cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject git commit: refs/heads/ui-ntier2 - CLOUDSTACK-748: Support deployment of VM on Tier + network
Date Wed, 13 Mar 2013 22:13:42 GMT
Updated Branches:
  refs/heads/ui-ntier2 2feda05ec -> fc0cae72d


CLOUDSTACK-748: Support deployment of VM on Tier + network


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

Branch: refs/heads/ui-ntier2
Commit: fc0cae72d5bdef70d4f3c3feb1dd201474e5a6b3
Parents: 2feda05
Author: Brian Federle <brian.federle@citrix.com>
Authored: Wed Mar 13 15:13:19 2013 -0700
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Wed Mar 13 15:13:19 2013 -0700

----------------------------------------------------------------------
 ui/scripts/instanceWizard.js           |   14 +++++++++-----
 ui/scripts/ui-custom/instanceWizard.js |   27 +++++++++++++++++++++------
 2 files changed, 30 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fc0cae72/ui/scripts/instanceWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js
index d9260b0..75d45aa 100644
--- a/ui/scripts/instanceWizard.js
+++ b/ui/scripts/instanceWizard.js
@@ -33,11 +33,10 @@
 
     // Called in networks list, when VPC drop-down is changed
     // -- if vpcID given, return true if in network specified by vpcID
-    // -- if vpcID == -1, return true if network is not associated with a VPC
+    // -- if vpcID == -1, always show all networks
     vpcFilter: function(data, vpcID) {
-      return vpcID != -1?
-        data.vpcid == vpcID :
-        !data.vpcid;
+      return vpcID != -1 ?
+        data.vpcid == vpcID : true;
     },
 
     // Runs when advanced SG-enabled zone is run, before
@@ -401,7 +400,12 @@
                     includingSecurityGroup = true;
 										break;   								
 									}
-								}								
+								}
+
+                if (networkObj.vpcid) {
+                  networkObj._singleSelect = true;
+                }
+                
 								//for Advanced SG-enabled zone, list only SG network offerings 
 								if(selectedZoneObj.networktype == 'Advanced' && selectedZoneObj.securitygroupsenabled
== true) {
 									if(includingSecurityGroup == false)

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fc0cae72/ui/scripts/ui-custom/instanceWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js
index 8e4ed7e..b55df79 100644
--- a/ui/scripts/ui-custom/instanceWizard.js
+++ b/ui/scripts/ui-custom/instanceWizard.js
@@ -91,7 +91,8 @@
           options = options ? options : {};
 
           $(data).each(function() {
-            var id = this[fields.id];
+            var item = this;
+            var id = item[fields.id];
 
             var $select = $('<div>')
                   .addClass('select')
@@ -107,17 +108,22 @@
                       .val(id)
                       .click(function() {
                         var $select = $(this).closest('.select');
+                        var isSingleSelect = $select.hasClass('single-select');
                         var $radio = $select.find('input[type=radio]');
                         var $newNetwork = $(this).closest('.content').find('.select.new-network');
                         var $otherSelects = $select.siblings().filter(':visible');
                         var isCheckbox = $(this).attr('type') == 'checkbox';
-                        var isSingleSelect = $(this).closest('.select-container').hasClass('single-select');
 
                         if (isCheckbox) {
-                          if ((isSingleSelect || !$otherSelects.size()) &&
-                              $newNetwork.find('input[type=checkbox]').is(':unchecked'))
{
-                            $otherSelects.find('input[type=checkbox]').attr('checked', false);
+                          if (isSingleSelect) {
+                            $select.siblings('.single-select:visible').find('input[type=checkbox]')
+                              .attr('checked', false);
+                            
+                            $(this).closest('.select').find('input[type=radio]').click();
+                          }
 
+                          if ((!$otherSelects.size()) &&
+                                     $newNetwork.find('input[type=checkbox]').is(':unchecked'))
{
                             // Set as default
                             $(this).closest('.select').find('input[type=radio]').click();
                           }
@@ -144,6 +150,10 @@
 
             $selects.append($select);
 
+            if (item._singleSelect) {
+              $select.addClass('single-select');
+            }
+
             if (options.secondary) {
               var $secondary = $('<div>').addClass('secondary-input').append(
                 $('<input>')
@@ -164,6 +174,11 @@
                       $(this).closest('.select').siblings().find('input[type=checkbox]')
                         .attr('checked', false);
                     }
+
+                    if ($select.hasClass('single-select')) {
+                      $select.siblings('.single-select:visible').find('input[type=checkbox]')
+                        .attr('checked', false);
+                    }
                   })
                   .after(
                     $('<div>').addClass('name').html(options.secondary.desc)
@@ -614,7 +629,7 @@
                   });
 
                   // 'No VPC' option
-                  $('<option>').attr('value', '-1').html('None').prependTo($vpcSelect);
+                  $('<option>').attr('value', '-1').html(_l('ui.listView.filters.all')).prependTo($vpcSelect);
 
                   $vpcSelect.val(-1);
                   


Mime
View raw message