Skip to content

Commit 1115c0c

Browse files
szhen11wenlingz
authored andcommitted
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 <shuang.zheng@intel.com> Reviewed-by: Victor Sun <victor.sun@intel.com>
1 parent 557e7f1 commit 1115c0c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

misc/acrn-config/config_app/static/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,8 @@ function save_launch(generator=null) {
511511
var id = $(this).attr('id');
512512
var value = $(this).val();
513513

514-
if(id.indexOf('virtio_devices,network')>=0 || id.indexOf('virtio_devices,block')>=0) {
514+
if(id.indexOf('virtio_devices,network')>=0 || id.indexOf('virtio_devices,block')>=0
515+
|| id.indexOf('virtio_devices,input')>=0) {
515516
if(id in launch_config) {
516517
launch_config[id].push(value);
517518
} else {

misc/acrn-config/config_app/templates/launch.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ <h4 class="modal-title" id="myModalLabel">Save as</h4>
157157
{% elif elem.getchildren() != [] %}
158158
{% if 'multiselect' not in elem.attrib or elem.attrib['multiselect'] != 'true' %}
159159
{% set first_child = [] %}
160-
{% set first_multi_child = {'block': 0, 'network': 0} %}
160+
{% set first_multi_child = {'block': 0, 'network': 0, 'input': 0} %}
161161
{% for sub_elem in elem.getchildren() %}
162162
{% set sub_elem_text = '' if sub_elem.text == None else sub_elem.text %}
163163
{% if 'configurable' not in sub_elem.attrib or sub_elem.attrib['configurable'] != '0' %}
@@ -191,7 +191,7 @@ <h4 class="modal-title" id="myModalLabel">Save as</h4>
191191
{% endif %}
192192
</div>
193193

194-
{% if elem.tag in ['virtio_devices'] and sub_elem.tag in ['block', 'network'] %}
194+
{% if elem.tag in ['virtio_devices'] and sub_elem.tag in ['block', 'network', 'input'] %}
195195
<div class="col-sm-1">
196196
<button type="button" class="btn" id="add_virtio_{{sub_elem.tag}}_{{first_multi_child[sub_elem.tag]}}">+</button>
197197
{% if first_multi_child[sub_elem.tag] == 0 %}

0 commit comments

Comments
 (0)