diff --git a/misc/acrn-config/config_app/controller.py b/misc/acrn-config/config_app/controller.py index dd7baacdf..d5aee2aad 100644 --- a/misc/acrn-config/config_app/controller.py +++ b/misc/acrn-config/config_app/controller.py @@ -84,7 +84,7 @@ class XmlConfig: :return: None. :raises: ValueError, OSError, SyntaxError. """ - if self._xml_path is None: + if self._xml_path is None or xml is None: return try: self._curr_xml = xml diff --git a/misc/acrn-config/config_app/static/main.js b/misc/acrn-config/config_app/static/main.js index 1c9723b6c..eb235ef70 100644 --- a/misc/acrn-config/config_app/static/main.js +++ b/misc/acrn-config/config_app/static/main.js @@ -348,7 +348,7 @@ $().ready(function(){ $(document).on('click', "#add_launch_submit", function() { var curr_vm_id = $(this).data('id'); - save_launch('add_vm:'+curr_vm_id) + save_launch('add_vm:'+curr_vm_id); }); $('#add_launch_script').on('click', function() { @@ -364,6 +364,31 @@ $().ready(function(){ } }); + $(document).on('change', "select#scenario_name", function() { + data = {scenario_name: $(this).val(), + launch_name: $('text#old_launch_name').text()}; + $.ajax({ + type : "POST", + contentType: "application/json;charset=UTF-8", + url : "../get_post_launch_vms", + data : JSON.stringify(data), + success : function(result) { + console.log(result); + vm_list = result.vm_list + $('select#add_launch_type').empty().selectpicker('refresh'); + for(i in vm_list) { + var option = vm_list[i][1]+' ( ID : '+vm_list[i][0]+' )' + $('select#add_launch_type').append( + '').selectpicker('refresh'); + } + }, + error : function(e){ + console.log(e.status); + console.log(e.responseText); + } + }); + }); + $("select[ID$='vuart:id=1,base']").change(function(){ var id = $(this).attr('id'); var value = $(this).val(); @@ -416,6 +441,11 @@ $().ready(function(){ }) +$(window).load(function () { +  $("select#scenario_name").change(); +}); + + function show_com_target(id, value) { if(id==null || id=='undefined') { diff --git a/misc/acrn-config/config_app/templates/launch.html b/misc/acrn-config/config_app/templates/launch.html index 6e236be86..1ddf101d9 100644 --- a/misc/acrn-config/config_app/templates/launch.html +++ b/misc/acrn-config/config_app/templates/launch.html @@ -43,20 +43,18 @@ the launch scripts will be generated into misc/acrn-config/xmls/config-xmls/[boa