mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-22 13:37:10 +00:00
acrn-config: enable hv config for scenarion setting UI
config app supports hv config in scenario setting UI. Tracked-On: #4634 Signed-off-by: Shuang Zheng <shuang.zheng@intel.com> Reviewed-by: Victor Sun <victor.sun@intel.com> Acked by: Terry Zou <terry.zou@intel.com>
This commit is contained in:
parent
b4a61abe45
commit
b9583f42e9
@ -85,11 +85,19 @@
|
|||||||
{% if 'configurable' not in vm.attrib or vm.attrib['configurable'] != '0'%}
|
{% if 'configurable' not in vm.attrib or vm.attrib['configurable'] != '0'%}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
{% if vm.tag != 'vm' %}
|
||||||
|
{% set vm_type = 'hv' %}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-1 control-label">HV </label>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
{% set vm_type = 'vm:id='+vm.attrib['id'] %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-1 control-label">VM: </label>
|
<label class="col-sm-1 control-label">VM: </label>
|
||||||
<label class="col-sm-1 control-label" id="vm">{{vm.attrib['id']}}</label>
|
<label class="col-sm-1 control-label" id="vm">{{vm.attrib['id']}}</label>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% if 'desc' in vm.attrib or vm.attrib['desc'] == 'specific for Kata' %}
|
{% if 'desc' in vm.attrib or vm.attrib['desc'] == 'specific for Kata' %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button type="button" class="btn" id="remove_vm_kata">Remove Kata VM</button>
|
<button type="button" class="btn" id="remove_vm_kata">Remove Kata VM</button>
|
||||||
@ -106,13 +114,13 @@
|
|||||||
title="{{elem.attrib['desc'] if 'desc' in elem.attrib else elem.tag}}">{{elem.tag}}</label>
|
title="{{elem.attrib['desc'] if 'desc' in elem.attrib else elem.tag}}">{{elem.tag}}</label>
|
||||||
<label class="col-sm-2 control-label"></label>
|
<label class="col-sm-2 control-label"></label>
|
||||||
|
|
||||||
{% if ','.join(['vm', elem.tag]) not in scenario_item_values %}
|
{% if ','.join([vm.tag, elem.tag]) not in scenario_item_values %}
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
{% if 'readonly' in elem.attrib and elem.attrib['readonly'] == 'true' %}
|
{% if 'readonly' in elem.attrib and elem.attrib['readonly'] == 'true' %}
|
||||||
<input type="text" class="form-control" id="{{'vm:id='+vm.attrib['id']+','+elem.tag}}"
|
<input type="text" class="form-control" id="{{vm_type+','+elem.tag}}"
|
||||||
value="{{elem_text}}" readonly>
|
value="{{elem_text}}" readonly>
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="text" class="form-control" id="{{'vm:id='+vm.attrib['id']+','+elem.tag}}"
|
<input type="text" class="form-control" id="{{vm_type+','+elem.tag}}"
|
||||||
value="{{elem_text}}">
|
value="{{elem_text}}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
@ -120,12 +128,12 @@
|
|||||||
<div class="dropdown col-sm-6">
|
<div class="dropdown col-sm-6">
|
||||||
{% if 'readonly' in elem.attrib and elem.attrib['readonly'] == 'true' %}
|
{% if 'readonly' in elem.attrib and elem.attrib['readonly'] == 'true' %}
|
||||||
<select class="selectpicker" data-width="auto"
|
<select class="selectpicker" data-width="auto"
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag}}" disabled>
|
id="{{vm_type+','+elem.tag}}" disabled>
|
||||||
{% else %}
|
{% else %}
|
||||||
<select class="selectpicker" data-width="auto"
|
<select class="selectpicker" data-width="auto"
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag}}">
|
id="{{vm_type+','+elem.tag}}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for item_value in scenario_item_values[','.join(['vm', elem.tag])] %}
|
{% for item_value in scenario_item_values[','.join([vm.tag, elem.tag])] %}
|
||||||
{% if item_value == elem_text %}
|
{% if item_value == elem_text %}
|
||||||
<option value="{{item_value}}" selected="selected">{{item_value}}</option>
|
<option value="{{item_value}}" selected="selected">{{item_value}}</option>
|
||||||
{% else %}
|
{% else %}
|
||||||
@ -135,7 +143,7 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p id="{{'vm:id='+vm.attrib['id']+','+elem.tag}}_err" class="col-sm-3"></p>
|
<p id="{{vm_type+','+elem.tag}}_err" class="col-sm-3"></p>
|
||||||
</div>
|
</div>
|
||||||
{% elif elem.getchildren() != [] and ('configurable' not in elem.attrib or elem.attrib['configurable']
|
{% elif elem.getchildren() != [] and ('configurable' not in elem.attrib or elem.attrib['configurable']
|
||||||
!= '0')%}
|
!= '0')%}
|
||||||
@ -159,41 +167,41 @@
|
|||||||
title="{{sub_elem.attrib['desc'] if 'desc' in sub_elem.attrib else sub_elem.tag}}">
|
title="{{sub_elem.attrib['desc'] if 'desc' in sub_elem.attrib else sub_elem.tag}}">
|
||||||
{{sub_elem.tag}}</label>
|
{{sub_elem.tag}}</label>
|
||||||
|
|
||||||
{% if ','.join(['vm', elem.tag, sub_elem.tag]) not in scenario_item_values and elem.tag != 'vcpu_affinity' %}
|
{% if ','.join([vm.tag, elem.tag, sub_elem.tag]) not in scenario_item_values and elem.tag != 'vcpu_affinity' %}
|
||||||
{% if sub_elem.tag in ['bootargs', 'kern_args'] %}
|
{% if sub_elem.tag in ['bootargs', 'kern_args'] %}
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %}
|
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %}
|
||||||
<textarea type="text" class="form-control" style="height:120px"
|
<textarea type="text" class="form-control" style="height:120px"
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag+','+sub_elem.tag}}"
|
id="{{vm_type+','+elem.tag+','+sub_elem.tag}}"
|
||||||
readonly>{{sub_elem_text}}</textarea>
|
readonly>{{sub_elem_text}}</textarea>
|
||||||
{% else %}
|
{% else %}
|
||||||
<textarea type="text" class="form-control" style="height:120px"
|
<textarea type="text" class="form-control" style="height:120px"
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag+','+sub_elem.tag}}">{{sub_elem_text}}</textarea>
|
id="{{vm_type+','+elem.tag+','+sub_elem.tag}}">{{sub_elem_text}}</textarea>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %}
|
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %}
|
||||||
<input type="text" class="form-control"
|
<input type="text" class="form-control"
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag+','+sub_elem.tag}}"
|
id="{{vm_type+','+elem.tag+','+sub_elem.tag}}"
|
||||||
value="{{sub_elem_text}}" readonly>
|
value="{{sub_elem_text}}" readonly>
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="text" class="form-control"
|
<input type="text" class="form-control"
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag+','+sub_elem.tag}}"
|
id="{{vm_type+','+elem.tag+','+sub_elem.tag}}"
|
||||||
value="{{sub_elem_text}}">
|
value="{{sub_elem_text}}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set item_key = ','.join(['vm', elem.tag, sub_elem.tag]) if elem.tag != 'vcpu_affinity' else
|
{% set item_key = ','.join([vm.tag, elem.tag, sub_elem.tag]) if elem.tag != 'vcpu_affinity' else
|
||||||
','.join(['vm', elem.tag])%}
|
','.join([vm.tag, elem.tag])%}
|
||||||
<div class="dropdown col-sm-6">
|
<div class="dropdown col-sm-6">
|
||||||
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %}
|
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %}
|
||||||
<select class="selectpicker" data-width="auto"
|
<select class="selectpicker" data-width="auto"
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag+','+sub_elem.tag}}" disabled>
|
id="{{vm_type+','+elem.tag+','+sub_elem.tag}}" disabled>
|
||||||
{% else %}
|
{% else %}
|
||||||
<select class="selectpicker" data-width="auto"
|
<select class="selectpicker" data-width="auto"
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag+','+sub_elem.tag}}">
|
id="{{vm_type+','+elem.tag+','+sub_elem.tag}}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for item_value in scenario_item_values[item_key] %}
|
{% for item_value in scenario_item_values[item_key] %}
|
||||||
{% if item_value == sub_elem_text %}
|
{% if item_value == sub_elem_text %}
|
||||||
@ -215,36 +223,36 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% do first_child.append(1) %}
|
{% do first_child.append(1) %}
|
||||||
<p id="{{'vm:id='+vm.attrib['id']+','+elem.tag+','+sub_elem.tag}}_err" class="col-sm-3"></p>
|
<p id="{{vm_type+','+elem.tag+','+sub_elem.tag}}_err" class="col-sm-3"></p>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if not first_child %}
|
{% if not first_child %}
|
||||||
{% do first_child.append(1) %}
|
{% do first_child.append(1) %}
|
||||||
<label class="col-sm-1 control-label" data-toggle="tooltip"
|
<label class="col-sm-1 control-label" data-toggle="tooltip"
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_label1"
|
id="{{vm_type+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_label1"
|
||||||
title="{{sub_elem.attrib['desc'] if 'desc' in sub_elem.attrib else sub_elem.tag}}">
|
title="{{sub_elem.attrib['desc'] if 'desc' in sub_elem.attrib else sub_elem.tag}}">
|
||||||
{{elem.tag+' '+elem.attrib['id']}}</label>
|
{{elem.tag+' '+elem.attrib['id']}}</label>
|
||||||
{% else %}
|
{% else %}
|
||||||
<label class="col-sm-1 control-label" data-toggle="tooltip"
|
<label class="col-sm-1 control-label" data-toggle="tooltip"
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_label1"
|
id="{{vm_type+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_label1"
|
||||||
title="{{sub_elem.attrib['desc'] if 'desc' in sub_elem.attrib else sub_elem.tag}}">
|
title="{{sub_elem.attrib['desc'] if 'desc' in sub_elem.attrib else sub_elem.tag}}">
|
||||||
</label>
|
</label>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<label class="col-sm-2 control-label" data-toggle="tooltip"
|
<label class="col-sm-2 control-label" data-toggle="tooltip"
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_label2"
|
id="{{vm_type+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_label2"
|
||||||
title="{{sub_elem.attrib['desc'] if 'desc' in sub_elem.attrib else sub_elem.tag}}">
|
title="{{sub_elem.attrib['desc'] if 'desc' in sub_elem.attrib else sub_elem.tag}}">
|
||||||
{{sub_elem.tag}}</label>
|
{{sub_elem.tag}}</label>
|
||||||
{% if (','.join(['vm', elem.tag, sub_elem.tag]) not in scenario_item_values) and
|
{% if (','.join([vm.tag, elem.tag, sub_elem.tag]) not in scenario_item_values) and
|
||||||
(elem.tag!='vuart' or sub_elem.tag!='base') %}
|
(elem.tag!='vuart' or sub_elem.tag!='base') %}
|
||||||
<div class="col-sm-6"
|
<div class="col-sm-6"
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_config">
|
id="{{vm_type+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_config">
|
||||||
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %}
|
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %}
|
||||||
<input type="text" class="form-control"
|
<input type="text" class="form-control"
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}"
|
id="{{vm_type+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}"
|
||||||
value="{{sub_elem_text}}" readonly>
|
value="{{sub_elem_text}}" readonly>
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="text" class="form-control"
|
<input type="text" class="form-control"
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}"
|
id="{{vm_type+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}"
|
||||||
value="{{sub_elem_text}}">
|
value="{{sub_elem_text}}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
@ -252,14 +260,14 @@
|
|||||||
<div class="dropdown col-sm-6">
|
<div class="dropdown col-sm-6">
|
||||||
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %}
|
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %}
|
||||||
<select class="selectpicker" data-width="auto" disabled
|
<select class="selectpicker" data-width="auto" disabled
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}">
|
id="{{vm_type+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}">
|
||||||
{% else %}
|
{% else %}
|
||||||
<select class="selectpicker" data-width="auto"
|
<select class="selectpicker" data-width="auto"
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}">
|
id="{{vm_type+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% set key = ('vm='+vm.attrib['id']+','+elem.tag+'='+elem.attrib['id']+','+sub_elem.tag)
|
{% set key = ('vm='+vm.attrib['id']+','+elem.tag+'='+elem.attrib['id']+','+sub_elem.tag)
|
||||||
if (elem.tag=='vuart' and sub_elem.tag=='base')
|
if (elem.tag=='vuart' and sub_elem.tag=='base')
|
||||||
else ','.join(['vm', elem.tag, sub_elem.tag]) %}
|
else ','.join([vm.tag, elem.tag, sub_elem.tag]) %}
|
||||||
{% for item_value in scenario_item_values[key] %}
|
{% for item_value in scenario_item_values[key] %}
|
||||||
{% if item_value == sub_elem_text %}
|
{% if item_value == sub_elem_text %}
|
||||||
<option value="{{item_value}}" selected="selected">{{item_value}}</option>
|
<option value="{{item_value}}" selected="selected">{{item_value}}</option>
|
||||||
@ -270,7 +278,7 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p id="{{'vm:id='+vm.attrib['id']+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_err"
|
<p id="{{vm_type+','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_err"
|
||||||
class="col-sm-3"></p>
|
class="col-sm-3"></p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
@ -285,14 +293,14 @@
|
|||||||
<div class="dropdown col-sm-6">
|
<div class="dropdown col-sm-6">
|
||||||
{% if 'readonly' in elem.attrib and elem.attrib['readonly'] == 'true' %}
|
{% if 'readonly' in elem.attrib and elem.attrib['readonly'] == 'true' %}
|
||||||
<select class="selectpicker" data-width="auto" disabled
|
<select class="selectpicker" data-width="auto" disabled
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag+','+elem.tag[:-1]}}"
|
id="{{vm_type+','+elem.tag+','+elem.tag[:-1]}}"
|
||||||
multiple>
|
multiple>
|
||||||
{% else %}
|
{% else %}
|
||||||
<select class="selectpicker" data-width="auto"
|
<select class="selectpicker" data-width="auto"
|
||||||
id="{{'vm:id='+vm.attrib['id']+','+elem.tag+','+elem.tag[:-1]}}"
|
id="{{vm_type+','+elem.tag+','+elem.tag[:-1]}}"
|
||||||
multiple>
|
multiple>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if ','.join(['vm', elem.tag]) not in scenario_item_values %}
|
{% if ','.join([vm.tag, elem.tag]) not in scenario_item_values %}
|
||||||
{% set x=1 %}
|
{% set x=1 %}
|
||||||
{% for sub_elem in elem.getchildren() %}
|
{% for sub_elem in elem.getchildren() %}
|
||||||
<option value="{{sub_elem.text}}" selected="selected">{{sub_elem.text}}</option>
|
<option value="{{sub_elem.text}}" selected="selected">{{sub_elem.text}}</option>
|
||||||
@ -302,7 +310,7 @@
|
|||||||
{% for sub_elem in elem.getchildren() %}
|
{% for sub_elem in elem.getchildren() %}
|
||||||
{% do selected_list.append(sub_elem.text) %}
|
{% do selected_list.append(sub_elem.text) %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for item_value in scenario_item_values[','.join(['vm', elem.tag])] %}
|
{% for item_value in scenario_item_values[','.join([vm.tag, elem.tag])] %}
|
||||||
{% if item_value in selected_list %}
|
{% if item_value in selected_list %}
|
||||||
<option value="{{item_value}}" selected="selected">{{item_value}}</option>
|
<option value="{{item_value}}" selected="selected">{{item_value}}</option>
|
||||||
{% else %}
|
{% else %}
|
||||||
@ -312,7 +320,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<p id="{{'vm:id='+vm.attrib['id']+','+elem.tag+','+elem.tag[:-1]}}_err" class="col-sm-3"></p>
|
<p id="{{vm_type+','+elem.tag+','+elem.tag[:-1]}}_err" class="col-sm-3"></p>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user