From 62f4f85f7caaa36a2882994d544c30179374b96e Mon Sep 17 00:00:00 2001 From: JensHoffmann Date: Sat, 7 Dec 2013 20:59:33 +0100 Subject: [PATCH 01/14] Add .gitignore file When you want to see 'git status' including ignored files run: git status --ignored --- .gitignore | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..5f23cb1d70 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +*.a +*.o +*.pyc +.xmlrpc_test/ +.sconsign.dblite +share/man/*.gz +src/im_mad/collectd/collectd +src/scheduler/src/sched/.xmlrpc_test/ +src/scheduler/src/sched/mm_sched +src/sunstone/locale/languages/*.js +src/mad/utils/tty_expect +src/nebula/.xmlrpc_test/ +src/nebula/oned From cc100319fd918f6398139aad6cf10cc522c55130 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Fri, 27 Dec 2013 18:51:05 +0100 Subject: [PATCH 02/14] feature #2589: Refactor image create dialog --- src/sunstone/public/js/plugins/images-tab.js | 108 ++++++------------- 1 file changed, 34 insertions(+), 74 deletions(-) diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index f8ea5c77a1..d09bfe3be9 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -866,26 +866,20 @@ function enable_all_datastores() } // Prepare the image creation dialog -function setupCreateImageDialog(){ +function setupCreateImageDialog(dialog){ dialogs_context.append('
'); $create_image_dialog = $('#create_image_dialog',dialogs_context); var dialog = $create_image_dialog; dialog.html(create_image_tmpl); - setupTips($create_image_dialog); - - var height = Math.floor($(window).height()*0.8); //set height to a percentage of the window - - //Prepare jquery dialog - //dialog.dialog({ - // autoOpen: false, - // modal:true, - // width: 520, - // height: height - //}); dialog.addClass("reveal-modal large max-height"); + initialize_create_image_dialog(dialog); +} + +function initialize_create_image_dialog(dialog) { + setupTips(dialog); $('.advanced',dialog).hide(); $('#advanced_image_create',dialog).click(function(){ @@ -893,32 +887,24 @@ function setupCreateImageDialog(){ return false; }); - //$('#img_tabs',dialog).tabs(); - //$('button',dialog).button(); - //$('#datablock_img',dialog).attr('disabled','disabled'); - - $('select#img_type',dialog).change(function(){ var value = $(this).val(); - var context = $create_image_dialog; + var context = dialog; switch (value){ case "DATABLOCK": $('#datablock_img',context).removeAttr("disabled"); - //$('#empty_datablock', context).show(); break; default: $('#datablock_img',context).attr('disabled','disabled'); - //$('#empty_datablock', context).hide(); $('#path_img',context).click(); } }); - $('#img_path,#img_fstype,#img_size,#file-uploader',dialog).closest('.row').hide(); $("input[name='src_path']", dialog).change(function(){ - var context = $create_image_dialog; + var context = dialog; var value = $(this).val(); switch (value){ case "path": @@ -942,8 +928,8 @@ function setupCreateImageDialog(){ $('#add_custom_var_image_button', dialog).click( function(){ - var name = $('#custom_var_image_name',$create_image_dialog).val(); - var value = $('#custom_var_image_value',$create_image_dialog).val(); + var name = $('#custom_var_image_name',dialog).val(); + var value = $('#custom_var_image_value',dialog).val(); if (!name.length || !value.length) { notifyError(tr("Custom attribute name and value must be filled in")); return false; @@ -951,14 +937,14 @@ function setupCreateImageDialog(){ option= ''; - $('select#custom_var_image_box',$create_image_dialog).append(option); + $('select#custom_var_image_box',dialog).append(option); return false; } ); $('#remove_custom_var_image_button', dialog).click( function(){ - $('select#custom_var_image_box :selected',$create_image_dialog).remove(); + $('select#custom_var_image_box :selected',dialog).remove(); return false; } ); @@ -966,9 +952,7 @@ function setupCreateImageDialog(){ $('#upload-progress',dialog).css({ border: "1px solid #AAAAAA", position: "relative", -// bottom: "29px", width: "258px", -// left: "133px", height: "15px", display: "inline-block" }); @@ -978,7 +962,7 @@ function setupCreateImageDialog(){ // Upload is handled by FileUploader vendor plugin var uploader = new qq.FileUploaderBasic({ - button: $('#file-uploader',$create_image_dialog)[0], + button: $('#file-uploader',dialog)[0], action: 'upload', multiple: false, params: {}, @@ -987,35 +971,11 @@ function setupCreateImageDialog(){ //notifyMessage(message); }, onSubmit: function(id, fileName){ - //set url params - //since the body is the upload, we need the pass - //the image info here uploader.setParams({ img : JSON.stringify(img_obj), file: fileName }); - //we pop up an upload progress dialog - //var pos_top = $(window).height() - 120; - //var pos_left = 220; - //var pb_dialog = $('
'+ - // '
'+ - // '
').dialog({ - // draggable:true, - // modal:false, - // resizable:false, - // buttons:{}, - // width: 460, - // minHeight: 50, - // position: [pos_left, pos_top] - // }); - //var pb_dialog = $('
'+ - // '
'+ - // '
').addClass("reveal-modal"); - - //$('#upload-progress',pb_dialog).progressbar({value:0}); $('#upload_progress_bars').append('
\
\ '+tr("Uploading...")+'\ @@ -1029,8 +989,6 @@ function setupCreateImageDialog(){
'); }, onProgress: function(id, fileName, loaded, total){ - //update upload dialog with current progress - //$('div#pb_dialog #upload-progress').progressbar("option","value",Math.floor(loaded*100/total)); $('span.meter', $('#'+id+'progressBar')).css('width', Math.floor(loaded*100/total)+'%') }, onComplete: function(id, fileName, responseJSON){ @@ -1152,7 +1110,7 @@ function setupCreateImageDialog(){ } //Time to add custom attributes - $('#custom_var_image_box option',$create_image_dialog).each(function(){ + $('#custom_var_image_box option',dialog).each(function(){ var attr_name = $(this).attr('name'); var attr_value = $(this).val(); img_json[attr_name] = attr_value; @@ -1170,7 +1128,7 @@ function setupCreateImageDialog(){ Sunstone.runAction("Image.create", img_obj); }; - $create_image_dialog.trigger("reveal:close") + dialog.trigger("reveal:close") return false; }); @@ -1192,21 +1150,21 @@ function setupCreateImageDialog(){ "ds_id" : ds_id }; Sunstone.runAction("Image.create",img_obj); - $create_image_dialog.trigger("reveal:close") + dialog.trigger("reveal:close") return false; }); $('#wizard_image_reset_button').click(function(){ - $create_image_dialog.trigger('reveal:close'); - $create_image_dialog.remove(); + dialog.trigger('reveal:close'); + dialog.remove(); setupCreateImageDialog(); popUpCreateImageDialog(); }); $('#advanced_image_reset_button').click(function(){ - $create_image_dialog.trigger('reveal:close'); - $create_image_dialog.remove(); + dialog.trigger('reveal:close'); + dialog.remove(); setupCreateImageDialog(); popUpCreateImageDialog(); @@ -1214,10 +1172,7 @@ function setupCreateImageDialog(){ }); } -function popUpCreateImageDialog(){ - $('#file-uploader input',$create_image_dialog).removeAttr("style"); - $('#file-uploader input',$create_image_dialog).attr('style','margin:0;width:256px!important'); - +function initialize_datastore_info_create_image_dialog(dialog) { datastores_str = makeSelectOptions(dataTable_datastores, 1, 4, @@ -1226,18 +1181,23 @@ function popUpCreateImageDialog(){ true ); - $('#img_datastore',$create_image_dialog).html(datastores_str); - $('#img_datastore_raw',$create_image_dialog).html(datastores_str); + $('#img_datastore',dialog).html(datastores_str); + $('#img_datastore_raw',dialog).html(datastores_str); - $create_image_dialog.reveal(); - $("input#img_name",$create_image_dialog).focus(); - - $('select#img_datastore').children('option').each(function() { - if ($(this).val() == "2") - { + $('select#img_datastore', dialog).children('option').each(function() { + if ($(this).val() == "2") { $(this).attr('disabled', 'disabled'); } }); + + $('#file-uploader input',dialog).removeAttr("style"); + $('#file-uploader input',dialog).attr('style','margin:0;width:256px!important'); +} + +function popUpCreateImageDialog(){ + initialize_datastore_info_create_image_dialog($create_image_dialog); + $create_image_dialog.reveal(); + $("input#img_name",$create_image_dialog).focus(); } // Set the autorefresh interval for the datatable From 3e68e53ba2898599a0cc273692a5c0b13efbbd84 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Fri, 27 Dec 2013 18:51:23 +0100 Subject: [PATCH 03/14] feature #2589: Refactor template create dialog --- .../public/js/plugins/templates-tab.js | 3591 ++++++++--------- 1 file changed, 1742 insertions(+), 1849 deletions(-) diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 47f95b6172..cf6800027d 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -311,7 +311,10 @@ var template_actions = { "Template.create" : { type: "create", call: OpenNebula.Template.create, - callback: addTemplateElement, + callback: function(){ + $create_template_dialog.empty(); + addTemplateElement(); + }, error: onError, notify:true }, @@ -367,7 +370,15 @@ var template_actions = { "Template.show_to_update" : { type: "single", call: OpenNebula.Template.show, - callback: fillTemplatePopUp, + callback: function(request, response) { + $create_template_dialog.remove(); + setupCreateTemplateDialog(); + fillTemplatePopUp( + response.VMTEMPLATE.ID, + response.VMTEMPLATE.TEMPLATE, + $create_template_dialog); + popUpUpdateTemplateDialog(); + }, error: onError }, @@ -2065,1805 +2076,1071 @@ function addSectionJSON(template_json,context){ }); }; -// Prepare the template creation dialog -function setupCreateTemplateDialog(){ - //Helper functions for the dialog operations - - //This function checks that all mandatory items within a section - //have some value. Returns true if so, false if not. - var mandatory_filter = function(context){ - var man_items = "."+man_class; - - //find enabled mandatory items in this context - man_items = $(man_items+' input:visible, '+man_items+' select:visible',context); - var r = true; - - //we fail it the item is enabled and has no value - $.each(man_items,function(){ - var item = $(this); - if (item.parents(".vm_param").attr('disabled') || - !(item.val().length)) { - r = false; - return false; - }; - }); - return r; - }; - - //Adds an option element to a multiple select box. Before doing so, - //it checks that the desired filter is passed - var box_add_element = function(context,box_tag,filter){ - var value=""; - var params= $('.vm_param',context); - var inputs= $('input:enabled',params); - var selects = $('select:enabled',params); - var fields = $.merge(inputs,selects); - - //are fields passing the filter? - var result = filter(); - if (!result) { - notifyError(tr("There are mandatory parameters missing in this section")); - return false; - } - - value={}; - - //With each enabled field we form a JSON object - var id = null; - $.each(fields,function(){ - var field = $(this); - if (!(field.parents(".vm_param").attr('disabled')) && - field.val().length){ - //Pick up parents ID if we do not have one - id = field.attr('id').length ? field.attr('id') : field.parent().attr('id'); - value[id] = field.val(); - }; - }); - var value_string = JSON.stringify(value); - var option= - ''; - $('select'+box_tag,context).append(option); - return false; - }; - - //Removes selected elements from a multiple select box - var box_remove_element = function(section_tag,box_tag){ - var context = $(section_tag,dialog); - $('select'+box_tag+' :selected',context).remove(); - return false; - }; - - // Given a section (context) and a tag for - // a multiple select in that section, it adds the - // JSON values to an array parsed as objects. - // Returns the array - var addBoxJSON = function(context,box_tag){ - var array = []; - $('select'+box_tag+' option',context).each(function(){ - array.push( JSON.parse($(this).val()) ); - }); - return array; - } - - //Given an object, removes those elements which are empty - //Used to clean up a template JSON before submitting - //it to opennebula.js - var removeEmptyObjects = function(obj){ - for (elem in obj){ - var remove = false; - var value = obj[elem]; - if (value instanceof Array) - { - if (value.length == 0) - remove = true; - else if (value.length > 0) - { - value = jQuery.grep(value, function (n) { - var obj_length = 0; - for (e in n) - obj_length += 1; - - if (obj_length == 0) - return false; - - return true; - }); - - if (value.length == 0) - remove = true; - } - } - else if (value instanceof Object) +//Given an object, removes those elements which are empty +//Used to clean up a template JSON before submitting +//it to opennebula.js +function removeEmptyObjects(obj){ + for (elem in obj){ + var remove = false; + var value = obj[elem]; + if (value instanceof Array) + { + if (value.length == 0) + remove = true; + else if (value.length > 0) { + value = jQuery.grep(value, function (n) { var obj_length = 0; - for (e in value) + for (e in n) obj_length += 1; + if (obj_length == 0) - remove = true; - } - else - { - value = String(value); - if (value.length == 0) - remove = true; - } + return false; - if (remove) - delete obj[elem]; + return true; + }); + + if (value.length == 0) + remove = true; + } } - return obj; + else if (value instanceof Object) + { + var obj_length = 0; + for (e in value) + obj_length += 1; + if (obj_length == 0) + remove = true; + } + else + { + value = String(value); + if (value.length == 0) + remove = true; + } + + if (remove) + delete obj[elem]; } + return obj; +} - //Toggles the icon when a section is folded/unfolded - var iconToggle = function(){ - $('.icon_left',$create_template_dialog).click(function(e){ - if ($('span',e.currentTarget).hasClass("ui-icon-plus")){ - $('span',e.currentTarget).removeClass("ui-icon-plus"); - $('span',e.currentTarget).addClass("ui-icon-minus"); - } else { - $('span',e.currentTarget).removeClass("ui-icon-minus"); - $('span',e.currentTarget).addClass("ui-icon-plus"); - }; - }); - }; +/************************************************************************** + CAPACITY TAB - //Fold/unfold all sections button - var foldUnfoldToggle = function() { - $('#fold_unfold_vm_params',$create_template_dialog).toggle( - function(){ - $('.vm_section fieldset',$create_template_dialog).show(); - $('.icon_left span',$create_template_dialog).removeClass("ui-icon-plus"); - $('.icon_left span',$create_template_dialog).addClass("ui-icon-minus"); - return false; - }, - function(){ - $('.vm_section fieldset',$create_template_dialog).hide(); - //Show capacity opts - $('.vm_section fieldset',$create_template_dialog).first().show(); - $('.icon_left span',$create_template_dialog).removeClass("ui-icon-minus"); - $('.icon_left span',$create_template_dialog).addClass("ui-icon-plus"); - return false; - }); - }; +**************************************************************************/ + +// Set ups the capacity section +function add_capacityTab(dialog){ + var html_tab_content = '
  • '+ + generate_capacity_tab_content() + + '
  • ' - /************************************************************************** - CAPACITY TAB + $("
    General
    ").appendTo($("dl#template_create_tabs", dialog)); + $(html_tab_content).appendTo($("ul#template_create_tabs_content", dialog)); - **************************************************************************/ + var capacity_section = $('li#capacityTab', dialog); + setup_capacity_tab_content(capacity_section); +} - // Set ups the capacity section - var add_capacityTab = function(){ - var html_tab_content = '
  • '+ - generate_capacity_tab_content() + - '
  • ' +/************************************************************************** + DISK TAB + +**************************************************************************/ - $("
    General
    ").appendTo($("dl#template_create_tabs")); - $(html_tab_content).appendTo($("ul#template_create_tabs_content")); - - var capacity_section = $('li#capacityTab', dialog); - setup_capacity_tab_content(capacity_section); - } - - /************************************************************************** - DISK TAB - - **************************************************************************/ - +function add_disks_tab(dialog) { var number_of_disks = 0; var disks_index = 0; - var add_disks_tab = function() { - var html_tab_content = '
  • '+ - '
    '+ - '
    '+ - '
    '+ - '
      '+ - '
    '+ - '
  • '; + var html_tab_content = '
  • '+ + '
    '+ + '
    '+ + '
    '+ + '
      '+ + '
    '+ + '
  • '; - $("
    "+tr("Storage")+"
    ").appendTo($("dl#template_create_tabs")); - $(html_tab_content).appendTo($("ul#template_create_tabs_content")); + $("
    "+tr("Storage")+"
    ").appendTo($("dl#template_create_tabs", dialog)); + $(html_tab_content).appendTo($("ul#template_create_tabs_content", dialog)); - // close icon: removing the tab on click - $( "#storageTab 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'); + // close icon: removing the tab on click + $( "#storageTab i.remove-tab", dialog ).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(); + dd.remove(); + content.remove(); - if (dd.attr("class") == 'active') { - dl.foundationTabs("set_tab", dl.children('dd').last()); - } + if (dd.attr("class") == 'active') { + dl.foundationTabs("set_tab", dl.children('dd').last()); + } - disks_index--; - }); + disks_index--; + }); - add_disk_tab(number_of_disks); + add_disk_tab(number_of_disks, dialog); + number_of_disks++; + disks_index++; - $("#tf_btn_disks").bind("click", function(){ - add_disk_tab(number_of_disks); - }); - } + $("#tf_btn_disks", dialog).bind("click", function(){ + add_disk_tab(number_of_disks, dialog); + number_of_disks++; + disks_index++; + }); +} - var add_disk_tab = function(disk_id) { - var str_disk_tab_id = 'disk' + disk_id; - var str_datatable_id = 'datatable_template_images' + disk_id; +// TODO dialog +function add_disk_tab(disk_id, dialog) { + var str_disk_tab_id = 'disk' + disk_id; + var str_datatable_id = 'datatable_template_images' + disk_id; - // Append the new div containing the tab and add the tab to the list - var html_tab_content = '
  • '+ - generate_disk_tab_content(str_disk_tab_id, str_datatable_id) + - '
  • ' - $(html_tab_content).appendTo($("ul#template_create_storage_tabs_content")); + // Append the new div containing the tab and add the tab to the list + var html_tab_content = '
  • '+ + generate_disk_tab_content(str_disk_tab_id, str_datatable_id) + + '
  • ' + $(html_tab_content).appendTo($("ul#template_create_storage_tabs_content", dialog)); - var a = $("
    \ - "+tr("DISK")+" \ -
    ").appendTo($("dl#template_create_storage_tabs")); + var a = $("
    \ + "+tr("DISK")+" \ +
    ").appendTo($("dl#template_create_storage_tabs", dialog)); - $(document).foundationTabs("set_tab", a); + $(document).foundationTabs("set_tab", a); - var disk_section = $('li#' +str_disk_tab_id+'Tab', dialog); - setup_disk_tab_content(disk_section, str_disk_tab_id, str_datatable_id) + var disk_section = $('li#' +str_disk_tab_id+'Tab', dialog); + setup_disk_tab_content(disk_section, str_disk_tab_id, str_datatable_id) +} - number_of_disks++; - disks_index++; - } +/************************************************************************** + NETWORK TAB - /************************************************************************** - NETWORK TAB +**************************************************************************/ - **************************************************************************/ +function add_nics_tab(dialog) { var number_of_nics = 0; var nics_index = 0; - var add_nics_tab = function() { - var html_tab_content = '
  • '+ - '
    '+ - '
    '+ + var html_tab_content = '
  • '+ + '
    '+ + '
    '+ + '
    '+ + '
      '+ + '
    '+ + '
  • '; + + $("
    "+tr("Network")+"
    ").appendTo($("dl#template_create_tabs", dialog)); + $(html_tab_content).appendTo($("ul#template_create_tabs_content", dialog)); + + // 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()); + } + + nics_index--; + }); + + add_nic_tab(number_of_nics, dialog); + number_of_nics++; + nics_index++; + + $("#tf_btn_nics").bind("click", function(){ + add_nic_tab(number_of_nics, dialog); + number_of_nics++; + nics_index++; + }); +} + +function add_nic_tab(nic_id, dialog) { + var str_nic_tab_id = 'nic' + nic_id; + var str_datatable_id = 'datatable_template_networks' + nic_id; + + 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", dialog)); + + $(html_tab_content).appendTo($("ul#template_create_network_tabs_content", dialog)); + + $(document).foundationTabs("set_tab", a); + + $('#nic_tab'+str_nic_tab_id, dialog).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) +} + +/************************************************************************** + OS TAB + +**************************************************************************/ + +function add_osTab(dialog) { + var html_tab_content = '
  • '+ + '
    '+ + '
    '+ + '
    '+ + '
    '+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 = '
  • '+ - ''+ - '
    '+ - '
    '+ - '
    '+tr("Boot")+'
    '+ - '
    '+tr("Kernel")+'
    '+ - '
    '+tr("Ramdisk")+'
    '+ - '
    '+tr("Features")+'
    '+ - '
    '+ - '
      '+ - '
    • '+ - '
      '+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - '
      '+tr("CPU architecture to virtualization")+'
      '+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - '
      '+tr("Boot device type")+'
      '+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - '
      '+tr("Device to be mounted as root")+'
      '+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - '
      '+tr("Arguments for the booting kernel")+'
      '+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - '
      '+tr("Path to the bootloader executable")+'
      '+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - '
      '+tr("Set the OS of the VM, only for VMware")+'
      '+ - '
      '+ - '
      '+ - '
      '+ - '
    • '+ - '
    • '+ - '
      '+ - '
      '+ - ' '+tr("Registered Image")+ - '
      '+ - '
      '+ - ' '+tr("Remote PATH")+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - '
      ' + - '' + - '
      ' + - '
      '+ - ''+ - '
      '+ - '
      '+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - '
      '+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("Registered Image ") + - '
      '+ - '
      '+ - ' '+tr("Remote PATH")+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - '
      ' + - '' + - '
      ' + - '
      '+ - ''+ - '
      '+ - '
      '+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - '
      '+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("Add support in the VM for Advanced Configuration and Power Interface (ACPI)")+'
      '+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - '
      '+tr("Add support in the VM for Physical Address Extension (PAE)")+'
      '+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - '
      '+tr(" Adds a PCI Controller that provides bridge-to-bridge capability, only for VMware.")+'
      '+ - '
      '+ - '
      '+ - '
      '+ - '
    • '+ - '
    '+ - '
    '+ - ''+ - '
  • ' - - $("
    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 = '
  • '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - ''+tr("Graphics")+''+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - ' VNC '+ - '
    '+ - '
    '+ - ' SDL'+ - '
    '+ - '
    '+ - ' SPICE'+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    '+ - ''+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - '
    '+tr("IP to listen on")+'
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - '
    '+tr("Port for the VNC/SPICE server")+'
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - '
    '+tr("Password for the VNC/SPICE server")+'
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - '
    '+tr("Keyboard configuration locale to use in the VNC/SPICE display")+'
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - ''+tr("Inputs")+''+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - '
    '+tr("TYPE")+''+tr("BUS")+'
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
  • ' - - - $("
    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 = '
  • '+ - '
    '+ - '
    '+ - '
    '+tr("Network & SSH")+'
    '+ - '
    '+tr("Files")+'
    '+ - '
    '+tr("Custom variables")+'
    '+ - '
    '+ - '
      '+ - '
    • '+ - '
      '+ - '
      '+ - '
      '+ - ''+tr("SSH")+''+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - '
      '+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.")+'
      '+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - ''+ - '
      '+ - '
      '+ - '
      '+ - '
      '+ - '