'+
+ '
'+
+ ''+tr("Boot")+' '+
+ ''+tr("Kernel")+' '+
+ ''+tr("Ramdisk")+' '+
+ ''+tr("Features")+' '+
' '+
- '
'+
- '';
-
- $("
"+tr("Network")+" ").appendTo($("dl#template_create_tabs"));
- $(html_tab_content).appendTo($("ul#template_create_tabs_content"));
-
- // close icon: removing the tab on click
- $( "#networkTab i.remove-tab" ).live( "click", function() {
- var target = $(this).parent().attr("href");
- var dd = $(this).closest('dd');
- var dl = $(this).closest('dl');
- var content = $(target + 'Tab');
-
- dd.remove();
- content.remove();
-
- if (dd.attr("class") == 'active') {
- dl.foundationTabs("set_tab", dl.children('dd').last());
- }
-
- disks_index--;
- });
-
- add_nic_tab();
-
- $("#tf_btn_nics").bind("click", function(){
- add_nic_tab();
- });
- }
-
- var add_nic_tab = function() {
- var str_nic_tab_id = 'nic' + number_of_nics;
- var str_datatable_id = 'datatable_template_networks' + number_of_nics;
-
- var html_tab_content = '
'+
- generate_nic_tab_content(str_nic_tab_id, str_datatable_id) +
- ' '
-
- // Append the new div containing the tab and add the tab to the list
- var a = $("
"+tr("NIC")+" ").appendTo($("dl#template_create_network_tabs"));
-
- $(html_tab_content).appendTo($("ul#template_create_network_tabs_content"));
-
- $(document).foundationTabs("set_tab", a);
-
- $('#nic_tab'+str_nic_tab_id).live('click', function(){
- $("#refresh_template_nic_table_button_class"+str_nic_tab_id).click();
- });
-
- var nic_section = $('li#' + str_nic_tab_id + 'Tab', dialog);
- setup_nic_tab_content(nic_section, str_nic_tab_id, str_datatable_id)
-
- number_of_nics++;
- nics_index++;
- }
-
- /**************************************************************************
- OS TAB
-
- **************************************************************************/
-
- var add_osTab = function() {
- var html_tab_content = '
'+
- ''+
- ' '
-
- $("
OS Booting ").appendTo($("dl#template_create_tabs"));
- $(html_tab_content).appendTo($("ul#template_create_tabs_content"));
-
- var os_section = $('li#osTab', dialog);
- var kernel_section = $('li#kernelTab', os_section);
- var initrd_section = $('li#ramdiskTab', os_section);
-
-
- // Select Image or Volatile disk. The div is hidden depending on the selection, and the
- // vm_param class is included to be computed when the template is generated.
- $("input[name='kernel_type']").change(function(){
- if ($("input[name='kernel_type']:checked").val() == "kernel_ds") {
- $("div.kernel_ds", os_section).toggle();
- $("div#kernel_ds_inputs", os_section).addClass('vm_param');
- $("div.kernel_path", os_section).hide();
- $("div#kernel_path_inputs", os_section).removeClass('vm_param');
- }
- else {
- $("div.kernel_ds", os_section).hide();
- $("div#kernel_ds_inputs", os_section).removeClass('vm_param');
- $("div.kernel_path", os_section).toggle();
- $("div#kernel_path_inputs", os_section).addClass('vm_param');
- }
- });
-
- $("input[name='initrd_type']").change(function(){
- if ($("input[name='initrd_type']:checked").val() == "initrd_ds") {
- $("div.initrd_ds", os_section).toggle();
- $("div#initrd_ds_inputs", os_section).addClass('vm_param');
- $("div.initrd_path", os_section).hide();
- $("div#initrd_path_inputs", os_section).removeClass('vm_param');
- }
- else {
- $("div.initrd_ds", os_section).hide();
- $("div#initrd_ds_inputs", os_section).removeClass('vm_param');
- $("div.initrd_path", os_section).toggle();
- $("div#initrd_path_inputs", os_section).addClass('vm_param');
- }
- });
-
- var dataTable_template_kernel = $('#datatable_kernel', dialog).dataTable({
- "bAutoWidth":false,
- "sDom" : '<"H">t<"F"p>',
- "iDisplayLength": 4,
- "aoColumnDefs": [
- { "sWidth": "35px", "aTargets": [0,1] },
- { "bVisible": false, "aTargets": [3,2,5,6,7,9,8,11,12,10]}
- ],
- //"fnDrawCallback": function(oSettings) {
- // var nodes = this.fnGetNodes();
- // $.each(nodes, function(){
- // if ($(this).find("td:eq(1)").html() == $('#KERNEL', kernel_section).text()) {
- // $("td", this).addClass('markrow');
- // $('input.check_item', this).attr('checked','checked');
- // }
- // })
- //},
- "fnInitComplete": function(oSettings) {
- this.fnFilter("KERNEL", 7)
- }
- });
-
- $("#refresh_kernel_table").die();
- $("#refresh_kernel_table").live('click', function(){
- update_datatable_template_files(dataTable_template_kernel)
- });
-
- // Retrieve the images to fill the datatable
- update_datatable_template_files(dataTable_template_kernel);
-
- $('#kernel_search', dialog).keyup(function(){
- dataTable_template_kernel.fnFilter( $(this).val() );
- })
-
- dataTable_template_kernel.fnSort( [ [1,config['user_config']['table_order']] ] );
-
- $('#datatable_kernel tbody', dialog).delegate("tr", "click", function(e){
- var aData = dataTable_template_kernel.fnGetData(this);
-
- $("td.markrowchecked", kernel_section).removeClass('markrowchecked');
- $('tbody input.check_item', kernel_section).removeAttr('checked');
-
- $('#image_selected', kernel_section).show();
- $('#select_image', kernel_section).hide();
- $('.alert-box', kernel_section).hide();
-
- $("td", this).addClass('markrowchecked');
- $('input.check_item', this).attr('checked','checked');
-
- $('#KERNEL', kernel_section).text(aData[4]);
- $('#KERNEL_DS', kernel_section).val("$FILE[IMAGE_ID="+ aData[1] +"]");
- return true;
- });
-
-
- var datTable_template_initrd = $('#datatable_initrd', dialog).dataTable({
- "bAutoWidth":false,
- "iDisplayLength": 4,
- "sDom" : '<"H">t<"F"p>',
- "aoColumnDefs": [
- { "sWidth": "35px", "aTargets": [0,1] },
- { "bVisible": false, "aTargets": [2,3,5,6,7,9,8,10,11,12]}
- ],
- "fnInitComplete": function(oSettings) {
- this.fnFilter("RAMDISK", 7)
- // var nodes = this.fnGetNodes();
- // $.each(nodes, function(){
- // if ($(this).find("td:eq(1)").html() == $('#INITRD', kernel_section).text()) {
- // $("td", this).addClass('markrowchecked');
- // $('input.check_item', this).attr('checked','checked');
- // }
- // })
- }
- });
-
-
-
- $("#refresh_ramdisk_table").die();
- $("#refresh_ramdisk_table").live('click', function(){
- update_datatable_template_files(datTable_template_initrd)
- });
-
- update_datatable_template_files(datTable_template_initrd);
-
- $('#initrd_search', dialog).keyup(function(){
- datTable_template_initrd.fnFilter( $(this).val() );
- })
-
- datTable_template_initrd.fnSort( [ [1,config['user_config']['table_order']] ] );
-
- $('#datatable_initrd tbody', dialog).delegate("tr", "click", function(e){
- var aData = datTable_template_initrd.fnGetData(this);
-
- $("td.markrowchecked", initrd_section).removeClass('markrowchecked');
- $('tbody input.check_item', initrd_section).removeAttr('checked');
-
- $('#image_selected', initrd_section).show();
- $('#select_image', initrd_section).hide();
- $('.alert-box', initrd_section).hide();
-
- $("td", this).addClass('markrowchecked');
- $('input.check_item', this).attr('checked','checked');
-
- $('#INITRD', os_section).text(aData[4]);
- $('#INITRD_DS', os_section).val("$FILE[IMAGE_ID="+ aData[1] +"]");
- return true;
- });
-
- // Hide image advanced options
- $('fieldset.advanced', $('div#advanced_os')).hide();
-
- $('#advanced_os', dialog).click(function(){
- $('fieldset.advanced', $('div##advanced_os')).toggle();
- return false;
- });
- }
-
-
- /**************************************************************************
- INPUT/OUTPUT TAB
-
- **************************************************************************/
-
- var add_ioTab = function() {
- var html_tab_content = '
'+
- ''+
- ' '
-
-
- $("
Input/Output ").appendTo($("dl#template_create_tabs"));
- $(html_tab_content).appendTo($("ul#template_create_tabs_content"));
-
- $("input[name='graphics_type']").change(function(){
- $("#TYPE", $('li#ioTab .graphics')).val($(this).attr("value"))
- $("#LISTEN", $('li#ioTab')).val("0.0.0.0")
- });
-
- $('#add_input', $('li#ioTab')).click(function() {
- var table = $('#input_table', $('li#ioTab'))[0];
- var rowCount = table.rows.length;
- var row = table.insertRow(-1);
- $(row).addClass("vm_param");
-
- var cell1 = row.insertCell(0);
- var element1 = document.createElement("input");
- element1.id = "TYPE"
- element1.type = "text";
- element1.value = $('select#TYPE', $('li#ioTab')).val()
- cell1.appendChild(element1);
-
- var cell2 = row.insertCell(1);
- var element2 = document.createElement("input");
- element2.id = "BUS"
- element2.type = "text";
- element2.value = $('select#BUS', $('li#ioTab')).val()
- cell2.appendChild(element2);
-
-
- var cell3 = row.insertCell(2);
- cell3.innerHTML = "
";
- });
-
- $( "#ioTab i.remove-tab" ).live( "click", function() {
- $(this).closest("tr").remove()
- });
- }
-
- /**************************************************************************
- CONTEXT TAB
-
- **************************************************************************/
-
- var add_contextTab = function() {
- var html_tab_content = '
'+
- ''+
- ' '
-
-
- $("
Context ").appendTo($("dl#template_create_tabs"));
- $(html_tab_content).appendTo($("ul#template_create_tabs_content"));
-
- //$('#tabs-context', dialog).tabs();
-
- $('#add_context', $('li#contextTab')).click(function() {
- var table = $('#context_table', $('li#contextTab'))[0];
- var rowCount = table.rows.length;
- var row = table.insertRow(rowCount);
-
- var cell1 = row.insertCell(0);
- var element1 = document.createElement("input");
- element1.id = "KEY";
- element1.type = "text";
- element1.value = $('input#KEY', $('li#contextTab')).val()
- cell1.appendChild(element1);
-
- var cell2 = row.insertCell(1);
- var element2 = document.createElement("input");
- element2.id = "VALUE";
- element2.type = "text";
- element2.value = $('input#VALUE', $('li#contextTab')).val()
- cell2.appendChild(element2);
-
-
- var cell3 = row.insertCell(2);
- cell3.innerHTML = "
";
- });
-
- $( "#contextTab i.remove-tab" ).live( "click", function() {
- $(this).closest("tr").remove()
- });
-
-
- var datTable_template_context = $('#datatable_context', dialog).dataTable({
- "bAutoWidth":false,
- "iDisplayLength": 4,
- "bDeferRender": true,
- "sDom" : '<"H">t<"F"p>',
- "aoColumnDefs": [
- { "bSortable": false, "aTargets": ["check"] },
- { "sWidth": "35px", "aTargets": [0,1] },
- { "bVisible": false, "aTargets": [2,3,5,6,7,9,8,10,11,12]}
- ],
- "fnInitComplete": function(oSettings) {
- this.fnFilter("CONTEXT", 7)
- // var images = []
- // $.each($( "span.image", $("#selected_files_spans")), function() {
- // images.push($(this).attr("image_id"));
- // });
-//
- // var nodes = this.fnGetNodes();
- // $.each(nodes, function(){
- // var in_array = $.inArray($(this).find("td:eq(1)").html(), images)
- // if (in_array != -1) {
- // $("td", this).addClass('markrow');
- // $('input.check_item', this).attr('checked','checked');
- // }
- // })
- }
- });
-
-
-
- $("#refresh_context_table").die();
- $("#refresh_context_table").live('click', function(){
- update_datatable_template_files(datTable_template_context)
- });
-
- // Retrieve the images to fill the datatable
- update_datatable_template_files(datTable_template_context);
-
- $('#files_search', dialog).keyup(function(){
- datTable_template_context.fnFilter( $(this).val() );
- })
-
- datTable_template_context.fnSort( [ [1,config['user_config']['table_order']] ] );
-
- var selected_files = {};
- var file_row_hash = {};
-
- $('#datatable_context tbody', dialog).delegate("tr", "click", function(e){
- var aData = datTable_template_context.fnGetData(this);
- var file_id = aData[1];
-
- if ($.isEmptyObject(selected_files)) {
- $('#files_selected', dialog).show();
- $('#select_files', dialog).hide();
- }
-
- if (!$("td:first", this).hasClass('markrowchecked')) {
- $('input.check_item', this).attr('checked','checked');
- selected_files[file_id]=1;
- file_row_hash[file_id]=this;
- $(this).children().each(function(){$(this).addClass('markrowchecked');});
- if ($('#tag_file_'+aData[1], $('div#selected_files_spans', dialog)).length == 0 ) {
- $('#selected_files_spans', dialog).append('
'+aData[4]+' ');
- }
- } else {
- $('input.check_item', this).removeAttr('checked');
- delete selected_files[file_id];
- $("td", this).removeClass('markrowchecked');
- $('div#selected_files_spans span#tag_file_'+file_id, dialog).remove();
- }
-
- if ($.isEmptyObject(selected_files)) {
- $('#files_selected', dialog).hide();
- $('#select_files', dialog).show();
- }
-
- $('.alert-box', $('li#contextTab')).hide();
-
- generate_context_files();
-
- return true;
- });
-
- $( "span.icon-remove", $("#selected_files_spans") ).die()
- $( "span.icon-remove", $("#selected_files_spans") ).live( "click", function() {
- $(this).parent().remove();
- var file_id = $(this).parent().attr("image_id");
-
- delete selected_files[file_id];
-
- var nodes = datTable_template_context.fnGetNodes();
- $.each(nodes, function(){
- if ($(this).find("td:eq(1)").html() == file_id) {
- $("td", this).removeClass('markrowchecked');
- $('input.check_item', this).removeAttr('checked');
- }
- })
-
- generate_context_files();
- });
-
- var generate_context_files = function() {
- var req_string=[];
-
- $.each($( "span.image", $("#selected_files_spans")), function() {
- req_string.push("$FILE[IMAGE_ID="+ $(this).attr("image_id") +"]");
- });
-
-
- $('#FILES_DS', dialog).val(req_string.join(" "));
- };
- }
-
-
- /**************************************************************************
- PLACEMENT TAB
-
- **************************************************************************/
-
- var add_schedulingTab = function() {
- var html_tab_content = '
'+
- ''+
- ''+
- ''+tr("Placement")+' '+
- ''+tr("Policy")+' '+
- ' '+
- ''+
- ''+
- ''+
- ''+tr("Host Requirements")+' '+
- ''+
- ' '+
- ''+
- '
'+
- '
' +
- ' ' +
- '
' +
- '
'+
- ' '+
- '
'+
- '
'+
- '
'+
- ''+
- ''+
- ' '+
- '' + tr("ID") + ' '+
- '' + tr("Name") + ' '+
- '' + tr("Cluster") + ' '+
- '' + tr("RVMs") + ' '+
- '' + tr("Real CPU") + ' '+
- '' + tr("Allocated CPU") + ' '+
- '' + tr("Real MEM") + ' '+
- '' + tr("Allocated MEM") + ' '+
- '' + tr("Status") + ' '+
- '' + tr("IM MAD") + ' '+
- '' + tr("VM MAD") + ' '+
- '' + tr("Last monitored on") + ' '+
- ' '+
- ' '+
- ''+
- ' '+
- '
'+
- '
'+
- '
'+
- ''+tr("Please select one or more hosts from the list")+' '+
- ''+tr("You selected the following hosts:")+' '+
- '
'+
- '
'+
- '
'+
- ''+
- '
'+
- '
' +
- ' ' +
- '
' +
- '
'+
- ' '+
- '
'+
- '
'+
- '
'+
- ''+
- ''+
- ' '+
- '' + tr("ID") + ' '+
- '' + tr("Name") + ' '+
- '' + tr("Hosts") + ' '+
- '' + tr("VNets") + ' '+
- '' + tr("Datastores") + ' '+
- ' '+
- ' '+
- ''+
- ' '+
- '
'+
- '
'+
- '
'+
- ''+tr("Please select one or more clusters from the list")+' '+
- ''+tr("You selected the following clusters:")+' '+
- '
'+
- '
'+
- '
'+
- ' '+
- ''+
- '
'+
- ''+tr("Expression")+': '+
- '
'+
- '
'+
- ' '+
- '
'+
- '
'+
- '
'+tr("Boolean expression that rules out provisioning hosts from list of machines suitable to run this VM")+'.
'+
- '
'+
- '
'+
- ' '+
- ' '+
- ''+
- ''+tr("Datastore Requirements")+' '+
- ''+
- '
'+
- ''+tr("Expression")+': '+
- '
'+
- '
'+
- ' '+
- '
'+
- '
'+
- '
'+tr("Boolean expression that rules out entries from the pool of datastores suitable to run this VM.")+'.
'+
- '
'+
- '
'+
- ' '+
- ' '+
- ''+
- ''+
- ''+tr("Host Rank")+' '+
- ''+
- ' '+
- ''+
- '
'+
- ''+tr("Expression")+': '+
- '
'+
- '
'+
- ' '+
- '
'+
- '
'+
- '
'+tr("This field sets which attribute will be used to sort the suitable hosts for this VM")+'.
'+
- '
'+
- '
'+
- ' '+
- ' '+
- ''+
- ''+tr("Datastore Rank")+' '+
- ''+
- ' '+
- ''+
- '
'+
- ''+tr("Expression")+': '+
- '
'+
- '
'+
- ' '+
- '
'+
- '
'+
- '
'+tr("This field sets which attribute will be used to sort the suitable datastores for this VM")+'.
'+
- '
'+
- '
'+
- ' '+
- ' '+
- ' '+
- ' '+
- ' '
-
- $("
Scheduling ").appendTo($("dl#template_create_tabs"));
- $(html_tab_content).appendTo($("ul#template_create_tabs_content"));
-
- var dataTable_template_hosts = $("#datatable_template_hosts",dialog).dataTable({
- "iDisplayLength": 4,
- "sDom" : '<"H">t<"F"p>',
- "bAutoWidth":false,
- "aoColumnDefs": [
- { "sWidth": "35px", "aTargets": [0,1] },
- { "bVisible": false, "aTargets": [3,5,7,10,11,12]}
- ]
- });
-
- $("#refresh_hosts_placement").die();
- $("#refresh_hosts_placement").live('click', function(){
- update_datatable_template_hosts(dataTable_template_hosts)
- });
-
- update_datatable_template_hosts(dataTable_template_hosts);
-
- $('#hosts_search', dialog).keyup(function(){
- dataTable_template_hosts.fnFilter( $(this).val() );
- })
-
- dataTable_template_hosts.fnSort( [ [1,config['user_config']['table_order']] ] );
-
- var selected_hosts = {};
- var host_row_hash = {};
-
- $('#datatable_template_hosts', dialog).delegate("tr", "click", function(e){
- var aData = dataTable_template_hosts.fnGetData(this);
- var host_id = aData[1];
-
- if ($.isEmptyObject(selected_hosts)) {
- $('#hosts_selected', dialog).show();
- $('#select_hosts', dialog).hide();
- }
-
- if(!$("td:first", this).hasClass('markrowchecked')) {
- $('input.check_item', this).attr('checked','checked');
- selected_hosts[host_id]=1;
- host_row_hash[host_id]=this;
- $(this).children().each(function(){$(this).addClass('markrowchecked');});
- if ($('#tag_host_'+aData[1], $('div#selected_hosts_template', dialog)).length == 0 ) {
- $('div#selected_hosts_template', dialog).append('
'+aData[2]+' ');
- }
- } else {
- $('input.check_item', this).removeAttr('checked');
- delete selected_hosts[host_id];
- $(this).children().each(function(){$(this).removeClass('markrowchecked');});
- $('div#selected_hosts_template span#tag_host_'+host_id, dialog).remove();
- }
-
- if ($.isEmptyObject(selected_hosts)) {
- $('#hosts_selected', dialog).hide();
- $('#select_hosts', dialog).show();
- }
-
- $('.alert-box', $('li#schedulingTab .host_select')).hide();
-
- generate_requirements();
-
- return true;
- });
-
- $( "#selected_hosts_template span.icon-remove" ).live( "click", function() {
- $(this).parent().remove();
- var id = $(this).parent().attr("ID");
-
- var host_id=id.substring(9,id.length);
- delete selected_hosts[host_id];
- $('td', host_row_hash[host_id]).removeClass('markrowchecked');
- $('input.check_item', host_row_hash[host_id]).removeAttr('checked');
-
- if ($.isEmptyObject(selected_hosts)) {
- $('#hosts_selected', dialog).hide();
- $('#select_hosts', dialog).show();
- }
-
- generate_requirements();
- });
-
- // Clusters TABLE
- var dataTable_template_clusters = $("#datatable_template_clusters", dialog).dataTable({
- "iDisplayLength": 4,
- "sDom" : '<"H">t<"F"p>',
- "bAutoWidth":false,
- "aoColumnDefs": [
- { "sWidth": "35px", "aTargets": [0,1] },
- { "bVisible": false, "aTargets": []}
- ]
- });
-
- $("#refresh_clusters_placement").die();
- $("#refresh_clusters_placement").live('click', function(){
- update_datatable_template_clusters(dataTable_template_clusters);
- });
-
- update_datatable_template_clusters(dataTable_template_clusters);
-
- $('#clusters_search', dialog).keyup(function(){
- dataTable_template_clusters.fnFilter( $(this).val() );
- })
-
- dataTable_template_clusters.fnSort( [ [1,config['user_config']['table_order']] ] );
-
- var selected_clusters = {};
- var cluster_row_hash = {};
-
- $('#datatable_template_clusters', dialog).delegate("tr", "click", function(e){
- var aData = dataTable_template_clusters.fnGetData(this);
- var cluster_id = aData[1];
-
- if ($.isEmptyObject(selected_clusters)) {
- $('#clusters_selected', dialog).show();
- $('#select_clusters', dialog).hide();
- }
-
- if(!$("td:first", this).hasClass('markrowchecked'))
- {
- $('input.check_item', this).attr('checked','checked');
- selected_clusters[cluster_id]=1;
- cluster_row_hash[cluster_id]=this;
- $(this).children().each(function(){$(this).addClass('markrowchecked');});
- if ($('#tag_cluster_'+aData[1], $('div#selected_clusters_template', dialog)).length == 0 ) {
- $('div#selected_clusters_template', dialog).append('
'+aData[2]+' ');
- }
- }
- else
- {
- $('input.check_item', this).removeAttr('checked');
- delete selected_clusters[cluster_id];
- $(this).children().each(function(){$(this).removeClass('markrowchecked');});
- $('div#selected_clusters_template span#tag_cluster_'+cluster_id, dialog).remove();
- }
-
-
- if ($.isEmptyObject(selected_clusters)) {
- $('#clusters_selected', dialog).hide();
- $('#select_clusters', dialog).show();
- }
-
- $('.alert-box', $('li#schedulingTab .cluster_select')).hide();
-
- generate_requirements();
-
- return true;
- });
-
- $( "#selected_clusters_template span.icon-remove" ).live( "click", function() {
- $(this).parent().remove();
- var id = $(this).parent().attr("ID");
-
- var cluster_id=id.substring(12,id.length);
- delete selected_clusters[cluster_id];
- $('td', cluster_row_hash[cluster_id]).removeClass('markrowchecked');
- $('input.check_item', cluster_row_hash[cluster_id]).removeAttr('checked');
-
- if ($.isEmptyObject(selected_clusters)) {
- $('#clusters_selected', dialog).hide();
- $('#select_clusters', dialog).show();
- }
-
- generate_requirements();
- });
-
- // Select Image or Volatile disk. The div is hidden depending on the selection, and the
- // vm_param class is included to be computed when the template is generated.
- $("input[name='req_select']").change(function(){
- if ($("input[name='req_select']:checked").val() == "host_select") {
- $("div.host_select", $('li#schedulingTab')).toggle();
- $("div.host_select", $('li#schedulingTab')).addClass('vm_param');
- $("div.cluster_select", $('li#schedulingTab')).hide();
- $("div.cluster_select", $('li#schedulingTab')).removeClass('vm_param');
- }
- else {
- $("div.host_select", $('li#schedulingTab')).hide();
- $("div.host_select", $('li#schedulingTab')).removeClass('vm_param');
- $("div.cluster_select", $('li#schedulingTab')).toggle();
- $("div.cluster_select", $('li#schedulingTab')).addClass('vm_param');
- }
- });
-
- $("input[name='rank_select']", $(".host_rank")).change(function(){
- $("#SCHED_RANK", dialog).val(this.value);
- });
-
- $("input[name='ds_rank_select']", $(".ds_rank")).change(function(){
- $("#SCHED_DS_RANK", dialog).val(this.value);
- });
-
- var generate_requirements = function() {
- var req_string=[];
-
- $.each(selected_hosts, function(key, value) {
- req_string.push('ID=\\"'+key+'\\"');
- });
-
- $.each(selected_clusters, function(key, value) {
- req_string.push('CLUSTER_ID=\\"'+key+'\\"');
- });
-
- $('#SCHED_REQUIREMENTS', dialog).val(req_string.join(" | "));
- };
- }
-
-
- /**************************************************************************
- OTHER TAB
-
- **************************************************************************/
-
- var add_otherTab = function() {
- var html_tab_content = '
'+
- ''+
- ''+
- '
'+
- ''+tr("RAW data")+' '+
- ''+
+ '
'+
+ ''+
+ ''+
+ '
'+
'
'+
- ''+tr("TYPE")+': '+
+ ''+tr("Arch")+': '+
'
'+
'
'+
- ''+
- ' '+
- ''+tr("kvm")+' '+
- ''+tr("xen")+' '+
- ''+tr("vmware")+' '+
- ' '+
+ ''+
+ ' '+
+ 'i686 '+
+ 'x86_64 '+
+ ' '+
'
'+
'
'+
+ '
'+tr("CPU architecture to virtualization")+'
'+
'
'+
+ '
'+
+ '
'+
+ '
'+
+ ''+tr("Boot")+': '+
+ '
'+
+ '
'+
+ ''+
+ ' '+
+ ''+tr("HD")+' '+
+ ''+tr("FD")+' '+
+ ''+tr("CDROM")+' '+
+ ''+tr("NETWORK")+' '+
+ ' '+
+ '
'+
+ '
'+
+ '
'+tr("Boot device type")+'
'+
+ '
'+
+ '
'+
+ '
'+
+ '
'+
+ ''+tr("Root")+': '+
+ '
'+
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ '
'+tr("Device to be mounted as root")+'
'+
+ '
'+
+ '
'+
+ '
'+
+ ''+
+ '
'+
+ '
'+
+ ''+tr("Kernel cmd")+': '+
+ '
'+
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ '
'+tr("Arguments for the booting kernel")+'
'+
+ '
'+
+ '
'+
+ '
'+
+ '
'+
+ ''+tr("Bootloader")+': '+
+ '
'+
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ '
'+tr("Path to the bootloader executable")+'
'+
+ '
'+
+ '
'+
+ '
'+
+ '
'+
+ ''+tr("Guest OS")+': '+
+ '
'+
+ '
'+
+ ''+
+ ' '+
+ 'asianux3_64Guest '+
+ 'asianux3Guest '+
+ 'asianux4_64Guest '+
+ 'asianux4Guest '+
+ 'centos64Guest '+
+ 'centosGuest '+
+ 'darwin64Guest '+
+ 'darwinGuest '+
+ 'debian4_64Guest '+
+ 'debian4Guest '+
+ 'debian5_64Guest '+
+ 'debian5Guest '+
+ 'dosGuest '+
+ 'eComStationGuest '+
+ 'freebsd64Guest '+
+ 'freebsdGuest '+
+ 'mandriva64Guest '+
+ 'mandrivaGuest '+
+ 'netware4Guest '+
+ 'netware5Guest '+
+ 'netware6Guest '+
+ 'nld9Guest '+
+ 'oesGuest '+
+ 'openServer5Guest '+
+ 'openServer6Guest '+
+ 'oracleLinux64Guest '+
+ 'oracleLinuxGuest '+
+ 'os2Guest '+
+ 'other24xLinux64Guest '+
+ 'other24xLinuxGuest '+
+ 'other26xLinux64Guest '+
+ 'other26xLinuxGuest '+
+ 'otherGuest '+
+ 'otherGuest64 '+
+ 'otherLinux64Guest '+
+ 'otherLinuxGuest '+
+ 'redhatGuest '+
+ 'rhel2Guest '+
+ 'rhel3_64Guest '+
+ 'rhel3Guest '+
+ 'rhel4_64Guest '+
+ 'rhel4Guest '+
+ 'rhel5_64Guest '+
+ 'rhel5Guest '+
+ 'rhel6_64Guest '+
+ 'rhel6Guest '+
+ 'sjdsGuest '+
+ 'sles10_64Guest '+
+ 'sles10Guest '+
+ 'sles11_64Guest '+
+ 'sles11Guest '+
+ 'sles64Guest '+
+ 'slesGuest '+
+ 'solaris10_64Guest '+
+ 'solaris10Guest '+
+ 'solaris6Guest '+
+ 'solaris7Guest '+
+ 'solaris8Guest '+
+ 'solaris9Guest '+
+ 'suse64Guest '+
+ 'suseGuest '+
+ 'turboLinux64Guest '+
+ 'turboLinuxGuest '+
+ 'ubuntu64Guest '+
+ 'ubuntuGuest '+
+ 'unixWare7Guest '+
+ 'win2000AdvServGuest '+
+ 'win2000ProGuest '+
+ 'win2000ServGuest '+
+ 'win31Guest '+
+ 'win95Guest '+
+ 'win98Guest '+
+ 'windows7_64Guest '+
+ 'windows7Guest '+
+ 'windows7Server64Guest '+
+ 'winLonghorn64Guest '+
+ 'winLonghornGuest '+
+ 'winMeGuest '+
+ 'winNetBusinessGuest '+
+ 'winNetDatacenter64Guest '+
+ 'winNetDatacenterGuest '+
+ 'winNetEnterprise64Guest '+
+ 'winNetEnterpriseGuest '+
+ 'winNetStandard64Guest '+
+ 'winNetStandardGuest '+
+ 'winNetWebGuest '+
+ 'winNTGuest '+
+ 'winVista64Guest '+
+ 'winVistaGuest '+
+ 'winXPHomeGuest '+
+ 'winXPPro64Guest '+
+ 'winXPProGuest '+
+ ' '+
+ '
'+
+ '
'+
+ '
'+tr("Set the OS of the VM, only for VMware")+'
'+
+ '
'+
+ '
'+
+ '
'+
+ ' '+
+ ''+
+ ''+
+ ' '+
+ ''+
+ '
'+
+ '
' +
+ ' ' +
+ '
' +
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ '
'+
+ ''+
+ ''+
+ ' '+
+ ''+tr("ID")+' '+
+ ''+tr("Owner")+' '+
+ ''+tr("Group")+' '+
+ ''+tr("Name")+' '+
+ ''+tr("Datastore")+' '+
+ ''+tr("Size")+' '+
+ ''+tr("Type")+' '+
+ ''+tr("Registration time")+' '+
+ ''+tr("Persistent")+' '+
+ ''+tr("Status")+' '+
+ ''+tr("#VMS")+' '+
+ ''+tr("Target")+' '+
+ ' '+
+ ' '+
+ ''+
+ ' '+
+ '
'+
+ '
'+
+ ''+tr("Please select a Kernel from the list")+' '+
+ ''+tr("You selected the following Kernel: ")+
+ ' '+
+ ' '+
+ '
'+
+ '
'+
+ '
'+
+ '
'+
+ ''+tr("KERNEL_DS")+': '+
+ '
'+
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ '
'+
+ '
'+
+ ''+
+ ' '+
+ ''+
+ ''+
+ ' '+
+ ''+
+ '
'+
+ '
' +
+ ' ' +
+ '
' +
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ '
'+
+ ''+
+ ''+
+ ' '+
+ ''+tr("ID")+' '+
+ ''+tr("Owner")+' '+
+ ''+tr("Group")+' '+
+ ''+tr("Name")+' '+
+ ''+tr("Datastore")+' '+
+ ''+tr("Size")+' '+
+ ''+tr("Type")+' '+
+ ''+tr("Registration time")+' '+
+ ''+tr("Persistent")+' '+
+ ''+tr("Status")+' '+
+ ''+tr("#VMS")+' '+
+ ''+tr("Target")+' '+
+ ' '+
+ ' '+
+ ''+
+ ' '+
+ '
'+
+ '
'+
+ ''+tr("Please select a Ramdisk from the list")+' '+
+ ''+tr("You selected the following Ramdisk: ")+
+ ' '+
+ ' '+
+ '
'+
+ '
'+
+ '
'+
+ '
'+
+ ''+tr("INITRD_DS")+': '+
+ '
'+
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ '
'+
+ '
'+
+ ''+
+ ' '+
+ ''+
+ ''+
+ '
'+
+ '
'+
+ ''+tr("ACPI")+': '+
+ '
'+
+ '
'+
+ ''+
+ ' '+
+ ''+tr("Yes")+' '+
+ ''+tr("No")+' '+
+ ' '+
+ '
'+
+ '
'+
+ '
'+tr("Add support in the VM for Advanced Configuration and Power Interface (ACPI)")+'
'+
+ '
'+
+ '
'+
+ '
'+
+ '
'+
+ ''+tr("PAE")+': '+
+ '
'+
+ '
'+
+ ''+
+ ' '+
+ ''+tr("Yes")+' '+
+ ''+tr("No")+' '+
+ ' '+
+ '
'+
+ '
'+
+ '
'+tr("Add support in the VM for Physical Address Extension (PAE)")+'
'+
+ '
'+
+ '
'+
+ '
'+
+ ''+
+ '
'+
+ '
'+
+ ''+tr("PCI BRIDGE")+': '+
+ '
'+
+ '
'+
+ ''+
+ ' '+
+ '0 '+
+ '1 '+
+ '2 '+
+ '3 '+
+ '4 '+
+ '5 '+
+ '6 '+
+ '7 '+
+ '8 '+
+ '9 '+
+ '10 '+
+ ' '+
+ '
'+
+ '
'+
+ '
'+tr(" Adds a PCI Controller that provides bridge-to-bridge capability, only for VMware.")+'
'+
+ '
'+
+ '
'+
+ '
'+
+ ' '+
+ ' '+
+ '
'+
+ ''+
+ ''
+
+ $("OS Booting ").appendTo($("dl#template_create_tabs", dialog));
+ $(html_tab_content).appendTo($("ul#template_create_tabs_content", dialog));
+
+ var os_section = $('li#osTab', dialog);
+ var kernel_section = $('li#kernelTab', os_section);
+ var initrd_section = $('li#ramdiskTab', os_section);
+
+
+ // Select Image or Volatile disk. The div is hidden depending on the selection, and the
+ // vm_param class is included to be computed when the template is generated.
+ $("input[name='kernel_type']", os_section).change(function(){
+ if ($("input[name='kernel_type']:checked").val() == "kernel_ds") {
+ $("div.kernel_ds", os_section).toggle();
+ $("div#kernel_ds_inputs", os_section).addClass('vm_param');
+ $("div.kernel_path", os_section).hide();
+ $("div#kernel_path_inputs", os_section).removeClass('vm_param');
+ }
+ else {
+ $("div.kernel_ds", os_section).hide();
+ $("div#kernel_ds_inputs", os_section).removeClass('vm_param');
+ $("div.kernel_path", os_section).toggle();
+ $("div#kernel_path_inputs", os_section).addClass('vm_param');
+ }
+ });
+
+ $("input[name='initrd_type']", os_section).change(function(){
+ if ($("input[name='initrd_type']:checked").val() == "initrd_ds") {
+ $("div.initrd_ds", os_section).toggle();
+ $("div#initrd_ds_inputs", os_section).addClass('vm_param');
+ $("div.initrd_path", os_section).hide();
+ $("div#initrd_path_inputs", os_section).removeClass('vm_param');
+ }
+ else {
+ $("div.initrd_ds", os_section).hide();
+ $("div#initrd_ds_inputs", os_section).removeClass('vm_param');
+ $("div.initrd_path", os_section).toggle();
+ $("div#initrd_path_inputs", os_section).addClass('vm_param');
+ }
+ });
+
+ var dataTable_template_kernel = $('#datatable_kernel', dialog).dataTable({
+ "bAutoWidth":false,
+ "sDom" : '<"H">t<"F"p>',
+ "iDisplayLength": 4,
+ "aoColumnDefs": [
+ { "sWidth": "35px", "aTargets": [0,1] },
+ { "bVisible": false, "aTargets": [3,2,5,6,7,9,8,11,12,10]}
+ ],
+ //"fnDrawCallback": function(oSettings) {
+ // var nodes = this.fnGetNodes();
+ // $.each(nodes, function(){
+ // if ($(this).find("td:eq(1)").html() == $('#KERNEL', kernel_section).text()) {
+ // $("td", this).addClass('markrow');
+ // $('input.check_item', this).attr('checked','checked');
+ // }
+ // })
+ //},
+ "fnInitComplete": function(oSettings) {
+ this.fnFilter("KERNEL", 7)
+ }
+ });
+
+ $("#refresh_kernel_table", dialog).die();
+ $("#refresh_kernel_table", dialog).live('click', function(){
+ update_datatable_template_files(dataTable_template_kernel)
+ });
+
+ // Retrieve the images to fill the datatable
+ update_datatable_template_files(dataTable_template_kernel);
+
+ $('#kernel_search', dialog).keyup(function(){
+ dataTable_template_kernel.fnFilter( $(this).val() );
+ })
+
+ dataTable_template_kernel.fnSort( [ [1,config['user_config']['table_order']] ] );
+
+ $('#datatable_kernel tbody', dialog).delegate("tr", "click", function(e){
+ var aData = dataTable_template_kernel.fnGetData(this);
+
+ $("td.markrowchecked", kernel_section).removeClass('markrowchecked');
+ $('tbody input.check_item', kernel_section).removeAttr('checked');
+
+ $('#image_selected', kernel_section).show();
+ $('#select_image', kernel_section).hide();
+ $('.alert-box', kernel_section).hide();
+
+ $("td", this).addClass('markrowchecked');
+ $('input.check_item', this).attr('checked','checked');
+
+ $('#KERNEL', kernel_section).text(aData[4]);
+ $('#KERNEL_DS', kernel_section).val("$FILE[IMAGE_ID="+ aData[1] +"]");
+ return true;
+ });
+
+
+ var datTable_template_initrd = $('#datatable_initrd', dialog).dataTable({
+ "bAutoWidth":false,
+ "iDisplayLength": 4,
+ "sDom" : '<"H">t<"F"p>',
+ "aoColumnDefs": [
+ { "sWidth": "35px", "aTargets": [0,1] },
+ { "bVisible": false, "aTargets": [2,3,5,6,7,9,8,10,11,12]}
+ ],
+ "fnInitComplete": function(oSettings) {
+ this.fnFilter("RAMDISK", 7)
+ // var nodes = this.fnGetNodes();
+ // $.each(nodes, function(){
+ // if ($(this).find("td:eq(1)").html() == $('#INITRD', kernel_section).text()) {
+ // $("td", this).addClass('markrowchecked');
+ // $('input.check_item', this).attr('checked','checked');
+ // }
+ // })
+ }
+ });
+
+
+
+ $("#refresh_ramdisk_table", dialog).die();
+ $("#refresh_ramdisk_table", dialog).live('click', function(){
+ update_datatable_template_files(datTable_template_initrd)
+ });
+
+ update_datatable_template_files(datTable_template_initrd);
+
+ $('#initrd_search', dialog).keyup(function(){
+ datTable_template_initrd.fnFilter( $(this).val() );
+ })
+
+ datTable_template_initrd.fnSort( [ [1,config['user_config']['table_order']] ] );
+
+ $('#datatable_initrd tbody', dialog).delegate("tr", "click", function(e){
+ var aData = datTable_template_initrd.fnGetData(this);
+
+ $("td.markrowchecked", initrd_section).removeClass('markrowchecked');
+ $('tbody input.check_item', initrd_section).removeAttr('checked');
+
+ $('#image_selected', initrd_section).show();
+ $('#select_image', initrd_section).hide();
+ $('.alert-box', initrd_section).hide();
+
+ $("td", this).addClass('markrowchecked');
+ $('input.check_item', this).attr('checked','checked');
+
+ $('#INITRD', os_section).text(aData[4]);
+ $('#INITRD_DS', os_section).val("$FILE[IMAGE_ID="+ aData[1] +"]");
+ return true;
+ });
+
+ // Hide image advanced options
+ $('fieldset.advanced', $('div#advanced_os')).hide();
+
+ $('#advanced_os', dialog).click(function(){
+ $('fieldset.advanced', $('div##advanced_os')).toggle();
+ return false;
+ });
+}
+
+
+/**************************************************************************
+ INPUT/OUTPUT TAB
+
+**************************************************************************/
+
+function add_ioTab(dialog) {
+ var html_tab_content = ''+
+ ''+
+ ''+
+ '
'+
+ '
'+
+ ''+tr("Graphics")+' '+
+ ''+
+ ' '+
+ ''+
+ '
'+
+ '
'+
+ ''+tr("Listen IP")+': '+
+ '
'+
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ '
'+tr("IP to listen on")+'
'+
+ '
'+
+ '
'+
+ ''+
+ '
'+
+ ''+tr("Port")+': '+
+ '
'+
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ '
'+tr("Port for the VNC/SPICE server")+'
'+
+ '
'+
+ '
'+
+ ''+
+ '
'+
+ ''+tr("Password")+': '+
+ '
'+
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ '
'+tr("Password for the VNC/SPICE server")+'
'+
+ '
'+
+ '
'+
+ ''+
+ '
'+
+ ''+tr("Keymap")+' '+
+ '
'+
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ '
'+tr("Keyboard configuration locale to use in the VNC/SPICE display")+'
'+
+ '
'+
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ '
'+
+ ' '+
+ ' '
+
+
+ $("Input/Output ").appendTo($("dl#template_create_tabs", dialog));
+ $(html_tab_content).appendTo($("ul#template_create_tabs_content", dialog));
+
+ $("input[name='graphics_type']", dialog).change(function(){
+ $("#TYPE", $('li#ioTab .graphics')).val($(this).attr("value"))
+ $("#LISTEN", $('li#ioTab')).val("0.0.0.0")
+ });
+
+ $('#add_input', $('li#ioTab')).click(function() {
+ var table = $('#input_table', $('li#ioTab'))[0];
+ var rowCount = table.rows.length;
+ var row = table.insertRow(-1);
+ $(row).addClass("vm_param");
+
+ var cell1 = row.insertCell(0);
+ var element1 = document.createElement("input");
+ element1.id = "TYPE"
+ element1.type = "text";
+ element1.value = $('select#TYPE', $('li#ioTab')).val()
+ cell1.appendChild(element1);
+
+ var cell2 = row.insertCell(1);
+ var element2 = document.createElement("input");
+ element2.id = "BUS"
+ element2.type = "text";
+ element2.value = $('select#BUS', $('li#ioTab')).val()
+ cell2.appendChild(element2);
+
+
+ var cell3 = row.insertCell(2);
+ cell3.innerHTML = " ";
+ });
+
+ $( "#ioTab i.remove-tab", dialog).live( "click", function() {
+ $(this).closest("tr").remove()
+ });
+}
+
+/**************************************************************************
+ CONTEXT TAB
+
+**************************************************************************/
+
+function add_contextTab(dialog) {
+ var html_tab_content = ''+
+ ''+
+ ''+
+ ''+tr("Network & SSH")+' '+
+ ''+tr("Files")+' '+
+ ''+tr("Custom variables")+' '+
+ ' '+
+ ''+
+ ''+
+ ''+
+ '
'+
+ '
'+
+ ''+tr("SSH")+' '+
+ ''+
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ ''+ tr(" Add SSH contextualization")+' '+
+ '
'+
+ '
'+
+ '
'+tr("Add an ssh public key to the context. If the Public Key textarea is empty then the user variable SSH_PUBLIC_KEY will be used.")+'
'+
+ '
'+
+ '
'+
+ ''+
+ '
'+
+ ' '+tr("Public Key")+': '+
+ '
'+
+ '
'+
+ ''+
+ ' '+
+ '
'+
+ '
'+
+ '
'+
+ ''+tr("Network")+' '+
+ ''+
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ ''+ tr(" Add Network contextualization")+' '+
+ '
'+
+ '
'+
+ '
'+tr("Add network contextualization parameters. For each NIC defined in the NETWORK section, ETH$i_IP, ETH$i_NETWORK... parameters will be included in the CONTEXT section and will be available in the Virtual Machine")+'
'+
+ '
'+
+ '
'+
+ ' '+
+ '
'+
+ ''+tr("OneGate token")+' '+
+ ''+
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ ''+ tr(" Add OneGate token")+' '+
+ '
'+
+ '
'+
+ '
'+tr("Add a file (token.txt) to the context contaning the token to push custom metrics to the VirtualMachine through OneGate")+'
'+
+ '
'+
+ '
'+
+ ' '+
+ '
'+
'
'+
- ''+
- '
'+
- '
'+tr("DATA")+': '+
+ ''+
+ '
'+
+ ''+
+ '
' +
+ ' ' +
+ '
' +
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ ''+
+ ''+
+ ''+
+ ' '+
+ ''+tr("ID")+' '+
+ ''+tr("Owner")+' '+
+ ''+tr("Group")+' '+
+ ''+tr("Name")+' '+
+ ''+tr("Datastore")+' '+
+ ''+tr("Size")+' '+
+ ''+tr("Type")+' '+
+ ''+tr("Registration time")+' '+
+ ''+tr("Persistent")+' '+
+ ''+tr("Status")+' '+
+ ''+tr("#VMS")+' '+
+ ''+tr("Target")+' '+
+ ' '+
+ ' '+
+ ''+
+ ' '+
+ '
'+
+ ''+
+ ''+tr("Please select files from the list")+' '+
+ ''+tr("You selected the following files:")+' '+
'
'+
- ''+
- '
'+
+ '
'+
+ '
'+
+ '
'+
+ ''+tr("FILES_DS")+': '+
+ '
'+
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ '
'+tr("Raw String for the FILE_DS attribute of the VM template, representing files that will be included in the contextualization image. Each file must be stored in a FILE_DS Datastore and must be of type CONTEXT")+'
'+
+ '
'+
'
'+
- '
'+
- '
'+tr("Raw data to be passed directly to the hypervisor")+'.
'+
+ '
'+
+ '
'+
+ ''+tr("Init scripts")+': '+
+ '
'+
+ '
'+
+ ' '+
+ '
'+
+ '
'+
+ '
'+tr("If the VM uses the OpenNebula contextualization package the init.sh file is executed by default. When the init script added is not called init.sh or more than one init script is added, this list contains the scripts to run and the order. Ex. “init.sh users.sh mysql.sh”")+'
'+
+ '
'+
'
'+
- '
'+
- '
'+
- '
'+
- ''+tr("DATA_VMX")+': '+
- '
'+
- '
'+
- ' '+
- '
'+
- '
'+
- '
'+tr("Raw data to be added directly to the .vmx file.")+'.
'+
- '
'+
- '
'+
- ''+
- '
'+
- '
'+
- ''+tr("Custom Tags")+' '+
- ''+
+ ''+
+ '
'+
+ ''+
'
'+
' '+
'
'+
@@ -3874,8 +3151,8 @@ function setupCreateTemplateDialog(){
'
'+tr("Add")+' '+
'
'+
' '+
- '