[Kimchi-devel] [PATCH] [Kimchi] Enabling multiselect for VEPA networks

sguimaraes943 at gmail.com sguimaraes943 at gmail.com
Tue Mar 22 21:25:33 UTC 2016


From: Samuel Guimarães <sguimaraes943 at gmail.com>

Signed-off-by: Samuel Guimarães <sguimaraes943 at gmail.com>
---
 ui/js/src/kimchi.network_add_main.js | 10 ++++++++++
 ui/pages/network-add.html.tmpl       |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/ui/js/src/kimchi.network_add_main.js b/ui/js/src/kimchi.network_add_main.js
index 521b450..99e42c1 100644
--- a/ui/js/src/kimchi.network_add_main.js
+++ b/ui/js/src/kimchi.network_add_main.js
@@ -107,6 +107,16 @@ kimchi.setupNetworkFormEvent = function() {
     $('#networkType').on('change', function() {
         var selectedType = $("#networkType").val();
         if(selectedType === kimchi.NETWORK_TYPE_MACVTAP || selectedType === kimchi.NETWORK_TYPE_VEPA) {
+            if (selectedType === kimchi.NETWORK_TYPE_VEPA){
+                $('#networkDestinationID').attr('multiple', true);
+                if($('#networkDestinationID option').length > 10 ) {
+                    $('#networkDestinationID').data('liveSearch',true);
+                }
+            }
+            else {
+                $('#networkDestinationID').attr('multiple', false).data('liveSearch',false);
+            }
+            $('#networkDestinationID').selectpicker('destroy');
             kimchi.loadInterfaces(new Array("nic", "bonding"));
         } else {
             kimchi.loadInterfaces();
diff --git a/ui/pages/network-add.html.tmpl b/ui/pages/network-add.html.tmpl
index 715597a..7a2fadb 100644
--- a/ui/pages/network-add.html.tmpl
+++ b/ui/pages/network-add.html.tmpl
@@ -51,7 +51,7 @@
         <div id="bridgedContent">
             <div class="form-group">
                 <label for="networkDestinationID">$_("Destination"): </label>
-                <select id="networkDestinationID"  class="selectpicker col-md-12 col-lg-12">
+                <select id="networkDestinationID" data-size="5" class="selectpicker col-md-12 col-lg-12 form-control" data-none-selected-text="$_('Select an Interface')">
                 </select>
             </div>
             <div class="form-group" id="vlan">
-- 
1.8.3.1




More information about the Kimchi-devel mailing list