From 7cfd3d53f64051c878abc5d3d5ef565888075f48 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 2 Dec 2011 17:55:26 +0100 Subject: [PATCH] Feature #1004: Improve translation support This commit sets all 'tr' calls in the same form, so they can be easily matched and grep-ed. This way, a small script (generate_translation_template.rb) allows the automatic generation of the template translation, containing all the strings that can be translatable from the application. This script is not installed. An empty default en_US generated translation has been added, which can be also used as templates for new translations. Documentation, community, support, sign out, welcome, strings from the main view are now translated as well. --- install.sh | 4 +- src/sunstone/public/js/locale.js | 7 +- src/sunstone/public/js/plugins/acls-tab.js | 28 +- .../public/js/plugins/dashboard-tab.js | 54 +- .../public/js/plugins/dashboard-users-tab.js | 35 +- src/sunstone/public/js/plugins/groups-tab.js | 4 +- src/sunstone/public/js/plugins/hosts-tab.js | 84 +-- src/sunstone/public/js/plugins/images-tab.js | 232 +++++---- .../public/js/plugins/templates-tab.js | 373 +++++++------- src/sunstone/public/js/plugins/users-tab.js | 56 +- src/sunstone/public/js/plugins/vms-tab.js | 42 +- src/sunstone/public/js/plugins/vnets-tab.js | 73 +-- src/sunstone/public/js/sunstone-util.js | 16 +- src/sunstone/public/js/sunstone.js | 10 +- src/sunstone/public/locale/en_US/en_US.js | 485 ++++++++++++++++++ .../locale/generate_translation_template.rb | 15 + src/sunstone/views/index.erb | 8 +- 17 files changed, 1024 insertions(+), 502 deletions(-) create mode 100644 src/sunstone/public/locale/en_US/en_US.js create mode 100755 src/sunstone/public/locale/generate_translation_template.rb diff --git a/install.sh b/install.sh index 928d31a5c5..360cd9de01 100755 --- a/install.sh +++ b/install.sh @@ -1087,7 +1087,9 @@ SUNSTONE_PUBLIC_IMAGES_FILES="src/sunstone/public/images/ajax-loader.gif \ src/sunstone/public/images/vnc_off.png \ src/sunstone/public/images/vnc_on.png" -SUNSTONE_PUBLIC_LOCALE_EN_US="" +SUNSTONE_PUBLIC_LOCALE_EN_US="\ +src/sunstone/public/locale/en_US/en_US.js \ +" SUNSTONE_PUBLIC_LOCALE_RU=" src/sunstone/public/locale/ru/ru.js \ diff --git a/src/sunstone/public/js/locale.js b/src/sunstone/public/js/locale.js index 5aa681fe6c..a8a747ada8 100644 --- a/src/sunstone/public/js/locale.js +++ b/src/sunstone/public/js/locale.js @@ -40,9 +40,14 @@ function refreshLang(){ $(document).ready(function(){ if (lang) - $('#lang_sel option[value="'+lang+'"]').attr("selected","selected"); + $('#lang_sel option[value="'+lang+'"]').attr('selected','selected'); $('#lang_sel').change(function(){ setLang($(this).val()); }); + $('#doc_link').text(tr("Documentation")); + $('#support_link').text(tr("Support")); + $('#community_link').text(tr("Community")); + $('#welcome').text(tr("Welcome")); + $('#logout').text(tr("Sign out")); }); \ No newline at end of file diff --git a/src/sunstone/public/js/plugins/acls-tab.js b/src/sunstone/public/js/plugins/acls-tab.js index 3dfd077b6d..f0515f0bcb 100644 --- a/src/sunstone/public/js/plugins/acls-tab.js +++ b/src/sunstone/public/js/plugins/acls-tab.js @@ -42,7 +42,7 @@ var create_acl_tmpl = '
\
\
\ - \ + \ \
\ \ @@ -54,12 +54,12 @@ var create_acl_tmpl = '+tr("Users")+'
\ '+tr("Groups")+'
\
\ - \ + \ '+tr("All")+'
\ '+tr("Specific ID")+'
\ '+tr("Owned by group")+'
\
\ - \ + \ \
\ \ @@ -76,7 +76,7 @@ var create_acl_tmpl = '+tr("Change owner")+'
\ '+tr("Deploy")+'
\
\ - \ + \ \
\
\ @@ -316,9 +316,9 @@ function setupCreateAclDialog(){ height: height }); - $('#res_subgroup_all',dialog).attr("checked","checked"); - $('#res_id',dialog).attr("disabled","disabled"); - $('#belonging_to',dialog).attr("disabled","disabled"); + $('#res_subgroup_all',dialog).attr('checked','checked'); + $('#res_id',dialog).attr('disabled','disabled'); + $('#belonging_to',dialog).attr('disabled','disabled'); $('button',dialog).button(); @@ -327,16 +327,16 @@ function setupCreateAclDialog(){ var context = $(this).parent(); switch (value) { case "*": - $('#res_id',context).attr("disabled","disabled"); - $('#belonging_to',context).attr("disabled","disabled"); + $('#res_id',context).attr('disabled','disabled'); + $('#belonging_to',context).attr('disabled','disabled'); break; case "res_id": - $('#res_id',context).removeAttr("disabled"); - $('#belonging_to').attr("disabled","disabled"); + $('#res_id',context).removeAttr('disabled'); + $('#belonging_to').attr('disabled','disabled'); break; case "belonging_to": - $('#res_id',context).attr("disabled","disabled"); - $('#belonging_to',context).removeAttr("disabled"); + $('#res_id',context).attr('disabled','disabled'); + $('#belonging_to',context).removeAttr('disabled'); break; }; }); @@ -461,7 +461,7 @@ function popUpCreateAclDialog(){ function setAclAutorefresh(){ setInterval(function(){ var checked = $('input.check_item:checked',dataTable_acls); - var filter = $("#datatable_acls_filter input",dataTable_acls.parents("#datatable_acls_wrapper")).attr("value"); + var filter = $("#datatable_acls_filter input",dataTable_acls.parents("#datatable_acls_wrapper")).attr('value'); if (!checked.length && !filter.length){ Sunstone.runAction("Acl.autorefresh"); } diff --git a/src/sunstone/public/js/plugins/dashboard-tab.js b/src/sunstone/public/js/plugins/dashboard-tab.js index d573a6ca23..20061c8232 100644 --- a/src/sunstone/public/js/plugins/dashboard-tab.js +++ b/src/sunstone/public/js/plugins/dashboard-tab.js @@ -50,40 +50,44 @@ var dashboard_tab_content = \ \
\ -

' + tr('Summary of resources') + '

\ +

' + tr("Summary of resources") + '

\
\ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \
' + tr('Hosts (total/active)') + '' + tr("Hosts (total/active)") + '
' + tr('Groups') + '' + tr("Groups") + '
' + tr('VM Templates (total/public)') + '' + tr("VM Templates (total/public)") + '
' + tr('VM Instances')+' (' + tr('total') + '/' + tr('running') + '/' + tr('failed') + ')' + + tr("VM Instances")+ ' (' + + tr("total") + '/' + + tr("running") + '/' + + tr("failed") + ')
' + tr('Virtual Networks (total/public)') + '' + tr("Virtual Networks (total/public)") + '
' + tr('Images (total/public)') + '' + tr("Images (total/public)") + '
' + tr('Users')+'' + tr("Users")+'
' + tr('ACL Rules') + '' + tr("ACL Rules") + '
\ @@ -95,18 +99,18 @@ var dashboard_tab_content = \ \
\ -

' + tr('Quickstart') + '

\ +

' + tr("Quickstart") + '

\
\
\ - \ - ' + tr('Host') + '
\ - ' + tr('VM Instance') + '
\ - ' + tr('VM Template') + '
\ - ' + tr('Virtual Network') + '
\ - ' + tr('Image') + '
\ - ' + tr('User') + '
\ - ' + tr('Group') + '
\ - ' + tr('Acl') + '
\ +\ + ' + tr("Host") + '
\ + ' + tr("VM Instance") + '
\ + ' + tr("VM Template") + '
\ + ' + tr("Virtual Network") + '
\ + ' + tr("Image") + '
\ + ' + tr("User") + '
\ + ' + tr("Group") + '
\ + ' + tr("Acl") + '
\
\
\ \ @@ -118,19 +122,19 @@ var dashboard_tab_content = \ \
\ -

' + tr('Historical monitoring information') + '

\ +

' + tr("Historical monitoring information") + '

\
\ \ - \ + \ \ \ - \ + \ \ \ - \ + \ \ \ - \ + \ \ \
' + tr('Hosts CPU') + '
' + tr("Hosts CPU") + '
'+spinner+'
' + tr('Hosts memory') + '
' + tr("Hosts memory") + '
'+spinner+'
' + tr('Total VM count') + '
' + tr("Total VM count") + '
'+spinner+'
' + tr('VM Network stats') + '
' + tr("VM Network stats") + '
'+spinner+'
\ @@ -143,7 +147,7 @@ var dashboard_tab_content = '; var dashboard_tab = { - title: tr('Dashboard'), + title: tr("Dashboard"), content: dashboard_tab_content } diff --git a/src/sunstone/public/js/plugins/dashboard-users-tab.js b/src/sunstone/public/js/plugins/dashboard-users-tab.js index dd0d4a3976..f9a5ab61cd 100644 --- a/src/sunstone/public/js/plugins/dashboard-users-tab.js +++ b/src/sunstone/public/js/plugins/dashboard-users-tab.js @@ -50,24 +50,27 @@ var dashboard_tab_content = \ \
\ -

'+tr('Summary of resources')+'

\ +

'+tr("Summary of resources")+'

\
\ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \
'+tr('VM Templates (total/public)')+''+tr("VM Templates (total/public)")+'
'+tr('VM Instances')+' ('+tr('total')+'/'+tr('running')+'/'+tr('failed')+')'+tr("VM Instances")+' ('+ + tr("total")+'/'+ + tr("running")+'/'+ + tr("failed")+')
'+tr('Virtual Networks (total/public)')+''+tr("Virtual Networks (total/public)")+'
'+tr('Images (total/public)')+''+tr("Images (total/public)")+'
\ @@ -79,14 +82,14 @@ var dashboard_tab_content = \ \
\ -

'+tr('Quickstart')+'

\ +

'+tr("Quickstart")+'

\
\
\ \ - '+tr('VM Template')+'
\ - '+tr('VM Instance')+'
\ - '+tr('Virtual Network')+'
\ - '+tr('Image')+'
\ + '+tr("VM Template")+'
\ + '+tr("VM Instance")+'
\ + '+tr("Virtual Network")+'
\ + '+tr("Image")+'
\
\
\ \ @@ -98,19 +101,19 @@ var dashboard_tab_content = \ \
\ -

'+tr('Historical monitoring information')+'

\ +

'+tr("Historical monitoring information")+'

\
\ \ - \ + \ \ \ - \ + \ \ \ - \ + \ \ \ - \ + \ \ \
'+tr('Total VM count')+'
'+tr("Total VM count")+'
'+spinner+'
'+tr('Total VM CPU')+'
'+tr("Total VM CPU")+'
'+spinner+'
'+tr('Total VM Memory')+'
'+tr("Total VM Memory")+'
'+spinner+'
'+tr('VM Network stats')+'
'+tr("VM Network stats")+'
'+spinner+'
\ @@ -123,7 +126,7 @@ var dashboard_tab_content = '; var dashboard_tab = { - title: tr('Dashboard'), + title: tr("Dashboard"), content: dashboard_tab_content } diff --git a/src/sunstone/public/js/plugins/groups-tab.js b/src/sunstone/public/js/plugins/groups-tab.js index caea4ff5bb..1a31960052 100644 --- a/src/sunstone/public/js/plugins/groups-tab.js +++ b/src/sunstone/public/js/plugins/groups-tab.js @@ -40,7 +40,7 @@ var create_group_tmpl = '\
\
\ - \ + \
\
\
\ @@ -259,7 +259,7 @@ function popUpCreateGroupDialog(){ function setGroupAutorefresh(){ setInterval(function(){ var checked = $('input.check_item:checked',dataTable_groups); - var filter = $("#datatable_groups_filter input",dataTable_groups.parents("#datatable_groups_wrapper")).attr("value"); + var filter = $("#datatable_groups_filter input",dataTable_groups.parents("#datatable_groups_wrapper")).attr('value'); if (!checked.length && !filter.length){ Sunstone.runAction("Group.autorefresh"); } diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js index 98b3a07ea8..949171cf1a 100644 --- a/src/sunstone/public/js/plugins/hosts-tab.js +++ b/src/sunstone/public/js/plugins/hosts-tab.js @@ -40,13 +40,13 @@ var hosts_tab_content = \ \ \ - \ - \ - \ - \ - \ - \ - \ + \ + \ + \ + \ + \ + \ + \ \ \ \ @@ -57,42 +57,42 @@ var hosts_tab_content = var create_host_tmpl = '
\
\ - ' + tr('Host parameters') + '\ - \ + ' + tr("Host parameters") + '\ + \
\ -

' + tr('Drivers') + '

\ +

' + tr("Drivers") + '

\
\
\ - \ + \ \
\
\ - \ + \ \
\
\ - \ + \ \
\
\
\
\ -
\ -
\ +
\ +
\
\
\
'; @@ -286,7 +286,7 @@ var host_info_panel = { var hosts_tab = { - title: tr('Hosts'), + title: tr("Hosts"), content: hosts_tab_content, buttons: host_buttons } @@ -424,58 +424,58 @@ function updateHostInfo(request,host){ content : '
' + tr('All') + '' + tr('id') + '' + tr('Name') + '' + tr('Running VMs') + '' + tr('CPU Use') + '' + tr('Memory use') + '' + tr('Status') + '' + tr("All") + '' + tr("id") + '' + tr("Name") + '' + tr("Running VMs") + '' + tr("CPU Use") + '' + tr("Memory use") + '' + tr("Status") + '
\ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \
' + tr('Host information') + ' - '+host_info.NAME+'
' + tr("Host information") + ' - '+host_info.NAME+'
' + tr('id') + '' + tr("id") + ''+host_info.ID+'
' + tr('State') + '' + tr("State") + ''+tr(OpenNebula.Helper.resource_state("host",host_info.STATE))+'
' + tr('IM MAD') + '' + tr("IM MAD") + ''+host_info.IM_MAD+'
' + tr('VM MAD') + '' + tr("VM MAD") + ''+host_info.VM_MAD+'
' + tr('TM MAD') + '' + tr("TM MAD") + ''+host_info.TM_MAD+'
\ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ @@ -487,7 +487,7 @@ function updateHostInfo(request,host){ title : tr("Host template"), content : '
' + tr('Host shares') + '
' + tr("Host shares") + '
' + tr('Max Mem') + '' + tr("Max Mem") + ''+humanize_size(host_info.HOST_SHARE.MAX_MEM)+'
' + tr('Used Mem (real)') + '' + tr("Used Mem (real)") + ''+humanize_size(host_info.HOST_SHARE.USED_MEM)+'
' + tr('Used Mem (allocated)') + '' + tr("Used Mem (allocated)") + ''+humanize_size(host_info.HOST_SHARE.MAX_USAGE)+'
' + tr('Used CPU (real)') + '' + tr("Used CPU (real)") + ''+host_info.HOST_SHARE.USED_CPU+'
' + tr('Used CPU (allocated)') + '' + tr("Used CPU (allocated)") + ''+host_info.HOST_SHARE.CPU_USAGE+'
' + tr('Running VMs') + '' + tr("Running VMs") + ''+host_info.HOST_SHARE.RUNNING_VMS+'
\ - '+ + '+ prettyPrintJSON(host_info.TEMPLATE)+ '
' + tr('Host template') + '
' + tr("Host template") + '
' } @@ -559,7 +559,7 @@ function popUpCreateHostDialog(){ function setHostAutorefresh() { setInterval(function(){ var checked = $('input.check_item:checked',dataTable_hosts); - var filter = $("#datatable_hosts_filter input",dataTable_hosts.parents('#datatable_hosts_wrapper')).attr("value"); + var filter = $("#datatable_hosts_filter input",dataTable_hosts.parents('#datatable_hosts_wrapper')).attr('value'); if (!checked.length && !filter.length){ Sunstone.runAction("Host.autorefresh"); } diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index 2ec58f4cd6..e17394b194 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -23,18 +23,18 @@ var images_tab_content = \ \ \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ \ \ \ @@ -44,114 +44,116 @@ var images_tab_content = var create_image_tmpl = '
\ -
  • '+tr('Wizard')+'
  • \ -
  • '+tr('Advanced mode')+'
  • \ + \
    \
    \ -

    '+tr('Fields marked with')+' '+tr('are mandatory')+'
    \ +

    '+ + tr("Fields marked with")+' '+ + tr("are mandatory")+'
    \

    \
    \ - \ + \ \ -
    '+tr('Name that the Image will get. Every image must have a unique name.')+'
    \ +
    '+tr("Name that the Image will get. Every image must have a unique name.")+'
    \
    \
    \ - \ + \ \ -
    '+tr('Human readable description of the image for other users.')+'
    \ +
    '+tr("Human readable description of the image for other users.")+'
    \
    \
    \
    \
    \ - \ + \ \ -
    '+tr('Type of the image, explained in detail in the following section. If omitted, the default value is the one defined in oned.conf (install default is OS).')+'
    \ +
    '+tr("Type of the image, explained in detail in the following section. If omitted, the default value is the one defined in oned.conf (install default is OS).")+'
    \
    \
    \ - \ + \ \ -
    '+tr('Public scope of the image')+'
    \ +
    '+tr("Public scope of the image")+'
    \
    \
    \ - \ + \ \ -
    '+tr('Persistence of the image')+'
    \ +
    '+tr("Persistence of the image")+'
    \
    \
    \ - \ + \ \ -
    '+tr('Prefix for the emulated device this image will be mounted at. For instance, “hd”, “sd”. If omitted, the default value is the one defined in oned.conf (installation default is “hd”).')+'
    \ +
    '+tr("Prefix for the emulated device this image will be mounted at. For instance, “hd”, “sd”. If omitted, the default value is the one defined in oned.conf (installation default is “hd”).")+'
    \
    \
    \ - \ + \ \ -
    '+tr('Type of disk device to emulate.')+'
    \ +
    '+tr("Type of disk device to emulate.")+'
    \
    \
    \ - \ + \ \ -
    '+tr('Specific image mapping driver. KVM: raw, qcow2. XEN: tap:aio, file:')+'
    \ +
    '+tr("Specific image mapping driver. KVM: raw, qcow2. XEN: tap:aio, file:")+'
    \
    \
    \
    \
    \ - \ + \ \ -
    \ +
    \ \ -
    \ +
    \ \ - \ -
    '+tr('Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.')+'

    \ + \ +
    '+tr("Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.")+'

    \
    \
    \ - \ + \ \ -
    '+tr('Path to the original file that will be copied to the image repository. If not specified for a DATABLOCK type image, an empty image will be created.')+'
    \ +
    '+tr("Path to the original file that will be copied to the image repository. If not specified for a DATABLOCK type image, an empty image will be created.")+'
    \
    \
    \ - \ + \ \ -
    '+tr('Source to be used in the DISK attribute. Useful for not file-based images.')+'
    \ +
    '+tr("Source to be used in the DISK attribute. Useful for not file-based images.")+'
    \
    \
    \ - \ + \ \ -
    '+tr('Size of the datablock in MB.')+'
    \ +
    '+tr("Size of the datablock in MB.")+'
    \
    \
    \ - \ + \ \ -
    '+tr('Type of file system to be built. This can be any value understood by mkfs unix command.')+'
    \ +
    '+tr("Type of file system to be built. This can be any value understood by mkfs unix command.")+'
    \
    \
    \
    \
    \ - \ + \ \ - \ + \ \ - \ - \ + \ + \
    \ - \ + \ \
    \
    \
    \
    \ - \ - \ + \ + \
    \
    \ \ @@ -159,16 +161,16 @@ var create_image_tmpl =
    \
    \
    \ -

    '+tr('Write the image template here')+'

    \ +

    '+tr("Write the image template here")+'

    \ \
    \
    \
    \ \ - \ + \
    \
    \ \ @@ -177,26 +179,26 @@ var create_image_tmpl = var update_image_tmpl = '
    \ -

    '+tr('Please, choose and modify the image you want to update')+':

    \ +

    '+tr("Please, choose and modify the image you want to update")+':

    \
    \ - \ + \ \
    \
    \ - \ + \ \
    \
    \ - \ + \ \
    \ - \ + \
    \ \
    \
    \
    \ - \
    \
    \ @@ -411,14 +413,14 @@ var image_buttons = { type: "confirm_with_select", text: tr("Change owner"), select: users_sel, - tip: tr("Select the new owner:"), + tip: tr("Select the new owner")+":", condition: mustBeAdmin }, "Image.chgrp" : { type: "confirm_with_select", text: tr("Change group"), select: groups_sel, - tip: tr("Select the new group:"), + tip: tr("Select the new group")+":", condition: mustBeAdmin }, "action_list" : { @@ -491,9 +493,9 @@ function imageElementArray(image_json){ var image = image_json.IMAGE; var type = $(''); var value = OpenNebula.Helper.image_type(image.TYPE); @@ -573,62 +575,63 @@ function updateImageInfo(request,img){ content: '
'+tr('All')+''+tr('ID')+''+tr('Owner')+''+tr('Group')+''+tr('Name')+''+tr('Size')+''+tr('Type')+''+tr('Registration time')+''+tr('Public')+''+tr('Persistent')+''+tr('Status')+''+tr('#VMS')+''+tr("All")+''+tr("ID")+''+tr("Owner")+''+tr("Group")+''+tr("Name")+''+tr("Size")+''+tr("Type")+''+tr("Registration time")+''+tr("Public")+''+tr("Persistent")+''+tr("Status")+''+tr("#VMS")+'
\ \ - \ + \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \
'+tr('Image')+' "'+img_info.NAME+'" '+tr('information')+'
'+tr("Image")+' "'+img_info.NAME+'" '+ + tr("information")+'
'+tr('ID')+''+tr("ID")+''+img_info.ID+'
'+tr('Name')+''+tr("Name")+''+img_info.NAME+'
'+tr('Owner')+''+tr("Owner")+''+img_info.UNAME+'
'+tr('Group')+''+tr("Group")+''+img_info.GNAME+'
'+tr('Type')+''+tr("Type")+''+OpenNebula.Helper.image_type(img_info.TYPE)+'
'+tr('Register time')+''+tr("Register time")+''+pretty_time(img_info.REGTIME)+'
'+tr('Public')+''+tr("Public")+''+(parseInt(img_info.PUBLIC) ? tr("yes") : tr("no"))+'
'+tr('Persistent')+''+tr("Persistent")+''+(parseInt(img_info.PERSISTENT) ? tr("yes") : tr("no"))+'
'+tr('Source')+''+tr("Source")+''+(typeof img_info.SOURCE === "string" ? img_info.SOURCE : "--")+'
'+tr('Path')+''+tr("Path")+''+(typeof img_info.PATH === "string" ? img_info.PATH : "--")+'
'+tr('Filesystem type')+''+tr("Filesystem type")+''+(typeof img_info.FSTYPE === "string" ? img_info.FSTYPE : "--")+'
'+tr('Size (Mb)')+''+tr("Size (Mb)")+''+img_info.SIZE+'
'+tr('State')+''+tr("State")+''+OpenNebula.Helper.resource_state("image",img_info.STATE)+'
'+tr('Running #VMS')+''+tr("Running #VMS")+''+img_info.RUNNING_VMS+'
' @@ -637,7 +640,7 @@ function updateImageInfo(request,img){ var template_tab = { title: tr("Image template"), content: '\ - '+ + '+ prettyPrintJSON(img_info.TEMPLATE)+ '
'+tr('Image template')+'
'+tr("Image template")+'
' } @@ -651,7 +654,7 @@ function updateImageInfo(request,img){ // Prepare the image creation dialog function setupCreateImageDialog(){ - dialogs_context.append('
'); + dialogs_context.append('
'); $create_image_dialog = $('#create_image_dialog',dialogs_context); var dialog = $create_image_dialog; dialog.html(create_image_tmpl); @@ -668,8 +671,8 @@ function setupCreateImageDialog(){ $('#img_tabs',dialog).tabs(); $('button',dialog).button(); - $('#img_type option',dialog).first().attr("selected","selected"); - $('#datablock_img',dialog).attr("disabled","disabled"); + $('#img_type option',dialog).first().attr('selected','selected'); + $('#datablock_img',dialog).attr('disabled','disabled'); $('select#img_type',dialog).change(function(){ var value = $(this).val(); @@ -679,23 +682,23 @@ function setupCreateImageDialog(){ $('#datablock_img',context).removeAttr("disabled"); break; default: - $('#datablock_img',context).attr("disabled","disabled"); - $('#path_img',context).attr("checked","checked"); + $('#datablock_img',context).attr('disabled','disabled'); + $('#path_img',context).attr('checked','checked'); $('#img_source,#img_fstype,#img_size',context).parent().hide(); $('#img_path',context).parent().show(); } }); $('#img_source,#img_fstype,#img_size',dialog).parent().hide(); - $('#path_img',dialog).attr("checked","checked"); + $('#path_img',dialog).attr('checked','checked'); $('#img_path',dialog).parent().addClass("img_man"); $('#img_public',dialog).click(function(){ - $('#img_persistent',$create_image_dialog).removeAttr("checked"); + $('#img_persistent',$create_image_dialog).removeAttr('checked'); }); $('#img_persistent',dialog).click(function(){ - $('#img_public',$create_image_dialog).removeAttr("checked"); + $('#img_public',$create_image_dialog).removeAttr('checked'); }); @@ -808,7 +811,7 @@ function setupCreateImageDialog(){ //Time to add custom attributes $('#custom_var_image_box option',$create_image_dialog).each(function(){ - var attr_name = $(this).attr("name"); + var attr_name = $(this).attr('name'); var attr_value = $(this).val(); img_json[attr_name] = attr_value; }); @@ -838,7 +841,7 @@ function popUpCreateImageDialog(){ function setupImageTemplateUpdateDialog(){ //Append to DOM - dialogs_context.append('
'); + dialogs_context.append('
'); var dialog = $('#image_template_update_dialog',dialogs_context); //Put HTML in place @@ -859,21 +862,22 @@ function setupImageTemplateUpdateDialog(){ var id = $(this).val(); if (id && id.length){ var dialog = $('#image_template_update_dialog'); - $('#image_template_update_textarea',dialog).val(tr("Loading")+"..."); + $('#image_template_update_textarea',dialog).val(tr("Loading")+ + "..."); var img_public = is_public_image(id); var img_persistent = is_persistent_image(id) if (img_public){ - $('#image_template_update_public',dialog).attr("checked","checked") + $('#image_template_update_public',dialog).attr('checked','checked') } else { - $('#image_template_update_public',dialog).removeAttr("checked") + $('#image_template_update_public',dialog).removeAttr('checked') } if (img_persistent){ - $('#image_template_update_persistent',dialog).attr("checked","checked") + $('#image_template_update_persistent',dialog).attr('checked','checked') } else { - $('#image_template_update_persistent',dialog).removeAttr("checked") + $('#image_template_update_persistent',dialog).removeAttr('checked') } Sunstone.runAction("Image.fetch_template",id); @@ -927,12 +931,12 @@ function popUpImageTemplateUpdateDialog(){ var dialog = $('#image_template_update_dialog'); $('#image_template_update_select',dialog).html(select); $('#image_template_update_textarea',dialog).val(""); - $('#image_template_update_public',dialog).removeAttr("checked") - $('#image_template_update_persistent',dialog).removeAttr("checked") + $('#image_template_update_public',dialog).removeAttr('checked') + $('#image_template_update_persistent',dialog).removeAttr('checked') if (sel_elems.length >= 1){ //several items in the list are selected //grep them - var new_select= sel_elems.length > 1? '' : ""; + var new_select= sel_elems.length > 1? '' : ""; $('option','').each(function(){ var val = $(this).val(); if ($.inArray(val,sel_elems) >= 0){ @@ -941,7 +945,7 @@ function popUpImageTemplateUpdateDialog(){ }); $('#image_template_update_select',dialog).html(new_select); if (sel_elems.length == 1) { - $('#image_template_update_select option',dialog).attr("selected","selected"); + $('#image_template_update_select option',dialog).attr('selected','selected'); $('#image_template_update_select',dialog).trigger("change"); } @@ -957,7 +961,7 @@ function setImageAutorefresh() { setInterval(function(){ var checked = $('input.check_item:checked',dataTable_images); var filter = $("#datatable_images_filter input", - dataTable_images.parents("#datatable_images_wrapper")).attr("value"); + dataTable_images.parents("#datatable_images_wrapper")).attr('value'); if (!checked.length && !filter.length){ Sunstone.runAction("Image.autorefresh"); } @@ -966,19 +970,19 @@ function setImageAutorefresh() { function is_public_image(id){ var data = getElementData(id,"#image",dataTable_images)[7]; - return $(data).attr("checked"); + return $(data).attr('checked'); }; function is_persistent_image(id){ var data = getElementData(id,"#image",dataTable_images)[8]; - return $(data).attr("checked"); + return $(data).attr('checked'); }; function setupImageActionCheckboxes(){ $('input.action_cb#cb_public_image',dataTable_images).live("click",function(){ var $this = $(this) - var id=$this.attr("elem_id"); - if ($this.attr("checked")){ + var id=$this.attr('elem_id'); + if ($this.attr('checked')){ if (!is_persistent_image(id)) Sunstone.runAction("Image.publish",id); else { @@ -992,8 +996,8 @@ function setupImageActionCheckboxes(){ $('input.action_cb#cb_persistent_image',dataTable_images).live("click",function(){ var $this = $(this) - var id=$this.attr("elem_id"); - if ($this.attr("checked")){ + var id=$this.attr('elem_id'); + if ($this.attr('checked')){ if (!is_public_image(id)) Sunstone.runAction("Image.persistent",id); else { @@ -1008,7 +1012,7 @@ function setupImageActionCheckboxes(){ $('select.action_cb#select_chtype_image', dataTable_images).live("change",function(){ var $this = $(this); var value = $this.val(); - var id = $this.attr("elem_id"); + var id = $this.attr('elem_id'); Sunstone.runAction("Image.chtype", id, value); }); diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 5a3c890a6c..f1d8f97d9c 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -54,7 +54,9 @@ var create_template_tmpl = '
\ XEN\
\ -->\ -

'+tr("Fields marked with")+''+tr("are mandatory")+'
\ +

'+ + tr("Fields marked with")+''+ + tr("are mandatory")+'
\ '+tr("Fold / Unfold all sections")+'

\
\ \ @@ -80,7 +82,7 @@ var create_template_tmpl = '
\
'+tr("Percentage of CPU divided by 100 required for the Virtual Machine. Half a processor is written 0.5.")+'
\
\
\ - \ + \ \
'+tr("Number of virtual cpus. This value is optional, the default hypervisor behavior is used, usually one virtual CPU.")+'
\
\ @@ -95,7 +97,7 @@ var create_template_tmpl = '
\
\
'+tr("OS and Boot options")+'\
\ - \ + \ \ \ - \ - \ + \ + \ \
'+tr("Select boot method")+'
\
\
\ - \ + \ \
'+tr("Path to the OS kernel to boot the image")+'
\
\
\ - \ + \ \
'+tr("Path to the initrd image")+'
\
\
\ - \ + \ \
'+tr("Device to be mounted as root")+'
\
\
\ - \ + \ \
'+tr("Arguments for the booting kernel")+'
\
\
\ - \ + \ \
'+tr("Path to the bootloader executable")+'
\
\
\ - \ + \ \
'+tr("Boot device type")+'
\ @@ -155,7 +157,7 @@ var create_template_tmpl = '
\
\
'+tr("Features")+'\
\ - \ + \ '+tr('Disk')+'\ + \ + '+tr("Disk")+'\ \ - '+tr('Image')+'\ + '+tr("Image")+'\ \
\
\
\ - \ + \ \ -
'+tr('Name of the image to use')+'
\ +
'+tr("Name of the image to use")+'
\ \
\
\ - \ + \ \ -
'+tr('Type of disk device to emulate: ide, scsi')+'
\ +
'+tr("Type of disk device to emulate: ide, scsi")+'
\
\
\ - \ + \ \ -
'+tr('Device to map image disk. If set, it will overwrite the default device mapping')+'
\ +
'+tr("Device to map image disk. If set, it will overwrite the default device mapping")+'
\
\
\ - \ + \ \ -
'+tr('Specific image mapping driver. KVM: raw, qcow2. Xen:tap:aio:, file:. VMware unsupported')+'
\ +
'+tr("Specific image mapping driver. KVM: raw, qcow2. Xen:tap:aio:, file:. VMware unsupported")+'
\
\
\ - \ + \ \ -
'+tr('Disk type')+'
\ +
'+tr("Disk type")+'
\
\
\ - \ + \ \ -
'+tr('Disk file location path or URL')+'
\ +
'+tr("Disk file location path or URL")+'
\
\
\ \ - \ + \ \ -
'+tr('Size in MB')+'
\ +
'+tr("Size in MB")+'
\
\
\ \ - \ + \ \ -
'+tr('Filesystem type for the fs images')+'
\ +
'+tr("Filesystem type for the fs images")+'
\
\
\ - \ + \ \ -
'+tr('Clone this image')+'
\ +
'+tr("Clone this image")+'
\
\
\ - \ + \ \ -
'+tr('Save this image after shutting down the VM')+'
\ +
'+tr("Save this image after shutting down the VM")+'
\
\
\ - \ + \ \ -
'+tr('Mount image as read-only')+'
\ +
'+tr("Mount image as read-only")+'
\
\
\ - \ - \ + \ + \
\ - \ + \ \
\ @@ -279,107 +281,107 @@ var create_template_tmpl = '
\ bridge, target, script, model -->\
\
\ -

'+tr('Setup Networks')+'

\ +

'+tr("Setup Networks")+'

\
\ -
'+tr('Network')+'\ +
'+tr("Network")+'\
\ - \ - '+tr('Predefined')+'\ + \ + '+tr("Predefined")+'\ \ - '+tr('Manual')+'\ + '+tr("Manual")+'\ \ \
\
\
\ - \ + \ \ -
'+tr('Name of the network to attach this device')+'
\ +
'+tr("Name of the network to attach this device")+'
\ \
\
\ - \ + \ \ -
'+tr('Request an specific IP from the Network')+'
\ +
'+tr("Request an specific IP from the Network")+'
\
\
\ - \ + \ \ -
'+tr('HW address associated with the network interface')+'
\ +
'+tr("HW address associated with the network interface")+'
\
\
\ - \ + \ \ -
'+tr('Name of the bridge the network device is going to be attached to')+'
\ +
'+tr("Name of the bridge the network device is going to be attached to")+'
\
\
\ - \ + \ \ -
'+tr('Name for the tun device created for the VM')+'
\ +
'+tr("Name for the tun device created for the VM")+'
\
\
\ - \ + \ \ -
'+tr('Name of a shell script to be executed after creating the tun device for the VM')+'
\ +
'+tr("Name of a shell script to be executed after creating the tun device for the VM")+'
\
\
\ - \ + \ \ -
'+tr('Hardware that will emulate this network interface. With Xen this is the type attribute of the vif.')+'
\ +
'+tr("Hardware that will emulate this network interface. With Xen this is the type attribute of the vif.")+'
\
\
\ - \ + \ \
\
\
\ - \ + \ \ -
'+tr('Permits access to the VM only through the specified ports in the TCP protocol')+'
\ +
'+tr("Permits access to the VM only through the specified ports in the TCP protocol")+'
\
\
\ - \ + \ \ -
'+tr('Disallow access to the VM through the specified ports in the TCP protocol')+'
\ +
'+tr("Disallow access to the VM through the specified ports in the TCP protocol")+'
\
\
\ - \ + \ \
\
\
\ - \ + \ \ -
'+tr('Permits access to the VM only through the specified ports in the UDP protocol')+'
\ +
'+tr("Permits access to the VM only through the specified ports in the UDP protocol")+'
\
\
\ - \ + \ \ -
'+tr('Disallow access to the VM through the specified ports in the UDP protocol')+'
\ +
'+tr("Disallow access to the VM through the specified ports in the UDP protocol")+'
\
\
\ - \ + \ \ -
'+tr('ICMP policy')+'
\ +
'+tr("ICMP policy")+'
\
\
\
\ - \ - \ + \ + \
\ - \ + \ \
\ @@ -402,7 +404,7 @@ var create_template_tmpl = '
\
\
\
\ - \ + \ \ \
\ @@ -429,7 +431,7 @@ var create_template_tmpl = '
\
\
'+tr("Graphics")+'\
\ - \ + \ \
'+tr("IP to listen on")+'
\
\
\ - \ + \ \
'+tr("Port for the VNC server")+'
\
\
\ - \ + \ \
'+tr("Password for the VNC server")+'
\
\ @@ -473,7 +475,7 @@ var create_template_tmpl = '
\
'+tr("Name for the context variable")+'
\
\
\ - \ + \ \
'+tr("Value of the context variable")+'
\
\ @@ -481,7 +483,7 @@ var create_template_tmpl = '
\ \ \
\ - \ + \ \
\ @@ -496,12 +498,12 @@ var create_template_tmpl = '
\
\
'+tr("Placement")+'\
\ - \ + \ \
'+tr("Boolean expression that rules out provisioning hosts from list of machines suitable to run this VM")+'
\
\
\ - \ + \ \
'+tr("This field sets which attribute will be used to sort the suitable hosts for this VM. Basically, it defines which hosts are more suitable than others")+'
\
\ @@ -517,7 +519,7 @@ var create_template_tmpl = '
\
'+tr("Raw")+'\ \
\ - \ + \ \ \
'+tr("Raw data to be passed directly to the hypervisor")+'
\ @@ -529,24 +531,24 @@ var create_template_tmpl = '
\ \
\
\ -

'+tr('Add custom variables')+'

\ +

'+tr("Add custom variables")+'

\
\ -
'+tr('Custom variables')+'\ +
'+tr("Custom variables")+'\
\ - \ + \ \ -
'+tr('Name for the custom variable')+'
\ +
'+tr("Name for the custom variable")+'
\
\
\ - \ + \ \ -
'+tr('Value of the custom variable')+'
\ +
'+tr("Value of the custom variable")+'
\
\
\ - \ - \ + \ + \
\ - \ + \ \
\ @@ -584,16 +586,16 @@ var create_template_tmpl = '
\ var update_template_tmpl = '\ -

'+tr('Please, choose and modify the template you want to update')+':

\ +

'+tr("Please, choose and modify the template you want to update")+':

\
\ - \ + \ \
\
\ - \ + \ \
\ - \ + \
\ \
\ @@ -770,14 +772,14 @@ var template_buttons = { type: "confirm_with_select", text: tr("Change owner"), select: users_sel, - tip: tr("Select the new owner:"), + tip: tr("Select the new owner")+":", condition: mustBeAdmin }, "Template.chgrp" : { type: "confirm_with_select", text: tr("Change group"), select: groups_sel, - tip: tr("Select the new group:"), + tip: tr("Select the new group")+":", condition: mustBeAdmin }, "action_list" : { @@ -911,7 +913,8 @@ function updateTemplateInfo(request,template){ content: '\ \ - \ + \ \ \ \ @@ -966,7 +969,7 @@ function setupCreateTemplateDialog(){ // ui.index // zero-based index of the selected (clicked) tab //disable all items - $(items,dialog).attr("disabled","disabled"); + $(items,dialog).attr('disabled','disabled'); //hide all mandatory icons $('.vm_param .man_icon',dialog).css("display","none"); @@ -980,7 +983,7 @@ function setupCreateTemplateDialog(){ $('.kernel, .bootloader', section_os_boot).hide(); $('select#BOOT',section_os_boot).parent().hide(); //unselect boot method - $('select#boot_method option',section_os_boot).removeAttr("selected"); + $('select#boot_method option',section_os_boot).removeAttr('selected'); //hide non common sections $(section_inputs).hide(); @@ -1030,7 +1033,7 @@ function setupCreateTemplateDialog(){ var enable_kvm = function(){ man_class="kvm"; opt_class="kvm_opt"; - $(kvm_items,dialog).removeAttr("disabled"); + $(kvm_items,dialog).removeAttr('disabled'); $('.kvm .man_icon',dialog).css("display","inline-block"); //KVM particularities: @@ -1079,7 +1082,7 @@ function setupCreateTemplateDialog(){ var enable_xen = function(){ man_class="xen"; opt_class="xen_opt"; - $(xen_items,dialog).removeAttr("disabled"); + $(xen_items,dialog).removeAttr('disabled'); $('.xen .man_icon',dialog).css("display","inline-block"); // XEN particularities: @@ -1115,7 +1118,7 @@ function setupCreateTemplateDialog(){ var enable_vmware = function() { man_class="vmware"; opt_class="vmware_opt"; - $(vmware_items,dialog).removeAttr("disabled"); + $(vmware_items,dialog).removeAttr('disabled'); $('.vmware .man_icon',dialog).css("display","inline-block"); //VMWARE particularities @@ -1153,7 +1156,7 @@ function setupCreateTemplateDialog(){ //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") || + if (item.parents(".vm_param").attr('disabled') || !(item.val().length)) { r = false; return false; @@ -1184,7 +1187,7 @@ function setupCreateTemplateDialog(){ var id = null; $.each(fields,function(){ var field = $(this); - if (!(field.parents(".vm_param").attr("disabled")) && + if (!(field.parents(".vm_param").attr('disabled')) && field.val().length){ //Pick up parent's ID if we do not have one id = field.attr('id').length ? field.attr('id') : field.parent().attr('id'); @@ -1218,7 +1221,7 @@ function setupCreateTemplateDialog(){ fields.each(function(){ var field=$(this); - if (!(field.parents(".vm_param").attr("disabled"))){ //if ! disabled + if (!(field.parents(".vm_param").attr('disabled'))){ //if ! disabled if (field.val().length){ //if has a length template_json[field.attr('id')]=field.val(); }; @@ -1333,19 +1336,19 @@ function setupCreateTemplateDialog(){ { case "kernel": $('.bootloader',section_os_boot).hide(); - $('.bootloader',section_os_boot).attr("disabled","disabled"); + $('.bootloader',section_os_boot).attr('disabled','disabled'); $('.kernel',section_os_boot).show(); - $('.kernel',section_os_boot).removeAttr("disabled"); + $('.kernel',section_os_boot).removeAttr('disabled'); break; case "bootloader": $('.kernel',section_os_boot).hide(); - $('.kernel',section_os_boot).attr("disabled","disabled"); + $('.kernel',section_os_boot).attr('disabled','disabled'); $('.bootloader',section_os_boot).show(); - $('.bootloader',section_os_boot).removeAttr("disabled"); + $('.bootloader',section_os_boot).removeAttr('disabled'); break; default: $('.kernel, .bootloader',section_os_boot).hide(); - $('.kernel, .bootloader',section_os_boot).attr("disabled","disabled"); + $('.kernel, .bootloader',section_os_boot).attr('disabled','disabled'); $('.kernel input, .bootloader input',section_os_boot).val(""); }; }); @@ -1389,26 +1392,26 @@ function setupCreateTemplateDialog(){ { case "disk": $('.add_image',section_disks).hide(); - $('.add_image',section_disks).attr("disabled","disabled"); + $('.add_image',section_disks).attr('disabled','disabled'); $('.add_disk',section_disks).show(); - $('.add_disk',section_disks).removeAttr("disabled"); + $('.add_disk',section_disks).removeAttr('disabled'); $('#TARGET',section_disks).parent().removeClass(opt_class); $('#TARGET',section_disks).parent().addClass(man_class); break; case "image": $('.add_disk',section_disks).hide(); - $('.add_disk',section_disks).attr("disabled","disabled"); + $('.add_disk',section_disks).attr('disabled','disabled'); $('.add_image',section_disks).show(); - $('.add_image',section_disks).removeAttr("disabled"); + $('.add_image',section_disks).removeAttr('disabled'); $('#TARGET',section_disks).parent().removeClass(man_class); $('#TARGET',section_disks).parent().addClass(opt_class); break; } $('#SIZE',section_disks).parent().hide(); - $('#SIZE',section_disks).parent().attr("disabled","disabled"); + $('#SIZE',section_disks).parent().attr('disabled','disabled'); $('#FORMAT',section_disks).parent().hide(); - $('#SIZE',section_disks).parent().attr("disabled","disabled"); - $('#TYPE :selected',section_disks).removeAttr("selected"); + $('#SIZE',section_disks).parent().attr('disabled','disabled'); + $('#TYPE :selected',section_disks).removeAttr('selected'); //hide_disabled(section_disks); }); @@ -1421,7 +1424,7 @@ function setupCreateTemplateDialog(){ case "swap": //size mandatory $('#SIZE',section_disks).parent().show(); - $('#SIZE',section_disks).parent().removeAttr("disabled"); + $('#SIZE',section_disks).parent().removeAttr('disabled'); $('#SIZE',section_disks).parent().removeClass(opt_class); $('#SIZE',section_disks).parent().addClass(man_class); @@ -1431,17 +1434,17 @@ function setupCreateTemplateDialog(){ //format hidden $('#FORMAT',section_disks).parent().hide(); - $('#FORMAT',section_disks).parent().attr("disabled","disabled"); + $('#FORMAT',section_disks).parent().attr('disabled','disabled'); //source hidden $('#SOURCE',section_disks).parent().hide(); $('#SOURCE',section_disks).parent(). - attr("disabled","disabled"); + attr('disabled','disabled'); break; case "fs": //size mandatory $('#SIZE',section_disks).parent().show(); - $('#SIZE',section_disks).parent().removeAttr("disabled"); + $('#SIZE',section_disks).parent().removeAttr('disabled'); $('#SIZE',section_disks).parent().removeClass(opt_class); $('#SIZE',section_disks).parent().addClass(man_class); @@ -1451,19 +1454,19 @@ function setupCreateTemplateDialog(){ //format mandatory $('#FORMAT',section_disks).parent().show(); - $('#FORMAT',section_disks).parent().removeAttr("disabled"); + $('#FORMAT',section_disks).parent().removeAttr('disabled'); $('#FORMAT',section_disks).parent().removeClass(opt_class); $('#FORMAT',section_disks).parent().addClass(man_class); //source hidden $('#SOURCE',section_disks).parent().hide(); $('#SOURCE',section_disks).parent(). - attr("disabled","disabled"); + attr('disabled','disabled'); break; case "block": //size shown and optional $('#SIZE',section_disks).parent().show(); - $('#SIZE',section_disks).parent().removeAttr("disabled"); + $('#SIZE',section_disks).parent().removeAttr('disabled'); $('#SIZE',section_disks).parent().removeClass(man_class); $('#SIZE',section_disks).parent().addClass(opt_class); @@ -1473,12 +1476,12 @@ function setupCreateTemplateDialog(){ //format hidden $('#FORMAT',section_disks).parent().hide(); - $('#FORMAT',section_disks).parent().attr("disabled","disabled"); + $('#FORMAT',section_disks).parent().attr('disabled','disabled'); //source hidden $('#SOURCE',section_disks).parent().hide(); $('#SOURCE',section_disks).parent(). - attr("disabled","disabled"); + attr('disabled','disabled'); break; case "floppy": case "disk": @@ -1486,7 +1489,7 @@ function setupCreateTemplateDialog(){ default: //size hidden $('#SIZE',section_disks).parent().hide(); - $('#SIZE',section_disks).parent().attr("disabled","disabled"); + $('#SIZE',section_disks).parent().attr('disabled','disabled'); //target mandatory $('#TARGET',section_disks).parent().removeClass(opt_class); @@ -1494,12 +1497,12 @@ function setupCreateTemplateDialog(){ //format optional $('#FORMAT',section_disks).parent().hide(); - $('#FORMAT',section_disks).parent().attr("disabled","disabled"); + $('#FORMAT',section_disks).parent().attr('disabled','disabled'); //source shown $('#SOURCE',section_disks).parent().show(); $('#SOURCE',section_disks).parent(). - removeAttr("disabled"); + removeAttr('disabled'); } //hide_disabled(section_disks); }); @@ -1544,23 +1547,23 @@ function setupCreateTemplateDialog(){ //firewall $('.firewall',section_networks).hide(); - $('.firewall',section_networks).attr("disabled","disabled"); + $('.firewall',section_networks).attr('disabled','disabled'); $('.firewall_select',section_networks).show(); - $('.firewall_select select option',section_networks).removeAttr("selected"); + $('.firewall_select select option',section_networks).removeAttr('selected'); select = $('#network_vs_niccfg :checked',section_networks).val(); switch (select) { case "network": $('.niccfg',section_networks).hide(); - $('.niccfg',section_networks).attr("disabled","disabled"); + $('.niccfg',section_networks).attr('disabled','disabled'); $('.network',section_networks).show(); - $('.network',section_networks).removeAttr("disabled"); + $('.network',section_networks).removeAttr('disabled'); break; case "niccfg": $('.network',section_networks).hide(); - $('.network',section_networks).attr("disabled","disabled"); + $('.network',section_networks).attr('disabled','disabled'); $('.niccfg',section_networks).show(); - $('.niccfg',section_networks).removeAttr("disabled"); + $('.niccfg',section_networks).removeAttr('disabled'); break; } //hide_disabled(section_networks); @@ -1569,21 +1572,21 @@ function setupCreateTemplateDialog(){ $('#black_white_tcp',section_networks).change(function(){ switch ($(this).val()) { case "whitelist": - $('#BLACK_PORTS_TCP',section_networks).parent().attr("disabled","disabled"); + $('#BLACK_PORTS_TCP',section_networks).parent().attr('disabled','disabled'); $('#BLACK_PORTS_TCP',section_networks).parent().hide(); - $('#WHITE_PORTS_TCP',section_networks).parent().removeAttr("disabled"); + $('#WHITE_PORTS_TCP',section_networks).parent().removeAttr('disabled'); $('#WHITE_PORTS_TCP',section_networks).parent().show(); break; case "blacklist": - $('#WHITE_PORTS_TCP',section_networks).parent().attr("disabled","disabled"); + $('#WHITE_PORTS_TCP',section_networks).parent().attr('disabled','disabled'); $('#WHITE_PORTS_TCP',section_networks).parent().hide(); - $('#BLACK_PORTS_TCP',section_networks).parent().removeAttr("disabled"); + $('#BLACK_PORTS_TCP',section_networks).parent().removeAttr('disabled'); $('#BLACK_PORTS_TCP',section_networks).parent().show(); break; default: - $('#WHITE_PORTS_TCP',section_networks).parent().attr("disabled","disabled"); + $('#WHITE_PORTS_TCP',section_networks).parent().attr('disabled','disabled'); $('#WHITE_PORTS_TCP',section_networks).parent().hide(); - $('#BLACK_PORTS_TCP',section_networks).parent().attr("disabled","disabled"); + $('#BLACK_PORTS_TCP',section_networks).parent().attr('disabled','disabled'); $('#BLACK_PORTS_TCP',section_networks).parent().hide(); }; }); @@ -1591,21 +1594,21 @@ function setupCreateTemplateDialog(){ $('#black_white_udp',section_networks).change(function(){ switch ($(this).val()) { case "whitelist": - $('#BLACK_PORTS_UDP',section_networks).parent().attr("disabled","disabled"); + $('#BLACK_PORTS_UDP',section_networks).parent().attr('disabled','disabled'); $('#BLACK_PORTS_UDP',section_networks).parent().hide(); - $('#WHITE_PORTS_UDP',section_networks).parent().removeAttr("disabled"); + $('#WHITE_PORTS_UDP',section_networks).parent().removeAttr('disabled'); $('#WHITE_PORTS_UDP',section_networks).parent().show(); break; case "blacklist": - $('#WHITE_PORTS_UDP',section_networks).parent().attr("disabled","disabled"); + $('#WHITE_PORTS_UDP',section_networks).parent().attr('disabled','disabled'); $('#WHITE_PORTS_UDP',section_networks).parent().hide(); - $('#BLACK_PORTS_UDP',section_networks).parent().removeAttr("disabled"); + $('#BLACK_PORTS_UDP',section_networks).parent().removeAttr('disabled'); $('#BLACK_PORTS_UDP',section_networks).parent().show(); break; default: - $('#WHITE_PORTS_UDP',section_networks).parent().attr("disabled","disabled"); + $('#WHITE_PORTS_UDP',section_networks).parent().attr('disabled','disabled'); $('#WHITE_PORTS_UDP',section_networks).parent().hide(); - $('#BLACK_PORTS_UDP',section_networks).parent().attr("disabled","disabled"); + $('#BLACK_PORTS_UDP',section_networks).parent().attr('disabled','disabled'); $('#BLACK_PORTS_UDP',section_networks).parent().hide(); }; }); @@ -1671,18 +1674,18 @@ function setupCreateTemplateDialog(){ $('#PORT',section_graphics).parent().show(); $('#PASSWD',section_graphics).parent().show(); $('#KEYMAP',section_graphics).parent().show(); - $('#PORT',section_graphics).parent().removeAttr("disabled"); - $('#PASSWD',section_graphics).parent().removeAttr("disabled"); - $('#KEYMAP',section_graphics).parent().removeAttr("disabled"); + $('#PORT',section_graphics).parent().removeAttr('disabled'); + $('#PASSWD',section_graphics).parent().removeAttr('disabled'); + $('#KEYMAP',section_graphics).parent().removeAttr('disabled'); break; case "sdl": $('#LISTEN',section_graphics).parent().show(); $('#PORT',section_graphics).parent().hide(); $('#PASSWD',section_graphics).parent().hide(); $('#KEYMAP',section_graphics).parent().hide(); - $('#PORT',section_graphics).parent().attr("disabled","disabled"); - $('#PASSWD',section_graphics).parent().attr("disabled","disabled"); - $('#KEYMAP',section_graphics).parent().attr("disabled","disabled"); + $('#PORT',section_graphics).parent().attr('disabled','disabled'); + $('#PASSWD',section_graphics).parent().attr('disabled','disabled'); + $('#KEYMAP',section_graphics).parent().attr('disabled','disabled'); break; default: $('#LISTEN',section_graphics).parent().hide(); @@ -1913,7 +1916,7 @@ function setupCreateTemplateDialog(){ scope = section_context; vm_json["CONTEXT"] = {}; $('#context_box option',scope).each(function(){ - name = $(this).attr("name"); + name = $(this).attr('name'); value = $(this).val(); vm_json["CONTEXT"][name]=value; }); @@ -1936,7 +1939,7 @@ function setupCreateTemplateDialog(){ //custom vars scope = section_custom_var; $('#custom_var_box option',scope).each(function(){ - name = $(this).attr("name"); + name = $(this).attr('name'); value = $(this).val(); vm_json[name]=value; }); @@ -1999,7 +2002,7 @@ function popUpCreateTemplateDialog(){ function setupTemplateTemplateUpdateDialog(){ //Append to DOM - dialogs_context.append('
'); + dialogs_context.append('
'); var dialog = $('#template_template_update_dialog',dialogs_context); //Put HTML in place @@ -2025,9 +2028,9 @@ function setupTemplateTemplateUpdateDialog(){ var templ_public = is_public_template(id); if (templ_public){ - $('#template_template_update_public',dialog).attr("checked","checked") + $('#template_template_update_public',dialog).attr('checked','checked') } else { - $('#template_template_update_public',dialog).removeAttr("checked") + $('#template_template_update_public',dialog).removeAttr('checked') } Sunstone.runAction("Template.fetch_template",id); @@ -2073,7 +2076,7 @@ function popUpTemplateTemplateUpdateDialog(){ var dialog = $('#template_template_update_dialog'); $('#template_template_update_select',dialog).html(select); $('#template_template_update_textarea',dialog).val(""); - $('#template_template_update_public',dialog).removeAttr("checked") + $('#template_template_update_public',dialog).removeAttr('checked') if (sel_elems.length >= 1){ //several items in the list are selected //grep them @@ -2086,7 +2089,7 @@ function popUpTemplateTemplateUpdateDialog(){ }); $('#template_template_update_select',dialog).html(new_select); if (sel_elems.length == 1) { - $('#template_template_update_select option',dialog).attr("selected","selected"); + $('#template_template_update_select option',dialog).attr('selected','selected'); $('#template_template_update_select',dialog).trigger("change"); }; @@ -2102,7 +2105,7 @@ function setTemplateAutorefresh() { setInterval(function(){ var checked = $('input.check_item:checked',dataTable_templates); var filter = $("#datatable_templates_filter input", - dataTable_templates.parents('#datatable_templates_wrapper')).attr("value"); + dataTable_templates.parents('#datatable_templates_wrapper')).attr('value'); if (!checked.length && !filter.length){ Sunstone.runAction("Template.autorefresh"); } @@ -2111,14 +2114,14 @@ function setTemplateAutorefresh() { function is_public_template(id){ var data = getElementData(id,"#template",dataTable_templates)[6]; - return $(data).attr("checked"); + return $(data).attr('checked'); }; function setupTemplateActionCheckboxes(){ $('input.action_cb#cb_public_template',dataTable_templates).live("click",function(){ var $this = $(this) - var id=$this.attr("elem_id"); - if ($this.attr("checked")) + var id=$this.attr('elem_id'); + if ($this.attr('checked')) Sunstone.runAction("Template.publish",id); else Sunstone.runAction("Template.unpublish",id); diff --git a/src/sunstone/public/js/plugins/users-tab.js b/src/sunstone/public/js/plugins/users-tab.js index b8362d5206..5ce9543a75 100644 --- a/src/sunstone/public/js/plugins/users-tab.js +++ b/src/sunstone/public/js/plugins/users-tab.js @@ -27,11 +27,11 @@ var users_tab_content =
'+tr("Template")+' \"'+template_info.NAME+'\" '+tr("information")+'
'+tr("Template")+' \"'+template_info.NAME+'\" '+ + tr("information")+'
'+tr("ID")+'
\ \ \ - \ - \ - \ - \ - \ + \ + \ + \ + \ + \ \ \ \ @@ -43,18 +43,18 @@ var create_user_tmpl = '\
\
\ - \ + \
\ - \ + \ \ - \ + \ \
\
\ @@ -69,15 +69,15 @@ var create_user_tmpl = var update_pw_tmpl = '\
\
\ -
'+tr('This will change the password for the selected users')+':
\ - \ +
'+tr("This will change the password for the selected users")+':
\ + \ \
\
\
\
\ - \ - \ + \ + \
\
\ '; @@ -252,20 +252,20 @@ var user_buttons = { type: "confirm_with_select", text: tr("Change group"), select: groups_sel, - tip: tr("This will change the main group of the selected users. Select the new group:") + tip: tr("This will change the main group of the selected users. Select the new group")+":" }, "User.chauth" : { type: "confirm_with_select", text: tr("Change authentication"), select: function() { - return '\ - \ - \ - \ - \ - ' + return '\ + \ + \ + \ + \ + ' }, - tip: tr("Please choose the new type of authentication for the selected users:") + tip: tr("Please choose the new type of authentication for the selected users")+":" }, // "User.addgroup" : { // type: "confirm_with_select", @@ -395,7 +395,7 @@ function setupCreateUserDialog(){ } function setupUpdatePasswordDialog(){ - dialogs_context.append('
'); + dialogs_context.append('
'); $update_pw_dialog = $('#update_user_pw_dialog',dialogs_context); var dialog = $update_pw_dialog; dialog.html(update_pw_tmpl); @@ -439,7 +439,7 @@ function setUserAutorefresh(){ setInterval(function(){ var checked = $('input.check_item:checked',dataTable_users); var filter = $("#datatable_users_filter input", - dataTable_users.parents("#datatable_users_wrapper")).attr("value"); + dataTable_users.parents("#datatable_users_wrapper")).attr('value'); if (!checked.length && !filter.length){ Sunstone.runAction("User.autorefresh"); } diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js index 21b7b0442f..eaa0190df2 100644 --- a/src/sunstone/public/js/plugins/vms-tab.js +++ b/src/sunstone/public/js/plugins/vms-tab.js @@ -75,12 +75,12 @@ var vms_tab_content = var create_vm_tmpl ='\
\
\ - \ + \
\ - \ + \
\ - \ + \ \
\
\ @@ -386,7 +386,7 @@ var vm_buttons = { type: "confirm_with_select", text: tr("Change owner"), select: users_sel, - tip: tr("Select the new owner:"), + tip: tr("Select the new owner")+":", condition: mustBeAdmin }, @@ -394,7 +394,7 @@ var vm_buttons = { type: "confirm_with_select", text: tr("Change group"), select: groups_sel, - tip: tr("Select the new group:"), + tip: tr("Select the new group")+":", condition: mustBeAdmin }, @@ -815,8 +815,8 @@ function setupSaveasDialog(){ var type = $('#image_type',this).val(); if (!id.length || !disk_id.length || !image_name.length) { - notifyError(tr("Skipping VM ")+id+ - tr(". No disk id or image name specified")); + notifyError(tr("Skipping VM ")+id+". "+ + tr("No disk id or image name specified")); } else { var obj = { @@ -853,25 +853,25 @@ function popUpSaveasDialog(elems){ var li = '
  • VM '+this+'
  • ' $('#saveas_tabs ul',dialog).append(li); var tab = '
    \ -
    '+tr('Saveas for VM with ID')+' '+this+'
    \ +
    '+tr("Saveas for VM with ID")+' '+this+'
    \
    \
    \ - \ + \ \
    \
    \ - \ + \ \
    \
    \ - \ + \ \
    \
    \ @@ -891,7 +891,7 @@ function saveasDisksCallback(req,response){ var gen_option = function(id, name, source){ if (name){ - return ''; + return ''; } else { return ''; @@ -918,7 +918,7 @@ function setVMAutorefresh(){ setInterval(function(){ var checked = $('input.check_item:checked',dataTable_vMachines); var filter = $("#datatable_vmachines_filter input", - dataTable_vMachines.parents('#datatable_vmachines_wrapper')).attr("value"); + dataTable_vMachines.parents('#datatable_vmachines_wrapper')).attr('value'); if (!checked.length && !filter.length){ Sunstone.runAction("VM.autorefresh"); }; @@ -996,16 +996,16 @@ function setupVNC(){ }); dialog.bind( "dialogclose", function(event, ui) { - var id = $vnc_dialog.attr("vm_id"); + var id = $vnc_dialog.attr('vm_id'); rfb.disconnect(); Sunstone.runAction("VM.stopvnc",id); }); $('.vnc',main_tabs_context).live("click",function(){ //Which VM is it? - var id = $(this).attr("vm_id"); + var id = $(this).attr('vm_id'); //Set attribute to dialog - $vnc_dialog.attr("vm_id",id); + $vnc_dialog.attr('vm_id',id); //Request proxy server start Sunstone.runAction("VM.startvnc",id); return false; diff --git a/src/sunstone/public/js/plugins/vnets-tab.js b/src/sunstone/public/js/plugins/vnets-tab.js index 10ec08d2db..1815b290ac 100644 --- a/src/sunstone/public/js/plugins/vnets-tab.js +++ b/src/sunstone/public/js/plugins/vnets-tab.js @@ -56,7 +56,7 @@ var create_vn_tmpl =
    \ \
    \ - \ + \ '+tr("Fixed network")+'
    \ '+tr("Ranged network")+'
    \
    \ @@ -64,7 +64,7 @@ var create_vn_tmpl =
    \
    \
    \ - \ + \
    \ \ \ @@ -75,7 +75,7 @@ var create_vn_tmpl = \ - \ + \
    \ @@ -83,9 +83,9 @@ var create_vn_tmpl =
    \
    \
    \ - \ + \
    \ - \ + \ \
    \
    \ @@ -94,14 +94,14 @@ var create_vn_tmpl = \
    \
    \ - \ + \ \ - \ + \ \ - \ - \ + \ + \
    \ - \ + \ \
    \ @@ -137,23 +137,23 @@ var create_vn_tmpl = var update_vnet_tmpl = '\ -

    '+tr('Please, choose and modify the virtual network you want to update')+':

    \ +

    '+tr("Please, choose and modify the virtual network you want to update")+':

    \
    \ - \ + \ \
    \
    \ - \ + \ \
    \ - \ + \
    \ \
    \
    \
    \ \
    \
    \ @@ -488,32 +488,33 @@ function updateVNetworkInfo(request,vn){ var info_tab_content = '
    '+tr('All')+''+tr('ID')+''+tr('Name')+''+tr('Group')+''+tr('Authentication driver')+''+tr("All")+''+tr("ID")+''+tr("Name")+''+tr("Group")+''+tr("Authentication driver")+'
    \ \ - \ + \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \
    '+tr('Virtual Network')+' '+vn_info.ID+' '+tr('information')+'
    '+tr("Virtual Network")+' '+vn_info.ID+' '+ + tr("information")+'
    '+tr('ID')+''+tr("ID")+''+vn_info.ID+'
    '+tr('Owner')+''+tr("Owner")+''+vn_info.UNAME+'
    '+tr('Group')+''+tr("Group")+''+vn_info.GNAME+'
    '+tr('Public')+''+tr("Public")+''+(parseInt(vn_info.PUBLIC) ? "yes" : "no" )+'
    '+tr('Physical device')+''+tr("Physical device")+''+(vn_info.PHYDEV ? vn_info.PHYDEV : "--" )+'
    \ \ \ - \ + \ '+ printLeases(vn_info.LEASES)+ '
    '+tr('Leases information')+'
    '+tr("Leases information")+'
    ';; @@ -700,7 +701,7 @@ function setupCreateVNetDialog() { //Time to add custom attributes $('#custom_var_vnet_box option',$create_vn_dialog).each(function(){ - var attr_name = $(this).attr("name"); + var attr_name = $(this).attr('name'); var attr_value = $(this).val(); network_json["vnet"][attr_name] = attr_value; }); @@ -728,7 +729,7 @@ function popUpCreateVnetDialog() { function setupVNetTemplateUpdateDialog(){ //Append to DOM - dialogs_context.append('
    '); + dialogs_context.append('
    '); var dialog = $('#vnet_template_update_dialog',dialogs_context); //Put HTML in place @@ -754,9 +755,9 @@ function setupVNetTemplateUpdateDialog(){ var vnet_public = is_public_vnet(id); if (vnet_public){ - $('#vnet_template_update_public',dialog).attr("checked","checked") + $('#vnet_template_update_public',dialog).attr('checked','checked') } else { - $('#vnet_template_update_public',dialog).removeAttr("checked") + $('#vnet_template_update_public',dialog).removeAttr('checked') } Sunstone.runAction("Network.fetch_template",id); @@ -802,7 +803,7 @@ function popUpVNetTemplateUpdateDialog(){ var dialog = $('#vnet_template_update_dialog'); $('#vnet_template_update_select',dialog).html(select); $('#vnet_template_update_textarea',dialog).val(""); - $('#vnet_template_update_public',dialog).removeAttr("checked") + $('#vnet_template_update_public',dialog).removeAttr('checked') if (sel_elems.length >= 1){ //several items in the list are selected //grep them @@ -815,7 +816,7 @@ function popUpVNetTemplateUpdateDialog(){ }); $('#vnet_template_update_select',dialog).html(new_select); if (sel_elems.length == 1) { - $('#vnet_template_update_select option',dialog).attr("selected","selected"); + $('#vnet_template_update_select option',dialog).attr('selected','selected'); $('#vnet_template_update_select',dialog).trigger("change"); } @@ -827,7 +828,7 @@ function popUpVNetTemplateUpdateDialog(){ } function setupAddRemoveLeaseDialog() { - dialogs_context.append('
    '); + dialogs_context.append('
    '); $lease_vn_dialog = $('#lease_vn_dialog',dialogs_context) var dialog = $lease_vn_dialog; @@ -835,10 +836,10 @@ function setupAddRemoveLeaseDialog() { dialog.html( '\
    \ -
    '+tr("Please specify:")+'
    \ - \ +
    '+tr("Please specify")+':
    \ + \
    \ - \ + \ \ \
    \ @@ -897,7 +898,7 @@ function setVNetAutorefresh() { setInterval(function(){ var checked = $('input.check_item:checked',dataTable_vNetworks); var filter = $("#datatable_vnetworks_filter input", - dataTable_vNetworks.parents("#datatable_vnetworks_wrapper")).attr("value"); + dataTable_vNetworks.parents("#datatable_vnetworks_wrapper")).attr('value'); if (!checked.length && !filter.length){ Sunstone.runAction("Network.autorefresh"); } @@ -906,14 +907,14 @@ function setVNetAutorefresh() { function is_public_vnet(id) { var data = getElementData(id,"#vnetwork",dataTable_vNetworks)[7]; - return $(data).attr("checked"); + return $(data).attr('checked'); }; function setupVNetActionCheckboxes(){ $('input.action_cb#cb_public_vnet',dataTable_vNetworks).live("click",function(){ var $this = $(this) - var id=$this.attr("elem_id"); - if ($this.attr("checked")) + var id=$this.attr('elem_id'); + if ($this.attr('checked')) Sunstone.runAction("Network.publish",id); else Sunstone.runAction("Network.unpublish",id); diff --git a/src/sunstone/public/js/sunstone-util.js b/src/sunstone/public/js/sunstone-util.js index f58320722f..e3fd24b939 100644 --- a/src/sunstone/public/js/sunstone-util.js +++ b/src/sunstone/public/js/sunstone-util.js @@ -112,13 +112,13 @@ function recountCheckboxes(dataTable){ }; //enable checkall box if (total_length == checked_length){ - $('.check_all',dataTable).attr("checked","checked"); + $('.check_all',dataTable).attr('checked','checked'); } else { - $('.check_all',dataTable).removeAttr("checked"); + $('.check_all',dataTable).removeAttr('checked'); }; } else { //no elements cheked //disable action buttons, uncheck checkAll - $('.check_all',dataTable).removeAttr("checked"); + $('.check_all',dataTable).removeAttr('checked'); $('.top_button, .list_button',context).button("disable"); last_action_b.button("disable"); }; @@ -299,11 +299,11 @@ function initCheckAllBoxes(datatable){ $('input.check_all',datatable).css({"border":"2px"}); $('input.check_all',datatable).change(function(){ var table = $(this).parents('table'); - var checked = $(this).attr("checked"); + var checked = $(this).attr('checked'); if (checked) { //check all - $('tbody input.check_item',table).attr("checked","checked"); + $('tbody input.check_item',table).attr('checked','checked'); } else { //uncheck all - $('tbody input.check_item',table).removeAttr("checked"); + $('tbody input.check_item',table).removeAttr('checked'); }; recountCheckboxes(table); }); @@ -640,7 +640,7 @@ function setupTemplateUpdateDialog(){ //Put HTML in place dialog.html( '\ -

    '+tr("Please, choose and modify the template you want to update:")+'

    \ +

    '+tr("Please, choose and modify the template you want to update")+':

    \
    \ \ \ @@ -717,7 +717,7 @@ function popUpTemplateUpdateDialog(elem_str,select_items,sel_elems){ }); $('#template_update_select',dialog).html(new_select); if (sel_elems.length == 1) { - $('#template_update_select option',dialog).attr("selected","selected"); + $('#template_update_select option',dialog).attr('selected','selected'); $('#template_update_select',dialog).trigger("change"); } }; diff --git a/src/sunstone/public/js/sunstone.js b/src/sunstone/public/js/sunstone.js index 95b2bce189..d27bfdf139 100644 --- a/src/sunstone/public/js/sunstone.js +++ b/src/sunstone/public/js/sunstone.js @@ -314,7 +314,7 @@ $(document).ready(function(){ $('.action_button').live("click",function(){ var error = 0; var table = null; - var value = $(this).attr("value"); + var value = $(this).attr('value'); var action = SunstoneCfg["actions"][value]; if (!action) { notifyError("Action "+value+" not defined."); @@ -549,8 +549,8 @@ function initListButtons(){ $('.multi_action_slct',main_tabs_context).each(function(){ //prepare replacement buttons var buttonset = $('
    '+tr('Previous action')+'').button(); - button1.attr("disabled","disabled"); + var button1 = $('').button(); + button1.attr('disabled','disabled'); var button2 = $('').button({ text:false, icons: { primary: "ui-icon-triangle-1-s" } @@ -563,7 +563,7 @@ function initListButtons(){ var options = $('option', $(this)); var list = $('
      '); $.each(options,function(){ - var classes = $(this).attr("class"); + var classes = $(this).attr('class'); var item = $('
    • '); var a = $(''+$(this).text()+''); a.val($(this).val()); @@ -590,7 +590,7 @@ function initListButtons(){ prev_action_button.removeClass("confirm_with_select_button"); prev_action_button.removeClass("confirm_button"); prev_action_button.removeClass("action_button"); - prev_action_button.addClass($(this).attr("class")); + prev_action_button.addClass($(this).attr('class')); prev_action_button.button("option","label",$(this).text()); prev_action_button.button("enable"); $(this).parents('ul').hide("blind",100); diff --git a/src/sunstone/public/locale/en_US/en_US.js b/src/sunstone/public/locale/en_US/en_US.js new file mode 100644 index 0000000000..60b7941364 --- /dev/null +++ b/src/sunstone/public/locale/en_US/en_US.js @@ -0,0 +1,485 @@ +/* -------------------------------------------------------------------------- */ +/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ +/* not use this file except in compliance with the License. You may obtain */ +/* a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ +/* See the License for the specific language governing permissions and */ +/* limitations under the License. */ +/* -------------------------------------------------------------------------- */ + +//Default translation template +lang="en_US" +datatable_lang="" +locale={ + "Accept (default)":"", + "Acl":"", + "ACL Rules":"", + "ACLs":"", + "ACL String preview":"", + "ACPI":"", + "Add":"", + "Add context variables":"", + "Add custom variables":"", + "Add disk/image":"", + "Add disks/images":"", + "Add Graphics":"", + "Add Hypervisor raw options":"", + "Add inputs":"", + "Add lease":"", + "Add network":"", + "Add placement options":"", + "Advanced mode":"", + "Affected resources":"", + "All":"", + "Allowed operations":"", + "Amount of RAM required for the VM, in Megabytes.":"", + "Applies to":"", + "Architecture":"", + "are mandatory":"", + "Arguments for the booting kernel":"", + "Authentication":"", + "Authentication driver":"", + "Block":"", + "Boolean expression that rules out provisioning hosts from list of machines suitable to run this VM":"", + "Boot":"", + "Boot device type":"", + "Bootloader":"", + "Boot method":"", + "Boot/OS options":"", + "Bridge":"", + "Bus":"", + "Cancel":"", + "Cannot contact server: is it running and reachable?":"", + "Canvas not supported.":"", + "Capacity":"", + "Capacity options":"", + "cdrom":"", + "CD-ROM":"", + "Change":"", + "Change authentication":"", + "Change group":"", + "Change owner":"", + "Change password":"", + "Clone":"", + "Clone this image":"", + "Community":"", + "Confirmation of action":"", + "Context":"", + "Context variable name and value must be filled in":"", + "Core":"", + "CPU":"", + "CPU architecture to virtualization":"", + "CPU Monitoring information":"", + "CPU Use":"", + "Create":"", + "Create ACL":"", + "Create an empty datablock":"", + "Create group":"", + "Create host":"", + "Create Image":"", + "Create user":"", + "Create Virtual Machine":"", + "Create Virtual Network":"", + "Create VM Template":"", + "Current disks":"", + "Current inputs":"", + "Current leases":"", + "Current NICs":"", + "Current variables":"", + "Custom attribute name and value must be filled in":"", + "Custom attributes":"", + "Custom variable name and value must be filled in":"", + "Custom variables":"", + "Dashboard":"", + "Data":"", + "Datablock":"", + "Default":"", + "Default (current image type)":"", + "Delete":"", + "Delete host":"", + "Deploy":"", + "Deploy ID":"", + "Deploy # VMs":"", + "Description":"", + "Device prefix":"", + "Device to be mounted as root":"", + "Device to map image disk. If set, it will overwrite the default device mapping":"", + "Disable":"", + "disabled":"", + "Disallow access to the VM through the specified ports in the TCP protocol":"", + "Disallow access to the VM through the specified ports in the UDP protocol":"", + "Disk":"", + "Disk file location path or URL":"", + "disk id":"", + "Disks":"", + "Disk type":"", + "Documentation":"", + "Do you want to proceed?":"", + "Driver":"", + "Driver default":"", + "Drivers":"", + "Drop":"", + "Dummy":"", + "EC2":"", + "Enable":"", + "Error":"", + "failed":"", + "fd":"", + "Features":"", + "Fields marked with":"", + "File":"", + "Filesystem type":"", + "Filesystem type for the fs images":"", + "Fill in a new password":"", + "Fixed network":"", + "Floppy":"", + "Fold / Unfold all sections":"", + "Format":"", + "FS":"", + "FS type":"", + "Get Information":"", + "Get Pool of my/group\'s resources":"", + "Get Pool of resources":"", + "Graphics":"", + "Graphics type":"", + "Group":"", + "Group ":"", + "Group name":"", + "Groups":"", + "Hardware that will emulate this network interface. With Xen this is the type attribute of the vif.":"", + "hd":"", + "Historical monitoring information":"", + "Hold":"", + "Host":"", + "Host information":"", + "Hostname":"", + "Host name missing!":"", + "Host parameters":"", + "Hosts":"", + "Hosts CPU":"", + "Host shares":"", + "Hosts memory":"", + "Hosts (total/active)":"", + "Host template":"", + "Human readable description of the image for other users.":"", + "HW address associated with the network interface":"", + "Icmp":"", + "ICMP policy":"", + "id":"", + "ID":"", + "IDE":"", + "Image":"", + "Image cannot be public and persistent":"", + "Image information":"", + "Image name":"", + "Images":"", + "Images (total/public)":"", + "Image template":"", + "IM MAD":"", + "Info":"", + "information":"", + "Information":"", + "Information Manager":"", + "Initrd":"", + "Inputs":"", + "Instantiate":"", + "IP":"", + "IP to listen on":"", + "Kernel":"", + "Kernel commands":"", + "Keyboard configuration locale to use in the VNC display":"", + "Keymap":"", + "KVM":"", + "LCM State":"", + "Lease IP":"", + "Lease MAC":"", + "Lease MAC (opt):":"", + "Lease management":"", + "Leases information":"", + "Listen IP":"", + "Live migrate":"", + "Loading":"", + "MAC":"", + "Make non persistent":"", + "Make persistent":"", + "Manage":"", + "Manual":"", + "Max Mem":"", + "Memory":"", + "Memory monitoring information":"", + "Memory use":"", + "Migrate":"", + "Model":"", + "Monitoring information":"", + "Mount image as read-only":"", + "Mouse":"", + "Name":"", + "Name for the context variable":"", + "Name for the custom variable":"", + "Name for the tun device created for the VM":"", + "Name of a shell script to be executed after creating the tun device for the VM":"", + "Name of the bridge the network device is going to be attached to":"", + "Name of the image to use":"", + "Name of the network to attach this device":"", + "Name that the Image will get. Every image must have a unique name.":"", + "Name that the VM will get for description purposes. If NAME is not supplied a name generated by one will be in the form of one-<VID>.":"", + "Net_RX":"", + "Net_TX":"", + "network":"", + "Network":"", + "Network Address":"", + "Network is unreachable: is OpenNebula running?":"", + "Network reception":"", + "Network size":"", + "Network transmission":"", + "Network type":"", + "New":"", + "+ New":"", + "+ New Group":"", + "New password":"", + "No":"", + "No disk id or image name specified":"", + "No disks defined":"", + "None":"", + "Number of virtual cpus. This value is optional, the default hypervisor behavior is used, usually one virtual CPU.":"", + "OK":"", + "Open VNC Session":"", + "Optional, please select":"", + "OS":"", + "OS and Boot options":"", + "Owned by group":"", + "Owner":"", + "PAE":"", + "Password":"", + "Password for the VNC server":"", + "Path":"", + "Path to the bootloader executable":"", + "Path to the initrd image":"", + "Path to the original file that will be copied to the image repository. If not specified for a DATABLOCK type image, an empty image will be created.":"", + "Path to the OS kernel to boot the image":"", + "Path vs. source":"", + "Percentage of CPU divided by 100 required for the Virtual Machine. Half a processor is written 0.5.":"", + "Permits access to the VM only through the specified ports in the TCP protocol":"", + "Permits access to the VM only through the specified ports in the UDP protocol":"", + "Persistence of the image":"", + "Persistent":"", + "Physical address extension mode allows 32-bit guests to address more than 4 GB of memory":"", + "Physical device":"", + "Placement":"", + "Please choose":"", + "Please, choose and modify the image you want to update":"", + "Please, choose and modify the template you want to update":"", + "Please, choose and modify the virtual network you want to update":"", + "Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.":"", + "Please choose the new type of authentication for the selected users":"", + "Please provide a lease IP":"", + "Please provide a network address":"", + "Please provide a resource ID for the resource(s) in this rule":"", + "Please select":"", + "Please select at least one resource":"", + "Please specify":"", + "Please specify to who this ACL applies":"", + "Port":"", + "Port blacklist":"", + "Port for the VNC server":"", + "Port whitelist":"", + "Predefined":"", + "Prefix for the emulated device this image will be mounted at. For instance, “hd”, “sd”. If omitted, the default value is the one defined in oned.conf (installation default is “hd”).":"", + "Previous action":"", + "Provide a path":"", + "Provide a source":"", + "PS2":"", + "Public":"", + "Public scope of the image":"", + "Publish":"", + "Quickstart":"", + "Ranged network":"", + "Rank":"", + "Raw":"", + "Raw data to be passed directly to the hypervisor":"", + "Read only":"", + "Refresh list":"", + "Register time":"", + "Registration time":"", + "Release":"", + "Remove lease":"", + "Remove selected":"", + "Request an specific IP from the Network":"", + "Requirements":"", + "Reset":"", + "Resource ID":"", + "Resource ID / Owned by":"", + "Resource subset":"", + "Restart":"", + "Resubmit":"", + "Resume":"", + "Retrieving":"", + "Root":"", + "running":"", + "Running VMs":"", + "Running #VMS":"", + "Save":"", + "Save as":"", + "Saveas for VM with ID":"", + "Save this image after shutting down the VM":"", + "Script":"", + "SCSI":"", + "SDL":"", + "Select a network":"", + "Select an image":"", + "Select a template":"", + "Select boot method":"", + "Select disk":"", + "Select template":"", + "Select the new group":"", + "Select the new owner":"", + "Server (Cipher)":"", + "Server (x509)":"", + "Setup Networks":"", + "Shared":"", + "Shutdown":"", + "Sign out":"", + "Size":"", + "Size in MB":"", + "Size (Mb)":"", + "Size of the datablock in MB.":"", + "Skipping VM ":"", + "Source":"", + "Source to be used in the DISK attribute. Useful for not file-based images.":"", + "Specific ID":"", + "Specific image mapping driver. KVM: raw, qcow2. XEN: tap:aio, file:":"", + "Specific image mapping driver. KVM: raw, qcow2. Xen:tap:aio:, file:. VMware unsupported":"", + "SSH":"", + "Start time":"", + "Start Time":"", + "State":"", + "Status":"", + "Stop":"", + "Submitted":"", + "Summary of resources":"", + "Support":"", + "Suspend":"", + "Swap":"", + "Tablet":"", + "Target":"", + "Tcp black ports":"", + "Tcp firewall mode":"", + "Tcp white ports":"", + "Template":"", + "Template information":"", + "Templates":"", + "Template updated correctly":"", + "There are mandatory fields missing in the capacity section":"", + "There are mandatory fields missing in the OS Boot options section":"", + "There are mandatory parameters missing":"", + "There are mandatory parameters missing in this section":"", + "This field sets which attribute will be used to sort the suitable hosts for this VM. Basically, it defines which hosts are more suitable than others":"", + "This rule applies to":"", + "This will cancel selected VMs":"", + "This will change the main group of the selected users. Select the new group":"", + "This will change the password for the selected users":"", + "This will delete the selected VMs from the database":"", + "This will deploy the selected VMs on the chosen host":"", + "This will hold selected pending VMs from being deployed":"", + "This will initiate the shutdown process in the selected VMs":"", + "This will live-migrate the selected VMs to the chosen host":"", + "This will migrate the selected VMs to the chosen host":"", + "This will redeploy selected VMs (in UNKNOWN or BOOT state)":"", + "This will release held machines":"", + "This will resubmits VMs to PENDING state":"", + "This will resume selected stopped or suspended VMs":"", + "This will suspend selected machines":"", + "TM MAD":"", + "total":"", + "Total Leases":"", + "Total VM count":"", + "Total VM CPU":"", + "Total VM Memory":"", + "Transfer Manager":"", + "Type":"", + "Type of disk device to emulate.":"", + "Type of disk device to emulate: ide, scsi":"", + "Type of file system to be built. This can be any value understood by mkfs unix command.":"", + "Type of the image, explained in detail in the following section. If omitted, the default value is the one defined in oned.conf (install default is OS).":"", + "Udp black ports":"", + "Udp firewall mode":"", + "Udp white ports":"", + "Unauthorized":"", + "Unpublish":"", + "Update":"", + "Update a template":"", + "Update image template":"", + "Update network template":"", + "Update template":"", + "USB":"", + "Use":"", + "Used CPU":"", + "Used CPU (allocated)":"", + "Used CPU (real)":"", + "Used Mem (allocated)":"", + "Used Memory":"", + "Used Mem (real)":"", + "Useful for power management, for example, normally required for graceful shutdown to work":"", + "User":"", + "Username":"", + "User name and password must be filled in":"", + "Users":"", + "Value":"", + "Value of the context variable":"", + "Value of the custom variable":"", + "VCPU":"", + "Virtio":"", + "Virtio (KVM)":"", + "Virtualization Manager":"", + "Virtual Machine information":"", + "Virtual Machines":"", + "Virtual Network":"", + "Virtual network information":"", + "Virtual Network information":"", + "Virtual Network name missing!":"", + "Virtual Networks":"", + "Virtual Networks (total/public)":"", + "Virtual network template":"", + "Virtual Network template":"", + "VM information":"", + "VM Instance":"", + "VM Instances":"", + "VM log":"", + "VM MAD":"", + "VM Name":"", + "VM Network stats":"", + "#VMS":"", + "VM Save As":"", + "VM template":"", + "VM Template":"", + "VM Templates":"", + "VM Templates (total/public)":"", + "VNC":"", + "VNC Access":"", + "VNC connection":"", + "VNC Disabled":"", + "VNC Session":"", + "Welcome":"", + "Wizard":"", + "Wizard KVM":"", + "Wizard VMware":"", + "Wizard XEN":"", + "Write the image template here":"", + "Write the Virtual Machine template here":"", + "Write the Virtual Network template here":"", + "x509":"", + "XEN":"", + "Xen templates must specify a boot method":"", + "yes":"", + "Yes":"", + "You have not selected a template":"", + "You have to confirm this action.":"", + "You need to select something.":"", +}; diff --git a/src/sunstone/public/locale/generate_translation_template.rb b/src/sunstone/public/locale/generate_translation_template.rb new file mode 100755 index 0000000000..d9ba13fa0d --- /dev/null +++ b/src/sunstone/public/locale/generate_translation_template.rb @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +#tr_strings = $stdin.read +tr_strings = `grep -h -o -R -e 'tr("[[:print:]]*")' ../js/* | cut -d'"' -f 2 | sort -u` + +puts "//Default translation template" +puts 'lang="en_US"' +puts 'datatable_lang=""' +puts "locale={" + +tr_strings.each_line do | line | + puts " \"#{line.chomp}\":\"\"," +end + +puts "};" diff --git a/src/sunstone/views/index.erb b/src/sunstone/views/index.erb index 3e7d46cdda..2872cb99c3 100644 --- a/src/sunstone/views/index.erb +++ b/src/sunstone/views/index.erb @@ -66,7 +66,7 @@
      - Welcome  | Sign Out + Welcome  | Sign Out
      @@ -77,9 +77,9 @@