diff --git a/install.sh b/install.sh index 048ef1b526..b2b2f080f6 100755 --- a/install.sh +++ b/install.sh @@ -253,6 +253,9 @@ SUNSTONE_DIRS="$SUNSTONE_LOCATION/models \ $SUNSTONE_LOCATION/public/js/plugins \ $SUNSTONE_LOCATION/public/js/user-plugins \ $SUNSTONE_LOCATION/public/css \ + $SUNSTONE_LOCATION/public/locale \ + $SUNSTONE_LOCATION/public/locale/en_US \ + $SUNSTONE_LOCATION/public/locale/ru \ $SUNSTONE_LOCATION/public/vendor \ $SUNSTONE_LOCATION/public/vendor/jQueryLayout \ $SUNSTONE_LOCATION/public/vendor/dataTables \ @@ -426,6 +429,8 @@ INSTALL_SUNSTONE_FILES=( SUNSTONE_PUBLIC_VENDOR_JQUERYLAYOUT:$SUNSTONE_LOCATION/public/vendor/jQueryLayout SUNSTONE_PUBLIC_VENDOR_FLOT:$SUNSTONE_LOCATION/public/vendor/flot SUNSTONE_PUBLIC_IMAGES_FILES:$SUNSTONE_LOCATION/public/images + SUNSTONE_PUBLIC_LOCALE_EN_US:$SUNSTONE_LOCATION/public/locale/en_US + SUNSTONE_PUBLIC_LOCALE_RU:$SUNSTONE_LOCATION/public/locale/ru ) INSTALL_SUNSTONE_ETC_FILES=( @@ -1046,7 +1051,8 @@ SUNSTONE_PUBLIC_JS_FILES="src/sunstone/public/js/layout.js \ src/sunstone/public/js/login.js \ src/sunstone/public/js/sunstone.js \ src/sunstone/public/js/sunstone-util.js \ - src/sunstone/public/js/opennebula.js" + src/sunstone/public/js/opennebula.js \ + src/sunstone/public/js/locale.js" SUNSTONE_PUBLIC_JS_PLUGINS_FILES="\ src/sunstone/public/js/plugins/dashboard-tab.js \ @@ -1058,7 +1064,8 @@ SUNSTONE_PUBLIC_JS_PLUGINS_FILES="\ src/sunstone/public/js/plugins/users-tab.js \ src/sunstone/public/js/plugins/vms-tab.js \ src/sunstone/public/js/plugins/acls-tab.js \ - src/sunstone/public/js/plugins/vnets-tab.js" + src/sunstone/public/js/plugins/vnets-tab.js \ + src/sunstone/public/js/plugins/config-tab.js" SUNSTONE_PUBLIC_CSS_FILES="src/sunstone/public/css/application.css \ src/sunstone/public/css/layout.css \ @@ -1129,6 +1136,16 @@ SUNSTONE_PUBLIC_IMAGES_FILES="src/sunstone/public/images/ajax-loader.gif \ src/sunstone/public/images/green_bullet.png \ src/sunstone/public/images/vnc_off.png \ src/sunstone/public/images/vnc_on.png" + +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 \ +src/sunstone/public/locale/ru/ru_datatable.txt" + + #----------------------------------------------------------------------------- # Ozones files @@ -1189,8 +1206,9 @@ OZONES_PUBLIC_JS_FILES="src/ozones/Server/public/js/ozones.js \ src/ozones/Server/public/js/ozones-util.js \ src/sunstone/public/js/layout.js \ src/sunstone/public/js/sunstone.js \ - src/sunstone/public/js/sunstone-util.js" - + src/sunstone/public/js/sunstone-util.js \ + src/sunstone/public/js/locale.js" + OZONES_PUBLIC_CSS_FILES="src/ozones/Server/public/css/application.css \ src/ozones/Server/public/css/layout.css \ src/ozones/Server/public/css/login.css" diff --git a/src/sunstone/etc/sunstone-plugins.yaml b/src/sunstone/etc/sunstone-plugins.yaml index 38228d404e..ce33cfff64 100644 --- a/src/sunstone/etc/sunstone-plugins.yaml +++ b/src/sunstone/etc/sunstone-plugins.yaml @@ -45,3 +45,7 @@ :user: :group: oneadmin: true +- plugins/config-tab.js: + :ALL: true + :user: + :group: diff --git a/src/sunstone/etc/sunstone-server.conf b/src/sunstone/etc/sunstone-server.conf index 4391ca8a5f..1927bfb949 100644 --- a/src/sunstone/etc/sunstone-server.conf +++ b/src/sunstone/etc/sunstone-server.conf @@ -17,4 +17,7 @@ # VNC Configuration :vnc_proxy_base_port: 29876 -:novnc_path: +:novnc_path: + +# Default language setting +:lang: en_US diff --git a/src/sunstone/models/OpenNebulaJSON/UserJSON.rb b/src/sunstone/models/OpenNebulaJSON/UserJSON.rb index 726845d23c..a2d89476a4 100644 --- a/src/sunstone/models/OpenNebulaJSON/UserJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/UserJSON.rb @@ -64,7 +64,7 @@ module OpenNebulaJSON end def update(params=Hash.new) - super(params['raw_template']) + super(params['template_raw']) end def addgroup(params=Hash.new) diff --git a/src/sunstone/public/js/locale.js b/src/sunstone/public/js/locale.js new file mode 100644 index 0000000000..d5b1e970c5 --- /dev/null +++ b/src/sunstone/public/js/locale.js @@ -0,0 +1,88 @@ +/* -------------------------------------------------------------------------- */ +/* 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. */ +/* -------------------------------------------------------------------------- */ + +var lang="" +var locale = {}; +var datatable_lang = ""; + +function tr(str){ + var tmp = locale[str]; + if ( tmp == null || tmp == "" ) { + //console.debug("Missing translation: "+str); + tmp = str; + } + return tmp; +}; + +//Pops up loading new language dialog. Retrieves the user template, updates the LANG variable. +//Updates template and session configuration and reloads the view. +function setLang(lang_str){ + var lang_tmp=""; + var dialog = $('
'+tr("Loading new language... please wait")+' '+spinner+'
').dialog({ + draggable:false, + modal:true, + resizable:false, + buttons:{}, + width: 460, + minHeight: 50 + + }); + + var updateUserTemplate = function(request,user_json){ + var template = user_json.USER.TEMPLATE; + var template_str=""; + template["LANG"] = lang_tmp; + + //convert json to ONE template format - simple conversion + $.each(template,function(key,value){ + template_str += (key + '=' + '"' + value + '"\n'); + }); + + var obj = { + data: { + id: uid, + extra_param: template_str + }, + error: onError + }; + OpenNebula.User.update(obj); + $.post('config',JSON.stringify({lang:lang_tmp}),function(){window.location.href = "."}); + + }; + + lang_tmp = lang_str; + + if (whichUI() == "sunstone"){ + var obj = { + data : { + id: uid, + }, + success: updateUserTemplate + }; + OpenNebula.User.show(obj); + } else { + dialog.dialog('close'); + }; +}; + +$(document).ready(function(){ + //Update static translations + $('#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 ad94ffd2b6..f0515f0bcb 100644 --- a/src/sunstone/public/js/plugins/acls-tab.js +++ b/src/sunstone/public/js/plugins/acls-tab.js @@ -25,12 +25,12 @@ var acls_tab_content = \ \ \ - \ - \ - \ - \ - \ - \ + \ + \ + \ + \ + \ + \ \ \ \ @@ -42,48 +42,48 @@ var create_acl_tmpl = '\
\
\ - \ + \ \
\ - \ - Hosts
\ - Virtual Machines
\ - Virtual Networks
\ - Images
\ - Templates
\ - Users
\ - Groups
\ + \ + '+tr("Hosts")+'
\ + '+tr("Virtual Machines")+'
\ + '+tr("Virtual Networks")+'
\ + '+tr("Images")+'
\ + '+tr("Templates")+'
\ + '+tr("Users")+'
\ + '+tr("Groups")+'
\
\ - \ - All
\ - Specific ID
\ - Owned by group
\ + \ + '+tr("All")+'
\ + '+tr("Specific ID")+'
\ + '+tr("Owned by group")+'
\
\ - \ + \ \
\ - \ + \ \
\ - \ - Create
\ - Delete
\ - Use
\ - Manage
\ - Get Information
\ - Get Pool of resources
\ - Get Pool of my/group\'s resources
\ - Change owner
\ - Deploy
\ + \ + '+tr("Create")+'
\ + '+tr("Delete")+'
\ + '+tr("Use")+'
\ + '+tr("Manage")+'
\ + '+tr("Get Information")+'
\ + '+tr("Get Pool of resources")+'
\ + '+tr("Get Pool of my/group\'s resources")+'
\ + '+tr("Change owner")+'
\ + '+tr("Deploy")+'
\
\ - \ + \ \
\
\
\
\ - \ - \ + \ + \
\
\ '; @@ -143,21 +143,21 @@ var acl_actions = { var acl_buttons = { "Acl.refresh" : { type: "image", - text: "Refresh list", + text: tr("Refresh list"), img: "images/Refresh-icon.png" }, "Acl.create_dialog" : { type: "create_dialog", - text: "+ New" + text: tr("+ New") }, "Acl.delete" : { type: "action", - text: "Delete" + text: tr("Delete") } } var acls_tab = { - title: "ACLs", + title: tr("ACLs"), content: acls_tab_content, buttons: acl_buttons } @@ -179,14 +179,14 @@ function aclElements(){ function parseUserAcl(user){ var user_str=""; if (user[0] == '*'){ - user_str = "All"; + user_str = tr("All"); } else { if (user[0] == '#'){ - user_str="User "; + user_str=tr("User")+" "; user_str+= getUserName(user.substring(1)); } else if (user[0] == '@'){ - user_str="Group "; + user_str=tr("Group "); user_str+= getGroupName(user.substring(1)); }; }; @@ -197,14 +197,14 @@ function parseUserAcl(user){ function parseResourceAcl(user){ var user_str=""; if (user[0] == '*'){ - user_str = "All"; + user_str = tr("All"); } else { if (user[0] == '#'){ - user_str="ID "; + user_str=tr("ID")+" "; user_str+= user.substring(1); } else if (user[0] == '@'){ - user_str="Group "; + user_str=tr("Group")+" "; user_str+= getGroupName(user.substring(1)); }; }; @@ -232,25 +232,25 @@ function parseAclString(string) { for (var i=0; i'); + dialogs_context.append('
'); $create_acl_dialog = $('#create_acl_dialog',dialogs_context); var dialog = $create_acl_dialog; dialog.html(create_acl_tmpl); @@ -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; }; }); @@ -391,13 +391,13 @@ function setupCreateAclDialog(){ $('#create_acl_form',dialog).submit(function(){ var user = $('#applies',this).val(); if (!user.length) { - notifyError("Please specify to who this ACL applies"); + notifyError(tr("Please specify to who this ACL applies")); return false; }; var resources = $('.resource_cb:checked',this).length; if (!resources) { - notifyError("Please select at least one resource"); + notifyError(tr("Please select at least one resource")); return false; } @@ -406,7 +406,7 @@ function setupCreateAclDialog(){ case "res_id": var l=$('#res_id',this).val().length; if (!l){ - notifyError("Please provide a resource ID for the resource(s) in this rule"); + notifyError(tr("Please provide a resource ID for the resource(s) in this rule")); return false; } break; @@ -441,15 +441,15 @@ function popUpCreateAclDialog(){ var users = $(''); $('.empty_value',users).remove(); $('option',users).addClass("user"); - users.prepend(''); + users.prepend(''); var groups = $(''); $('.empty_value',groups).remove(); $('option',groups).addClass("group"); - groups.prepend(''); + groups.prepend(''); var dialog = $create_acl_dialog; - $('#applies',dialog).html(''+ + $('#applies',dialog).html(''+ users.html()+groups.html()); $('#belonging_to',dialog).html(groups_select); @@ -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"); } @@ -480,7 +480,11 @@ $(document).ready(function(){ { "bSortable": false, "aTargets": ["check"] }, { "sWidth": "60px", "aTargets": [0] }, { "sWidth": "35px", "aTargets": [1] } - ] + ], + "oLanguage": (datatable_lang != "") ? + { + sUrl: "locale/"+lang+"/"+datatable_lang + } : "" }); dataTable_acls.fnClearTable(); addElement([ diff --git a/src/sunstone/public/js/plugins/config-tab.js b/src/sunstone/public/js/plugins/config-tab.js new file mode 100644 index 0000000000..cba0c032ca --- /dev/null +++ b/src/sunstone/public/js/plugins/config-tab.js @@ -0,0 +1,58 @@ +/* -------------------------------------------------------------------------- */ +/* 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. */ +/* -------------------------------------------------------------------------- */ + +var config_tab_content = +'
\ +
AllIDApplies toAffected resourcesResource ID / Owned byAllowed operations'+tr("All")+''+tr("ID")+''+tr("Applies to")+''+tr("Affected resources")+''+tr("Resource ID / Owned by")+''+tr("Allowed operations")+'
\ + \ + \ + \ +
\ +
\ +

' + tr("Sunstone UI Configuration") + '

\ +
\ +\ + \ + \ + \ + \ + \ +
' + tr("Language") + '\ + \ +
\ +\ +
\ +
\ +
'; + +var config_tab = { + title: tr("Configuration"), + content: config_tab_content +} + +Sunstone.addMainTab('config_tab',config_tab); + +$(document).ready(function(){ + if (lang) + $('table#config_table #lang_sel option[value="'+lang+'"]').attr('selected','selected'); + $('table#config_table #lang_sel').change(function(){ + setLang($(this).val()); + }); + +}); \ No newline at end of file diff --git a/src/sunstone/public/js/plugins/dashboard-tab.js b/src/sunstone/public/js/plugins/dashboard-tab.js index 92a38ba49c..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 = \ \
\ -

Summary of resources

\ +

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

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

Quickstart

\ +

' + tr("Quickstart") + '

\
\
\ - \ - Host
\ - VM Instance
\ - VM Template
\ - Virtual Network
\ - Image
\ - User
\ - Group
\ - 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 = \ \
\ -

Historical monitoring information

\ +

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

\
\ \ - \ + \ \ \ - \ + \ \ \ - \ + \ \ \ - \ + \ \ \
Hosts CPU
' + tr("Hosts CPU") + '
'+spinner+'
Hosts memory
' + tr("Hosts memory") + '
'+spinner+'
Total VM count
' + tr("Total VM count") + '
'+spinner+'
VM Network stats
' + tr("VM Network stats") + '
'+spinner+'
\ @@ -143,7 +147,7 @@ var dashboard_tab_content = '; var dashboard_tab = { - title: 'Dashboard', + title: tr("Dashboard"), content: dashboard_tab_content } @@ -163,7 +167,7 @@ function plot_global_graph(data,info){ for (var i=0; i\ \
\ -

Summary of resources

\ +

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

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

Quickstart

\ +

'+tr("Quickstart")+'

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

Historical monitoring information

\ +

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

\
\ \ - \ + \ \ \ - \ + \ \ \ - \ + \ \ \ - \ + \ \ \
Total VM count
'+tr("Total VM count")+'
'+spinner+'
Total VM CPU
'+tr("Total VM CPU")+'
'+spinner+'
Total VM Memory
'+tr("Total VM Memory")+'
'+spinner+'
VM Network stats
'+tr("VM Network stats")+'
'+spinner+'
\ @@ -123,7 +126,7 @@ var dashboard_tab_content = '; var dashboard_tab = { - title: '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 0f1b39a5c9..1a31960052 100644 --- a/src/sunstone/public/js/plugins/groups-tab.js +++ b/src/sunstone/public/js/plugins/groups-tab.js @@ -25,10 +25,10 @@ var groups_tab_content = \ \ \ - \ - \ - \ - \ + \ + \ + \ + \ \ \ \ @@ -40,14 +40,14 @@ var create_group_tmpl = '\
\
\ - \ + \
\
\
\
\
\ - \ - \ + \ + \
\
\ '; @@ -118,12 +118,12 @@ var group_actions = { var group_buttons = { "Group.refresh" : { type: "image", - text: "Refresh list", + text: tr("Refresh list"), img: "images/Refresh-icon.png" }, "Group.create_dialog" : { type: "create_dialog", - text: "+ New Group" + text: tr("+ New Group") }, // "Group.chown" : { // type: "confirm_with_select", @@ -135,12 +135,12 @@ var group_buttons = { "Group.delete" : { type: "action", - text: "Delete" + text: tr("Delete") } }; var groups_tab = { - title: 'Groups', + title: tr("Groups"), content: groups_tab_content, buttons: group_buttons } @@ -228,7 +228,7 @@ function updateGroupsView(request, group_list){ //Prepares the dialog to create function setupCreateGroupDialog(){ - dialogs_context.append('
'); + dialogs_context.append('
'); $create_group_dialog = $('#create_group_dialog',dialogs_context); var dialog = $create_group_dialog; @@ -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"); } @@ -276,7 +276,11 @@ $(document).ready(function(){ { "bSortable": false, "aTargets": ["check"] }, { "sWidth": "60px", "aTargets": [0] }, { "sWidth": "35px", "aTargets": [1] } - ] + ], + "oLanguage": (datatable_lang != "") ? + { + sUrl: "locale/"+lang+"/"+datatable_lang + } : "" }); dataTable_groups.fnClearTable(); diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js index 76e0a9591d..48c6802dcf 100644 --- a/src/sunstone/public/js/plugins/hosts-tab.js +++ b/src/sunstone/public/js/plugins/hosts-tab.js @@ -19,13 +19,13 @@ var HOST_HISTORY_LENGTH = 40; var host_graphs = [ { - title : "CPU Monitoring information", + title : tr("CPU Monitoring information"), monitor_resources : "cpu_usage,used_cpu,max_cpu", humanize_figures : false, history_length : HOST_HISTORY_LENGTH }, { - title: "Memory monitoring information", + title: tr("Memory monitoring information"), monitor_resources : "mem_usage,used_mem,max_mem", humanize_figures : true, history_length : HOST_HISTORY_LENGTH @@ -40,13 +40,13 @@ var hosts_tab_content =
AllIDNameUsers'+tr("All")+''+tr("ID")+''+tr("Name")+''+tr("Users")+'
\ \ \ - \ - \ - \ - \ - \ - \ - \ + \ + \ + \ + \ + \ + \ + \ \ \ \ @@ -57,27 +57,27 @@ var hosts_tab_content = var create_host_tmpl = '
\
\ - Host parameters\ - \ + ' + tr("Host parameters") + '\ + \
\ -

Drivers

\ +

' + tr("Drivers") + '

\
\
\ - \ + \ \
\
\ - \ + \ \
\
\ @@ -91,18 +91,18 @@ var create_host_tmpl = \
\
\ - \ + \ \
\
\
\
\ -
\ -
\ +
\ +
\
\
\
'; @@ -243,7 +243,7 @@ var host_actions = { type: "single", call: OpenNebula.Host.update, callback: function() { - notifyMessage("Template updated correctly"); + notifyMessage(tr("Template updated correctly")); }, error: onError } @@ -252,51 +252,51 @@ var host_actions = { var host_buttons = { "Host.refresh" : { type: "image", - text: "Refresh list", + text: tr("Refresh list"), img: "images/Refresh-icon.png" }, "Host.create_dialog" : { type: "create_dialog", - text: "+ New" + text: tr("+ New") }, "Host.update_dialog" : { type: "action", - text: "Update a template", + text: tr("Update a template"), alwaysActive: true }, "Host.enable" : { type: "action", - text: "Enable" + text: tr("Enable") }, "Host.disable" : { type: "action", - text: "Disable" + text: tr("Disable") }, "Host.delete" : { type: "action", - text: "Delete host" + text: tr("Delete host") } }; var host_info_panel = { "host_info_tab" : { - title: "Host information", + title: tr("Host information"), content:"" }, "host_template_tab" : { - title: "Host template", + title: tr("Host template"), content: "" }, "host_monitoring_tab": { - title: "Monitoring information", + title: tr("Monitoring information"), content: "" } }; var hosts_tab = { - title: 'Hosts', + title: tr("Hosts"), content: hosts_tab_content, buttons: host_buttons } @@ -430,66 +430,66 @@ function updateHostInfo(request,host){ //Information tab var info_tab = { - title : "Host information", + title : tr("Host information"), content : '
AllIDNameRunning VMsCPU UseMemory useStatus' + tr("All") + '' + tr("id") + '' + tr("Name") + '' + tr("Running VMs") + '' + tr("CPU Use") + '' + tr("Memory use") + '' + tr("Status") + '
\ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ - \ + \ + \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \
Host information - '+host_info.NAME+'
' + tr("Host information") + ' - '+host_info.NAME+'
ID' + tr("id") + ''+host_info.ID+'
State'+OpenNebula.Helper.resource_state("host",host_info.STATE)+'' + tr("State") + ''+tr(OpenNebula.Helper.resource_state("host",host_info.STATE))+'
IM MAD' + tr("IM MAD") + ''+host_info.IM_MAD+'
VM MAD' + tr("VM MAD") + ''+host_info.VM_MAD+'
VN MAD'+ tr("VN MAD") +''+host_info.VN_MAD+'
TM MAD'+ tr("TM MAD") +''+host_info.TM_MAD+'
\ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ @@ -498,16 +498,16 @@ function updateHostInfo(request,host){ //Template tab var template_tab = { - title : "Host template", + title : tr("Host template"), content : '
Host shares
' + tr("Host shares") + '
Max Mem' + tr("Max Mem") + ''+humanize_size(host_info.HOST_SHARE.MAX_MEM)+'
Used Mem (real)' + tr("Used Mem (real)") + ''+humanize_size(host_info.HOST_SHARE.USED_MEM)+'
Used Mem (allocated)' + tr("Used Mem (allocated)") + ''+humanize_size(host_info.HOST_SHARE.MAX_USAGE)+'
Used CPU (real)' + tr("Used CPU (real)") + ''+host_info.HOST_SHARE.USED_CPU+'
Used CPU (allocated)' + tr("Used CPU (allocated)") + ''+host_info.HOST_SHARE.CPU_USAGE+'
Running VMs' + tr("Running VMs") + ''+host_info.HOST_SHARE.RUNNING_VMS+'
\ - '+ + '+ prettyPrintJSON(host_info.TEMPLATE)+ '
Host template
' + tr("Host template") + '
' } var monitor_tab = { - title: "Monitoring information", + title: tr("Monitoring information"), content : generateMonitoringDivs(host_graphs,"host_monitor_") } @@ -527,7 +527,7 @@ function updateHostInfo(request,host){ //Prepares the host creation dialog function setupCreateHostDialog(){ - dialogs_context.append('
'); + dialogs_context.append('
'); $create_host_dialog = $('div#create_host_dialog'); var dialog = $create_host_dialog; @@ -543,7 +543,7 @@ function setupCreateHostDialog(){ //Handle the form submission $('#create_host_form',dialog).submit(function(){ if (!($('#name',this).val().length)){ - notifyError("Host name missing!"); + notifyError(tr("Host name missing!")); return false; } var host_json = { @@ -574,7 +574,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"); } @@ -611,7 +611,11 @@ $(document).ready(function(){ { "sWidth": "35px", "aTargets": [1] }, { "sWidth": "100px", "aTargets": [6] }, { "sWidth": "200px", "aTargets": [4,5] } - ] + ], + "oLanguage": (datatable_lang != "") ? + { + sUrl: "locale/"+lang+"/"+datatable_lang + } : "" }); //preload it diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index ce879dee85..4a1583ce3a 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 = '
\ -
  • Wizard
  • \ -
  • Advanced mode
  • \ + \
    \
    \ -

    Fields marked with are mandatory
    \ +

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

    \
    \ - \ + \ \ -
    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.")+'
    \
    \
    \ - \ + \ \ -
    Human readable description of the image for other users.
    \ +
    '+tr("Human readable description of the image for other users.")+'
    \
    \
    \
    \
    \ - \ + \ \ -
    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).")+'
    \
    \
    \ - \ + \ \ -
    Public scope of the image
    \ +
    '+tr("Public scope of the image")+'
    \
    \
    \ - \ + \ \ -
    Persistence of the image
    \ +
    '+tr("Persistence of the image")+'
    \
    \
    \ - \ + \ \ -
    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”).")+'
    \
    \
    \ - \ + \ \ -
    Type of disk device to emulate.
    \ +
    '+tr("Type of disk device to emulate.")+'
    \
    \
    \ - \ + \ \ -
    Specific image mapping driver. KVM: raw, qcow2 and Xen:tap:aio:, file:
    \ +
    '+tr("Specific image mapping driver. KVM: raw, qcow2. XEN: tap:aio, file:")+'
    \
    \
    \
    \
    \ - \ + \ \ -
    \ +
    \ \ -
    \ +
    \ \ - \ -
    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.")+'

    \
    \
    \ - \ + \ \ -
    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.")+'
    \
    \
    \ - \ + \ \ -
    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.")+'
    \
    \
    \ - \ + \ \ -
    Size of the datablock in MB.
    \ +
    '+tr("Size of the datablock in MB.")+'
    \
    \
    \ - \ + \ \ -
    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 =
    \
    \
    \ -

    Write the image template here

    \ +

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

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

    Please, choose and modify the image you want to update:

    \ +

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

    \
    \ - \ + \ \
    \
    \ - \ + \ \
    \
    \ - \ + \ \
    \ - \ + \
    \ \
    \
    \
    \ - \
    \
    \ @@ -277,7 +278,7 @@ var image_actions = { type: "single", call: OpenNebula.Image.update, callback: function() { - notifyMessage("Template updated correctly"); + notifyMessage(tr("Template updated correctly")); }, error: onError }, @@ -396,30 +397,30 @@ var image_actions = { var image_buttons = { "Image.refresh" : { type: "image", - text: "Refresh list", + text: tr("Refresh list"), img: "images/Refresh-icon.png" }, "Image.create_dialog" : { type: "create_dialog", - text: "+ New" + text: tr('+ New') }, "Image.update_dialog" : { type: "action", - text: "Update a template", + text: tr("Update a template"), alwaysActive: true }, "Image.chown" : { type: "confirm_with_select", - text: "Change owner", + text: tr("Change owner"), select: users_sel, - tip: "Select the new owner:", + tip: tr("Select the new owner")+":", condition: mustBeAdmin }, "Image.chgrp" : { type: "confirm_with_select", - text: "Change group", + text: tr("Change group"), select: groups_sel, - tip: "Select the new group:", + tip: tr("Select the new group")+":", condition: mustBeAdmin }, "action_list" : { @@ -427,51 +428,51 @@ var image_buttons = { actions: { "Image.enable" : { type: "action", - text: "Enable" + text: tr("Enable") }, "Image.disable" : { type: "action", - text: "Disable" + text: tr("Disable") }, "Image.publish" : { type: "action", - text: "Publish" + text: tr("Publish") }, "Image.unpublish" : { type: "action", - text: "Unpublish" + text: tr("Unpublish") }, "Image.persistent" : { type: "action", - text: "Make persistent" + text: tr("Make persistent") }, "Image.nonpersistent" : { type: "action", - text: "Make non persistent" + text: tr("Make non persistent") } } }, "Image.delete" : { type: "action", - text: "Delete" + text: tr("Delete") } } var image_info_panel = { "image_info_tab" : { - title: "Image information", + title: tr("Image information"), content: "" }, "image_template_tab" : { - title: "Image template", + title: tr("Image template"), content: "" } } var images_tab = { - title: "Images", + title: tr("Images"), content: images_tab_content, buttons: image_buttons } @@ -492,13 +493,13 @@ function imageElementArray(image_json){ var image = image_json.IMAGE; var type = $(''); var value = OpenNebula.Helper.image_type(image.TYPE); - $('option[value="'+value+'"]',type).replaceWith(''); + $('option[value="'+value+'"]',type).replaceWith(''); @@ -570,75 +571,76 @@ function updateImagesView(request, images_list){ function updateImageInfo(request,img){ var img_info = img.IMAGE; var info_tab = { - title: "Image information", + title: tr("Image information"), content: '
AllIDOwnerGroupNameSizeTypeRegistration timePublicPersistentStatus#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")+'
\ \ - \ + \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ - \ + \ + \ \ \ - \ - \ + \ + \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \
Image "'+img_info.NAME+'" information
'+tr("Image")+' "'+img_info.NAME+'" '+ + tr("information")+'
ID'+tr("ID")+''+img_info.ID+'
Name'+tr("Name")+''+img_info.NAME+'
Owner'+tr("Owner")+''+img_info.UNAME+'
Group'+tr("Group")+''+img_info.GNAME+'
Type'+tr("Type")+''+OpenNebula.Helper.image_type(img_info.TYPE)+'
Register time'+tr("Register time")+''+pretty_time(img_info.REGTIME)+'
Public'+(parseInt(img_info.PUBLIC) ? "yes" : "no")+''+tr("Public")+''+(parseInt(img_info.PUBLIC) ? tr("yes") : tr("no"))+'
Persistent'+(parseInt(img_info.PERSISTENT) ? "yes" : "no")+''+tr("Persistent")+''+(parseInt(img_info.PERSISTENT) ? tr("yes") : tr("no"))+'
Source'+tr("Source")+''+(typeof img_info.SOURCE === "string" ? img_info.SOURCE : "--")+'
Path'+tr("Path")+''+(typeof img_info.PATH === "string" ? img_info.PATH : "--")+'
Filesystem type'+tr("Filesystem type")+''+(typeof img_info.FSTYPE === "string" ? img_info.FSTYPE : "--")+'
Size (Mb)'+tr("Size (Mb)")+''+img_info.SIZE+'
State'+tr("State")+''+OpenNebula.Helper.resource_state("image",img_info.STATE)+'
Running #VMS'+tr("Running #VMS")+''+img_info.RUNNING_VMS+'
' } var template_tab = { - title: "Image template", + title: tr("Image template"), content: '\ - '+ + '+ prettyPrintJSON(img_info.TEMPLATE)+ '
Image template
'+tr("Image template")+'
' } @@ -652,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); @@ -669,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(); @@ -680,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'); }); @@ -732,7 +734,7 @@ function setupCreateImageDialog(){ var name = $('#custom_var_image_name',$create_image_dialog).val(); var value = $('#custom_var_image_value',$create_image_dialog).val(); if (!name.length || !value.length) { - notifyError("Custom attribute name and value must be filled in"); + notifyError(tr("Custom attribute name and value must be filled in")); return false; } option= '' : ""; + var new_select= sel_elems.length > 1? '' : ""; $('option','').each(function(){ var val = $(this).val(); if ($.inArray(val,sel_elems) >= 0){ @@ -942,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"); } @@ -958,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"); } @@ -967,23 +970,23 @@ 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 { - notifyError("Image cannot be public and persistent"); + notifyError(tr("Image cannot be public and persistent")); return false; }; } else Sunstone.runAction("Image.unpublish",id); @@ -993,12 +996,12 @@ 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 { - notifyError("Image cannot be public and persistent"); + notifyError(tr("Image cannot be public and persistent")); return false; }; } else Sunstone.runAction("Image.nonpersistent",id); @@ -1009,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); }); @@ -1030,7 +1033,11 @@ $(document).ready(function(){ { "sWidth": "35px", "aTargets": [1,5,11] }, { "sWidth": "100px", "aTargets": [6] }, { "sWidth": "150px", "aTargets": [7] } - ] + ], + "oLanguage": (datatable_lang != "") ? + { + sUrl: "locale/"+lang+"/"+datatable_lang + } : "" }); dataTable_images.fnClearTable(); @@ -1048,4 +1055,6 @@ $(document).ready(function(){ initCheckAllBoxes(dataTable_images); tableCheckboxesListener(dataTable_images); imageInfoListener(); + + }) diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 18c185f64a..f1d8f97d9c 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -23,13 +23,13 @@ var templates_tab_content = \ \ \ - \ - \ - \ - \ - \ - \ - \ + \ + \ + \ + \ + \ + \ + \ \ \ \ @@ -39,10 +39,10 @@ var templates_tab_content = var create_template_tmpl = '
\ \
\ \ @@ -54,35 +54,37 @@ var create_template_tmpl = '
\ XEN\
\ -->\ -

Fields marked with are mandatory
\ - Fold / Unfold all sections

\ +

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

\
\ \ \
\
\ -

Capacity options

\ +

'+tr("Capacity options")+'

\
\ -
Capacity\ +
'+tr("Capacity")+'\
\ - \ + \ \ -
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>.
\ +
'+tr("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>.")+'
\
\
\ - \ + \ \ -
Amount of RAM required for the VM, in Megabytes.
\ +
'+tr("Amount of RAM required for the VM, in Megabytes.")+'
\
\
\ - \ + \ \ -
Percentage of CPU divided by 100 required for the Virtual Machine. Half a processor is written 0.5.
\ +
'+tr("Percentage of CPU divided by 100 required for the Virtual Machine. Half a processor is written 0.5.")+'
\
\
\ - \ + \ \ -
Number of virtual cpus. This value is optional, the default hypervisor behavior is used, usually one virtual CPU.
\ +
'+tr("Number of virtual cpus. This value is optional, the default hypervisor behavior is used, usually one virtual CPU.")+'
\
\
\
\ @@ -91,58 +93,58 @@ var create_template_tmpl = '
\ -->\
\
\ -

Boot/OS options

\ +

'+tr("Boot/OS options")+'

\
\ -
OS and Boot options\ +
'+tr("OS and Boot options")+'\
\ - \ + \ \ -
CPU architecture to virtualization
\ +
'+tr("CPU architecture to virtualization")+'
\
\ \
\ - \ + \ \ -
Select boot method
\ +
'+tr("Select boot method")+'
\
\
\ - \ + \ \ -
Path to the OS kernel to boot the image
\ +
'+tr("Path to the OS kernel to boot the image")+'
\
\
\ - \ + \ \ -
Path to the initrd image
\ +
'+tr("Path to the initrd image")+'
\
\
\ - \ + \ \ -
Device to be mounted as root
\ +
'+tr("Device to be mounted as root")+'
\
\
\ - \ + \ \ -
Arguments for the booting kernel
\ +
'+tr("Arguments for the booting kernel")+'
\
\
\ - \ + \ \ -
Path to the bootloader executable
\ +
'+tr("Path to the bootloader executable")+'
\
\
\ - \ + \ \ -
Boot device type
\ +
'+tr("Boot device type")+'
\
\
\
\ @@ -151,26 +153,26 @@ var create_template_tmpl = '
\ \
\
\ -

Features

\ +

'+tr("Features")+'

\
\ -
Features\ +
'+tr("Features")+'\
\ - \ + \ \ -
Physical address extension mode allows 32-bit guests to address more than 4 GB of memory
\ +
'+tr("Physical address extension mode allows 32-bit guests to address more than 4 GB of memory")+'
\
\
\ - \ + \ \ -
Useful for power management, for example, normally required for graceful shutdown to work
\ +
'+tr("Useful for power management, for example, normally required for graceful shutdown to work")+'
\
\
\
\ @@ -182,92 +184,92 @@ var create_template_tmpl = '
\ readonly SEVERAL DISKS-->\
\
\ -

Add disks/images

\ -
\ -
Disks\ +

'+tr("Add disks/images")+'

\ +
\ +
'+tr("Disks")+'\
\ - \ - Disk\ + \ + '+tr("Disk")+'\ \ - Image\ + '+tr("Image")+'\ \
\
\
\ - \ + \ \ -
Name of the image to use
\ +
'+tr("Name of the image to use")+'
\ \
\
\ - \ + \ \ -
Type of disk device to emulate: ide, scsi
\ +
'+tr("Type of disk device to emulate: ide, scsi")+'
\
\
\ - \ + \ \ -
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")+'
\
\
\ - \ + \ \ -
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")+'
\
\
\ - \ + \ \ -
Disk type
\ +
'+tr("Disk type")+'
\
\
\ - \ + \ \ -
Disk file location path or URL
\ +
'+tr("Disk file location path or URL")+'
\
\
\ \ - \ + \ \ -
Size in MB
\ +
'+tr("Size in MB")+'
\
\
\ \ - \ + \ \ -
Filesystem type for the fs images
\ +
'+tr("Filesystem type for the fs images")+'
\
\
\ - \ + \ \ -
Clone this image
\ +
'+tr("Clone this image")+'
\
\
\ - \ + \ \ -
Save this image after shutting down the VM
\ +
'+tr("Save this image after shutting down the VM")+'
\
\
\ - \ + \ \ -
Mount image as read-only
\ +
'+tr("Mount image as read-only")+'
\
\
\ - \ - \ + \ + \
\ - \ + \ \
\ @@ -279,107 +281,107 @@ var create_template_tmpl = '
\ bridge, target, script, model -->\
\
\ -

Setup Networks

\ +

'+tr("Setup Networks")+'

\
\ -
Network\ +
'+tr("Network")+'\
\ - \ - Predefined\ + \ + '+tr("Predefined")+'\ \ - Manual\ + '+tr("Manual")+'\ \ \
\
\
\ - \ + \ \ -
Name of the network to attach this device
\ +
'+tr("Name of the network to attach this device")+'
\ \
\
\ - \ + \ \ -
Request an specific IP from the Network
\ +
'+tr("Request an specific IP from the Network")+'
\
\
\ - \ + \ \ -
HW address associated with the network interface
\ +
'+tr("HW address associated with the network interface")+'
\
\
\ - \ + \ \ -
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")+'
\
\
\ - \ + \ \ -
Name for the tun device created for the VM
\ +
'+tr("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
\ +
'+tr("Name of a shell script to be executed after creating the tun device for the VM")+'
\
\
\ - \ + \ \ -
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.")+'
\
\
\ - \ + \ \
\
\
\ - \ + \ \ -
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")+'
\
\
\ - \ + \ \ -
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")+'
\
\
\ - \ + \ \
\
\
\ - \ + \ \ -
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")+'
\
\
\ - \ + \ \ -
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")+'
\
\
\ - \ + \ \ -
ICMP policy
\ +
'+tr("ICMP policy")+'
\
\
\
\ - \ - \ + \ + \
\ - \ + \ \
\ @@ -390,31 +392,31 @@ var create_template_tmpl = '
\ \
\
\ -

Add inputs

\ +

'+tr("Add inputs")+'

\
\ -
Inputs\ +
'+tr("Inputs")+'\
\ - \ + \ \
\
\
\ - \ + \ \
\
\
\ - \ - \ + \ + \
\ - \ + \ \
\ @@ -425,37 +427,37 @@ var create_template_tmpl = '
\ \
\
\ -

Add Graphics

\ +

'+tr("Add Graphics")+'

\
\ -
Graphics\ +
'+tr("Graphics")+'\
\ - \ + \ \
\
\
\ - \ + \ \ -
IP to listen on
\ +
'+tr("IP to listen on")+'
\
\
\ - \ + \ \ -
Port for the VNC server
\ +
'+tr("Port for the VNC server")+'
\
\
\ - \ + \ \ -
Password for the VNC server
\ +
'+tr("Password for the VNC server")+'
\
\
\ - \ + \ \ -
Keyboard configuration locale to use in the VNC display
\ +
'+tr("Keyboard configuration locale to use in the VNC display")+'
\
\
\
\ @@ -464,24 +466,24 @@ var create_template_tmpl = '
\ \
\
\ -

Add context variables

\ +

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

\
\ -
Context\ +
'+tr("Context")+'\
\ - \ + \ \ -
Name for the context variable
\ +
'+tr("Name for the context variable")+'
\
\
\ - \ + \ \ -
Value of the context variable
\ +
'+tr("Value of the context variable")+'
\
\
\ - \ - \ + \ + \
\ - \ + \ \
\ @@ -492,18 +494,18 @@ var create_template_tmpl = '
\ \
\
\ -

Add placement options

\ +

'+tr("Add placement options")+'

\
\ -
Placement\ +
'+tr("Placement")+'\
\ - \ + \ \ -
Boolean expression that rules out provisioning hosts from list of machines suitable to run this VM
\ +
'+tr("Boolean expression that rules out provisioning hosts from list of machines suitable to run this VM")+'
\
\
\ - \ + \ \ -
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
\ +
'+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")+'
\
\
\
\ @@ -512,15 +514,15 @@ var create_template_tmpl = '
\ \
\
\ -

Add Hypervisor raw options

\ +

'+tr("Add Hypervisor raw options")+'

\
\ -
Raw\ +
'+tr("Raw")+'\ \
\ - \ + \ \ \ -
Raw data to be passed directly to the hypervisor
\ +
'+tr("Raw data to be passed directly to the hypervisor")+'
\
\
\
\ @@ -529,24 +531,24 @@ var create_template_tmpl = '
\ \
\
\ -

Add custom variables

\ +

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

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

Write the Virtual Machine template here

\ +

'+tr("Write the Virtual Machine template here")+'

\
\ \
\ @@ -573,9 +575,9 @@ var create_template_tmpl = '
\
\
\ \ - \ + \
\
\ \ @@ -584,16 +586,16 @@ var create_template_tmpl = '
\ var update_template_tmpl = '
\ -

Please, choose and modify the template you want to update:

\ +

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

\
\ - \ + \ \
\
\ - \ + \ \
\ - \ + \
\ \
\ @@ -606,7 +608,6 @@ var update_template_tmpl =
\ '; -var templates_select = ""; var dataTable_templates; var $create_template_dialog; @@ -672,7 +673,7 @@ var template_actions = { type: "single", call: OpenNebula.Template.update, callback: function() { - notifyMessage("Template updated correctly"); + notifyMessage(tr("Template updated correctly")); }, error: onError }, @@ -751,34 +752,34 @@ var template_actions = { var template_buttons = { "Template.refresh" : { type: "image", - text: "Refresh list", + text: tr("Refresh list"), img: "images/Refresh-icon.png" }, "Template.create_dialog" : { type: "create_dialog", - text: "+ New" + text: tr("+ New") }, "Template.update_dialog" : { type: "action", - text: "Update a template", + text: tr("Update a template"), alwaysActive: true }, "Template.instantiate_vms" : { type: "action", - text: "Instantiate" + text: tr("Instantiate") }, "Template.chown" : { type: "confirm_with_select", - text: "Change owner", + text: tr("Change owner"), select: users_sel, - tip: "Select the new owner:", + tip: tr("Select the new owner")+":", condition: mustBeAdmin }, "Template.chgrp" : { type: "confirm_with_select", - text: "Change group", + text: tr("Change group"), select: groups_sel, - tip: "Select the new group:", + tip: tr("Select the new group")+":", condition: mustBeAdmin }, "action_list" : { @@ -786,29 +787,29 @@ var template_buttons = { actions: { "Template.publish" : { type: "action", - text: "Publish" + text: tr("Publish") }, "Template.unpublish" : { type: "action", - text: "Unpublish" + text: tr("Unpublish") }, } }, "Template.delete" : { type: "action", - text: "Delete" + text: tr("Delete") } } var template_info_panel = { "template_info_tab" : { - title: "Template information", + title: tr("Template information"), content: "" } } var templates_tab = { - title: "Templates", + title: tr("Templates"), content: templates_tab_content, buttons: template_buttons } @@ -857,12 +858,12 @@ function templateInfoListener(){ //Updates the select input field with an option for each template function updateTemplateSelect(){ - templates_select = + var templates_select = makeSelectOptions(dataTable_templates, 1,//id_col 4,//name_col - [7],//enabled_col - ["no"]//bad status col + [],//status_cols + []//bad status values ); //update static selectors: @@ -908,42 +909,43 @@ function updateTemplatesView(request, templates_list){ function updateTemplateInfo(request,template){ var template_info = template.VMTEMPLATE; var info_tab = { - title: "Information", + title: tr("Information"), content: '
AllIDOwnerGroupNameRegistration timePublic'+tr("All")+''+tr("ID")+''+tr("Owner")+''+tr("Group")+''+tr("Name")+''+tr("Registration time")+''+tr("Public")+'
\ \ - \ + \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ - \ + \ + \ \
Template "'+template_info.NAME+'" information
'+tr("Template")+' \"'+template_info.NAME+'\" '+ + tr("information")+'
ID'+tr("ID")+''+template_info.ID+'
Name'+tr("Name")+''+template_info.NAME+'
Owner'+tr("Owner")+''+template_info.UNAME+'
Group'+tr("Group")+''+template_info.GNAME+'
Register time'+tr("Register time")+''+pretty_time(template_info.REGTIME)+'
Public'+(parseInt(template_info.PUBLIC) ? "yes" : "no")+''+tr("Public")+''+(parseInt(template_info.PUBLIC) ? tr("yes") : tr("no"))+'
' }; var template_tab = { - title: "Template", + title: tr("Template"), content: '\ - '+ + '+ prettyPrintJSON(template_info.TEMPLATE)+ '
Template
'+tr("Template")+'
' }; @@ -967,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"); @@ -981,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(); @@ -1031,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: @@ -1043,30 +1045,30 @@ function setupCreateTemplateDialog(){ // * Show the inputs and graphics section var type_opts = - '\ - \ - \ - \ - \ - \ - '; + '\ + \ + \ + \ + \ + \ + '; $('select#TYPE',section_disks).html(type_opts); var boot_opts = - '\ - \ - \ - '; + '\ + \ + \ + '; $('select#BOOT',section_os_boot).html(boot_opts); $('select#BOOT',section_os_boot).parent().show(); - $('select#boot_method option#no_boot',section_os_boot).html("Driver default"); + $('select#boot_method option#no_boot',section_os_boot).html(tr("Driver default")); var bus_opts = - '\ - \ - '; + '\ + \ + '; $('select#BUS',section_disks).html(bus_opts); @@ -1080,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: @@ -1091,20 +1093,20 @@ function setupCreateTemplateDialog(){ // * Show the graphics section var type_opts = - '\ - \ - \ - \ - \ - '; + '\ + \ + \ + \ + \ + '; $('select#TYPE',section_disks).html(type_opts); - $('select#boot_method option#no_boot',section_os_boot).html("Please choose"); + $('select#boot_method option#no_boot',section_os_boot).html(tr("Please choose")); var bus_opts = - '\ - '; + '\ + '; $('select#BUS',section_disks).html(bus_opts); @@ -1116,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 @@ -1126,17 +1128,17 @@ function setupCreateTemplateDialog(){ // * Set the raw type to vmware var type_opts = - '\ - \ - '; + '\ + \ + '; $('select#TYPE',section_disks).html(type_opts); $('div#kernel_bootloader',section_os_boot).hide(); var bus_opts = - '\ - '; + '\ + '; $('select#BUS',section_disks).html(bus_opts); $('input#TYPE', section_raw).val("vmware"); @@ -1154,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; @@ -1175,7 +1177,7 @@ function setupCreateTemplateDialog(){ //are fields passing the filter? var result = filter(); if (!result) { - notifyError("There are mandatory parameters missing in this section"); + notifyError(tr("There are mandatory parameters missing in this section")); return false; } @@ -1185,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'); @@ -1219,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(); }; @@ -1334,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(""); }; }); @@ -1390,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); }); @@ -1422,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); @@ -1432,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); @@ -1452,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); @@ -1474,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": @@ -1487,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); @@ -1495,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); }); @@ -1545,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); @@ -1570,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(); }; }); @@ -1592,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(); }; }); @@ -1672,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(); @@ -1708,7 +1710,7 @@ function setupCreateTemplateDialog(){ var name = $('#var_name',section_context).val(); var value = $('#var_value',section_context).val(); if (!name.length || !value.length) { - notifyError("Context variable name and value must be filled in"); + notifyError(tr("Context variable name and value must be filled in")); return false; } option= '