@@ -85,11 +85,19 @@ <h4 class="modal-title" id="myModalLabel">Save as</h4>
85
85
{% if 'configurable' not in vm.attrib or vm.attrib['configurable'] != '0'%}
86
86
< tr >
87
87
< td >
88
+ {% if vm.tag != 'vm' %}
89
+ {% set vm_type = 'hv' %}
90
+ < div class ="form-group ">
91
+ < label class ="col-sm-1 control-label "> HV </ label >
92
+ </ div >
93
+ {% else %}
94
+ {% set vm_type = 'vm:id='+vm.attrib['id'] %}
88
95
< div class ="form-group ">
89
96
< label class ="col-sm-1 control-label "> VM: </ label >
90
97
< label class ="col-sm-1 control-label " id ="vm "> {{vm.attrib['id']}}</ label >
91
98
92
99
</ div >
100
+ {% endif %}
93
101
{% if 'desc' in vm.attrib or vm.attrib['desc'] == 'specific for Kata' %}
94
102
< div class ="form-group ">
95
103
< button type ="button " class ="btn " id ="remove_vm_kata "> Remove Kata VM</ button >
@@ -106,26 +114,26 @@ <h4 class="modal-title" id="myModalLabel">Save as</h4>
106
114
title ="{{elem.attrib['desc'] if 'desc' in elem.attrib else elem.tag}} "> {{elem.tag}}</ label >
107
115
< label class ="col-sm-2 control-label "> </ label >
108
116
109
- {% if ','.join(['vm' , elem.tag]) not in scenario_item_values %}
117
+ {% if ','.join([vm.tag , elem.tag]) not in scenario_item_values %}
110
118
< div class ="col-sm-6 ">
111
119
{% if 'readonly' in elem.attrib and elem.attrib['readonly'] == 'true' %}
112
- < input type ="text " class ="form-control " id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag}} "
120
+ < input type ="text " class ="form-control " id ="{{vm_type +','+elem.tag}} "
113
121
value ="{{elem_text}} " readonly >
114
122
{% else %}
115
- < input type ="text " class ="form-control " id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag}} "
123
+ < input type ="text " class ="form-control " id ="{{vm_type +','+elem.tag}} "
116
124
value ="{{elem_text}} ">
117
125
{% endif %}
118
126
</ div >
119
127
{% else %}
120
128
< div class ="dropdown col-sm-6 ">
121
129
{% if 'readonly' in elem.attrib and elem.attrib['readonly'] == 'true' %}
122
130
< select class ="selectpicker " data-width ="auto "
123
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag}} " disabled >
131
+ id ="{{vm_type +','+elem.tag}} " disabled >
124
132
{% else %}
125
133
< select class ="selectpicker " data-width ="auto "
126
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag}} ">
134
+ id ="{{vm_type +','+elem.tag}} ">
127
135
{% endif %}
128
- {% for item_value in scenario_item_values[','.join(['vm' , elem.tag])] %}
136
+ {% for item_value in scenario_item_values[','.join([vm.tag , elem.tag])] %}
129
137
{% if item_value == elem_text %}
130
138
< option value ="{{item_value}} " selected ="selected "> {{item_value}}</ option >
131
139
{% else %}
@@ -135,7 +143,7 @@ <h4 class="modal-title" id="myModalLabel">Save as</h4>
135
143
</ select >
136
144
</ div >
137
145
{% endif %}
138
- < p id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag}}_err " class ="col-sm-3 "> </ p >
146
+ < p id ="{{vm_type +','+elem.tag}}_err " class ="col-sm-3 "> </ p >
139
147
</ div >
140
148
{% elif elem.getchildren() != [] and ('configurable' not in elem.attrib or elem.attrib['configurable']
141
149
!= '0')%}
@@ -159,41 +167,41 @@ <h4 class="modal-title" id="myModalLabel">Save as</h4>
159
167
title ="{{sub_elem.attrib['desc'] if 'desc' in sub_elem.attrib else sub_elem.tag}} ">
160
168
{{sub_elem.tag}}</ label >
161
169
162
- {% if ','.join(['vm' , elem.tag, sub_elem.tag]) not in scenario_item_values and elem.tag != 'vcpu_affinity' %}
170
+ {% if ','.join([vm.tag , elem.tag, sub_elem.tag]) not in scenario_item_values and elem.tag != 'vcpu_affinity' %}
163
171
{% if sub_elem.tag in ['bootargs', 'kern_args'] %}
164
172
< div class ="col-sm-6 ">
165
173
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %}
166
174
< textarea type ="text " class ="form-control " style ="height:120px "
167
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+','+sub_elem.tag}} "
175
+ id ="{{vm_type +','+elem.tag+','+sub_elem.tag}} "
168
176
readonly > {{sub_elem_text}}</ textarea >
169
177
{% else %}
170
178
< textarea type ="text " class ="form-control " style ="height:120px "
171
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+','+sub_elem.tag}} "> {{sub_elem_text}}</ textarea >
179
+ id ="{{vm_type +','+elem.tag+','+sub_elem.tag}} "> {{sub_elem_text}}</ textarea >
172
180
{% endif %}
173
181
</ div >
174
182
{% else %}
175
183
< div class ="col-sm-6 ">
176
184
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %}
177
185
< input type ="text " class ="form-control "
178
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+','+sub_elem.tag}} "
186
+ id ="{{vm_type +','+elem.tag+','+sub_elem.tag}} "
179
187
value ="{{sub_elem_text}} " readonly >
180
188
{% else %}
181
189
< input type ="text " class ="form-control "
182
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+','+sub_elem.tag}} "
190
+ id ="{{vm_type +','+elem.tag+','+sub_elem.tag}} "
183
191
value ="{{sub_elem_text}} ">
184
192
{% endif %}
185
193
</ div >
186
194
{% endif %}
187
195
{% else %}
188
- {% set item_key = ','.join(['vm' , elem.tag, sub_elem.tag]) if elem.tag != 'vcpu_affinity' else
189
- ','.join(['vm' , elem.tag])%}
196
+ {% set item_key = ','.join([vm.tag , elem.tag, sub_elem.tag]) if elem.tag != 'vcpu_affinity' else
197
+ ','.join([vm.tag , elem.tag])%}
190
198
< div class ="dropdown col-sm-6 ">
191
199
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %}
192
200
< select class ="selectpicker " data-width ="auto "
193
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+','+sub_elem.tag}} " disabled >
201
+ id ="{{vm_type +','+elem.tag+','+sub_elem.tag}} " disabled >
194
202
{% else %}
195
203
< select class ="selectpicker " data-width ="auto "
196
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+','+sub_elem.tag}} ">
204
+ id ="{{vm_type +','+elem.tag+','+sub_elem.tag}} ">
197
205
{% endif %}
198
206
{% for item_value in scenario_item_values[item_key] %}
199
207
{% if item_value == sub_elem_text %}
@@ -215,51 +223,51 @@ <h4 class="modal-title" id="myModalLabel">Save as</h4>
215
223
</ div >
216
224
{% endif %}
217
225
{% do first_child.append(1) %}
218
- < p id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+','+sub_elem.tag}}_err " class ="col-sm-3 "> </ p >
226
+ < p id ="{{vm_type +','+elem.tag+','+sub_elem.tag}}_err " class ="col-sm-3 "> </ p >
219
227
{% else %}
220
228
{% if not first_child %}
221
229
{% do first_child.append(1) %}
222
230
< label class ="col-sm-1 control-label " data-toggle ="tooltip "
223
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_label1 "
231
+ id ="{{vm_type +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_label1 "
224
232
title ="{{sub_elem.attrib['desc'] if 'desc' in sub_elem.attrib else sub_elem.tag}} ">
225
233
{{elem.tag+' '+elem.attrib['id']}}</ label >
226
234
{% else %}
227
235
< label class ="col-sm-1 control-label " data-toggle ="tooltip "
228
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_label1 "
236
+ id ="{{vm_type +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_label1 "
229
237
title ="{{sub_elem.attrib['desc'] if 'desc' in sub_elem.attrib else sub_elem.tag}} ">
230
238
</ label >
231
239
{% endif %}
232
240
233
241
< label class ="col-sm-2 control-label " data-toggle ="tooltip "
234
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_label2 "
242
+ id ="{{vm_type +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_label2 "
235
243
title ="{{sub_elem.attrib['desc'] if 'desc' in sub_elem.attrib else sub_elem.tag}} ">
236
244
{{sub_elem.tag}}</ label >
237
- {% if (','.join(['vm' , elem.tag, sub_elem.tag]) not in scenario_item_values) and
245
+ {% if (','.join([vm.tag , elem.tag, sub_elem.tag]) not in scenario_item_values) and
238
246
(elem.tag!='vuart' or sub_elem.tag!='base') %}
239
247
< div class ="col-sm-6 "
240
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_config ">
248
+ id ="{{vm_type +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_config ">
241
249
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %}
242
250
< input type ="text " class ="form-control "
243
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}} "
251
+ id ="{{vm_type +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}} "
244
252
value ="{{sub_elem_text}} " readonly >
245
253
{% else %}
246
254
< input type ="text " class ="form-control "
247
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}} "
255
+ id ="{{vm_type +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}} "
248
256
value ="{{sub_elem_text}} ">
249
257
{% endif %}
250
258
</ div >
251
259
{% else %}
252
260
< div class ="dropdown col-sm-6 ">
253
261
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %}
254
262
< select class ="selectpicker " data-width ="auto " disabled
255
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}} ">
263
+ id ="{{vm_type +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}} ">
256
264
{% else %}
257
265
< select class ="selectpicker " data-width ="auto "
258
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}} ">
266
+ id ="{{vm_type +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}} ">
259
267
{% endif %}
260
268
{% set key = ('vm='+vm.attrib['id']+','+elem.tag+'='+elem.attrib['id']+','+sub_elem.tag)
261
269
if (elem.tag=='vuart' and sub_elem.tag=='base')
262
- else ','.join(['vm' , elem.tag, sub_elem.tag]) %}
270
+ else ','.join([vm.tag , elem.tag, sub_elem.tag]) %}
263
271
{% for item_value in scenario_item_values[key] %}
264
272
{% if item_value == sub_elem_text %}
265
273
< option value ="{{item_value}} " selected ="selected "> {{item_value}}</ option >
@@ -270,7 +278,7 @@ <h4 class="modal-title" id="myModalLabel">Save as</h4>
270
278
</ select >
271
279
</ div >
272
280
{% endif %}
273
- < p id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_err "
281
+ < p id ="{{vm_type +','+elem.tag+':id='+elem.attrib['id']+','+sub_elem.tag}}_err "
274
282
class ="col-sm-3 "> </ p >
275
283
{% endif %}
276
284
</ div >
@@ -285,14 +293,14 @@ <h4 class="modal-title" id="myModalLabel">Save as</h4>
285
293
< div class ="dropdown col-sm-6 ">
286
294
{% if 'readonly' in elem.attrib and elem.attrib['readonly'] == 'true' %}
287
295
< select class ="selectpicker " data-width ="auto " disabled
288
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+','+elem.tag[:-1]}} "
296
+ id ="{{vm_type +','+elem.tag+','+elem.tag[:-1]}} "
289
297
multiple >
290
298
{% else %}
291
299
< select class ="selectpicker " data-width ="auto "
292
- id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+','+elem.tag[:-1]}} "
300
+ id ="{{vm_type +','+elem.tag+','+elem.tag[:-1]}} "
293
301
multiple >
294
302
{% endif %}
295
- {% if ','.join(['vm' , elem.tag]) not in scenario_item_values %}
303
+ {% if ','.join([vm.tag , elem.tag]) not in scenario_item_values %}
296
304
{% set x=1 %}
297
305
{% for sub_elem in elem.getchildren() %}
298
306
< option value ="{{sub_elem.text}} " selected ="selected "> {{sub_elem.text}}</ option >
@@ -302,7 +310,7 @@ <h4 class="modal-title" id="myModalLabel">Save as</h4>
302
310
{% for sub_elem in elem.getchildren() %}
303
311
{% do selected_list.append(sub_elem.text) %}
304
312
{% endfor %}
305
- {% for item_value in scenario_item_values[','.join(['vm' , elem.tag])] %}
313
+ {% for item_value in scenario_item_values[','.join([vm.tag , elem.tag])] %}
306
314
{% if item_value in selected_list %}
307
315
< option value ="{{item_value}} " selected ="selected "> {{item_value}}</ option >
308
316
{% else %}
@@ -312,7 +320,7 @@ <h4 class="modal-title" id="myModalLabel">Save as</h4>
312
320
{% endif %}
313
321
</ select >
314
322
</ div >
315
- < p id ="{{'vm:id='+vm.attrib['id'] +','+elem.tag+','+elem.tag[:-1]}}_err " class ="col-sm-3 "> </ p >
323
+ < p id ="{{vm_type +','+elem.tag+','+elem.tag[:-1]}}_err " class ="col-sm-3 "> </ p >
316
324
</ div >
317
325
{% endif %}
318
326
{% endif %}
0 commit comments