diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 9e45674063..426bd8f6fe 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -766,12 +766,11 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){ ''+ ''+ '
'+ - '
'+ + '
'+ ''+tr("Please select an image from the list")+''+ ''+ - ''+ - ''+ + ''+ '
'+ '
'+ '
'+ @@ -779,6 +778,67 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){ '
'+ '
'+ '
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ '
'+ '
'+ '
'+ @@ -1327,7 +1387,16 @@ function setup_disk_tab_content(disk_section, str_disk_tab_id, str_datatable_id) "aoColumnDefs": [ { "sWidth": "35px", "aTargets": [0,1] }, { "bVisible": false, "aTargets": [2,3,6,9,8,12]} - ] + ], + "fnDrawCallback": function(oSettings) { + var nodes = this.fnGetNodes(); + $.each(nodes, function(){ + if ($(this).find("td:eq(1)").html() == $('#IMAGE_ID', disk_section).val()) { + $("td", this).addClass('markrow'); + $('input.check_item', this).attr('checked','checked'); + } + }) + } }); // Retrieve the images to fill the datatable @@ -1340,18 +1409,21 @@ function setup_disk_tab_content(disk_section, str_disk_tab_id, str_datatable_id) $('#'+str_datatable_id + ' tbody', disk_section).delegate("tr", "click", function(e){ var aData = dataTable_template_images.fnGetData(this); - $("td.markrowchecked", disk_section).removeClass('markrowchecked'); + $("td.markrow", disk_section).removeClass('markrow'); $('tbody input.check_item', dataTable_template_images).removeAttr('checked'); $('#image_selected', disk_section).show(); $('#select_image', disk_section).hide(); $('.alert-box', disk_section).hide(); - $("td", this).addClass('markrowchecked'); + $("td", this).addClass('markrow'); $('input.check_item', this).attr('checked','checked'); - $('#IMAGE', disk_section).text(aData[4]); + $('#IMAGE_NAME', disk_section).text(aData[4]); $('#IMAGE_ID', disk_section).val(aData[1]); + $('#IMAGE', disk_section).val(""); + $('#IMAGE_UNAME', disk_section).val(""); + $('#IMAGE_UID', disk_section).val(""); return true; }); @@ -1402,25 +1474,85 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){ ''+ ''+ '
'+ - '
'+ + '
'+ ''+tr("Please select a network from the list")+''+ ''+ - ''+ - ''+ + ''+ '
'+ '
'+ '
'+ '

'+tr("Advanced options")+'

'+ '
'+ '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ '
'+ + '
'+ '
'+ '
'+ - '
'+ + '
'+ ''+ '
'+ - '
'+ + '
'+ ''+ '
'+ '
'+ @@ -1430,10 +1562,10 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){ '
'+ '
'+ '
'+ - '
'+ + '
'+ ''+ '
'+ - '
'+ + '
'+ ''+ '
'+ '
'+ @@ -1524,14 +1656,23 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){ function setup_nic_tab_content(nic_section, str_nic_tab_id, str_datatable_id) { var dataTable_template_networks = $('#'+str_datatable_id, nic_section).dataTable({ - "bAutoWidth":false, - "iDisplayLength": 4, - "sDom" : '<"H">t<"F"p>', - "aoColumnDefs": [ - { "sWidth": "35px", "aTargets": [0,1] }, - { "bVisible": false, "aTargets": [7]} - ] - }); + "bAutoWidth":false, + "iDisplayLength": 4, + "sDom" : '<"H">t<"F"p>', + "aoColumnDefs": [ + { "sWidth": "35px", "aTargets": [0,1] }, + { "bVisible": false, "aTargets": [7]} + ], + "fnDrawCallback": function(oSettings) { + var nodes = this.fnGetNodes(); + $.each(nodes, function(){ + if ($(this).find("td:eq(1)").html() == $('#NETWORK_ID', nic_section).val()) { + $("td", this).addClass('markrow'); + $('input.check_item', this).attr('checked','checked'); + } + }) + } + }); // Retrieve the networks to fill the datatable update_datatable_template_networks(dataTable_template_networks); @@ -1543,18 +1684,21 @@ function setup_nic_tab_content(nic_section, str_nic_tab_id, str_datatable_id) { $('#'+str_datatable_id + ' tbody', nic_section).delegate("tr", "click", function(e){ var aData = dataTable_template_networks.fnGetData(this); - $("td.markrowchecked", nic_section).removeClass('markrowchecked'); + $("td.markrow", nic_section).removeClass('markrow'); $('tbody input.check_item', dataTable_template_networks).removeAttr('checked'); $('#image_selected', nic_section).show(); $('#select_image', nic_section).hide(); $('.alert-box', nic_section).hide(); - $("td", this).addClass('markrowchecked'); + $("td", this).addClass('markrow'); $('input.check_item', this).attr('checked','checked'); - $('#NETWORK', nic_section).text(aData[4]); + $('#NETWORK_NAME', nic_section).text(aData[4]); $('#NETWORK_ID', nic_section).val(aData[1]); + $('#NETWORK', nic_section).val(""); + $('#NETWORK_UNAME', nic_section).val(""); + $('#NETWORK_UID', nic_section).val(""); return true; }); @@ -2121,13 +2265,24 @@ function setupCreateTemplateDialog(){ ''+ ''+ ''+ - '
'+ + '
'+ ''+tr("Please select a Kernel from the list")+''+ ''+ ''+ - ''+ '
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ '
'+ '