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

Jose Ricardo Ziviani joserz at linux.vnet.ibm.com
Wed Mar 23 20:12:23 UTC 2016


Reviewed by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>

On 22-03-2016 18:25, sguimaraes943 at gmail.com wrote:
> 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">
>

-- 
Jose Ricardo Ziviani
-----------------------------
Software Engineer
Linux Technology Center - IBM




More information about the Kimchi-devel mailing list