From 1115c0c6afa861c125917bdba6e884928786196a Mon Sep 17 00:00:00 2001 From: Shuang Zheng Date: Mon, 9 Dec 2019 17:03:43 +0800 Subject: [PATCH] acrn-config: UI supports to edit multiple virtio input devices. This is to make acrn config UI supports to edit more than one virtio input devices in multi-lines. Tracked-On: #4163 Signed-off-by: Shuang Zheng Reviewed-by: Victor Sun --- misc/acrn-config/config_app/static/main.js | 3 ++- misc/acrn-config/config_app/templates/launch.html | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/acrn-config/config_app/static/main.js b/misc/acrn-config/config_app/static/main.js index 63ee85031..0e7cc6a53 100644 --- a/misc/acrn-config/config_app/static/main.js +++ b/misc/acrn-config/config_app/static/main.js @@ -511,7 +511,8 @@ function save_launch(generator=null) { var id = $(this).attr('id'); var value = $(this).val(); - if(id.indexOf('virtio_devices,network')>=0 || id.indexOf('virtio_devices,block')>=0) { + if(id.indexOf('virtio_devices,network')>=0 || id.indexOf('virtio_devices,block')>=0 + || id.indexOf('virtio_devices,input')>=0) { if(id in launch_config) { launch_config[id].push(value); } else { diff --git a/misc/acrn-config/config_app/templates/launch.html b/misc/acrn-config/config_app/templates/launch.html index 18ff2146a..d7bc681ae 100644 --- a/misc/acrn-config/config_app/templates/launch.html +++ b/misc/acrn-config/config_app/templates/launch.html @@ -157,7 +157,7 @@ {% elif elem.getchildren() != [] %} {% if 'multiselect' not in elem.attrib or elem.attrib['multiselect'] != 'true' %} {% set first_child = [] %} - {% set first_multi_child = {'block': 0, 'network': 0} %} + {% set first_multi_child = {'block': 0, 'network': 0, 'input': 0} %} {% for sub_elem in elem.getchildren() %} {% set sub_elem_text = '' if sub_elem.text == None else sub_elem.text %} {% if 'configurable' not in sub_elem.attrib or sub_elem.attrib['configurable'] != '0' %} @@ -191,7 +191,7 @@ {% endif %} - {% if elem.tag in ['virtio_devices'] and sub_elem.tag in ['block', 'network'] %} + {% if elem.tag in ['virtio_devices'] and sub_elem.tag in ['block', 'network', 'input'] %}
{% if first_multi_child[sub_elem.tag] == 0 %}