mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
Feature #1004: Add internationalization support for Sunstone
This commit enables internationalization support for the Sunstone interface. Language is chosen according to the variable LANG in user's template. This variable is automaticly set when users chooses a new language from the select field on top, so that it is preserved on future logins. If no LANG is set, language is chosen according to the :lang: variable of the configuration. Otherwise it defaults to English. Special thanks to ZAO VIVOSS i OI for contributing the initial patch for OpenNebula Sunstone 3.0 and the first translation: russian. The contents from this patch have been partially applied with the necessary corrections and improvements to the master branch, which was ahead on many aspects to the 3.0 release.
This commit is contained in:
parent
b79dd4ab65
commit
4036e5d1ea
19
install.sh
19
install.sh
@ -247,6 +247,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 \
|
||||
@ -417,6 +420,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=(
|
||||
@ -1001,7 +1006,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 \
|
||||
@ -1082,6 +1088,14 @@ 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_RU="
|
||||
src/sunstone/public/locale/ru/ru.js \
|
||||
src/sunstone/public/locale/ru/ru_datatable.txt"
|
||||
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Ozones files
|
||||
#-----------------------------------------------------------------------------
|
||||
@ -1141,7 +1155,8 @@ 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 \
|
||||
|
@ -20,3 +20,6 @@
|
||||
# VNC Configuration
|
||||
:vnc_proxy_base_port: 29876
|
||||
:novnc_path:
|
||||
|
||||
# Default language setting
|
||||
:lang: en_US
|
@ -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)
|
||||
|
@ -169,3 +169,15 @@ background-image: -moz-linear-gradient(
|
||||
#navigation li:hover a, .navigation-active-li-a {
|
||||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
#language {
|
||||
float:right;
|
||||
margin-top:2px;
|
||||
margin-right:25px;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
#language select {
|
||||
width: 100px;
|
||||
height: 22px;
|
||||
}
|
||||
|
48
src/sunstone/public/js/locale.js
Normal file
48
src/sunstone/public/js/locale.js
Normal file
@ -0,0 +1,48 @@
|
||||
var lang=""
|
||||
var locale = {};
|
||||
var datatable_lang = "";
|
||||
|
||||
function tr(str){
|
||||
var tmp = locale[str];
|
||||
if ( tmp == null || tmp == "" ) {
|
||||
//console.debug("trans: "+str);
|
||||
tmp = str;
|
||||
}
|
||||
return tmp;
|
||||
};
|
||||
|
||||
function setLang(lang_str){
|
||||
$('<div title="Changing language">Loading new language... please wait '+spinner+'</div>').dialog({
|
||||
draggable:false,
|
||||
modal:true,
|
||||
resizable:false,
|
||||
buttons:{},
|
||||
width: 460,
|
||||
minHeight: 50
|
||||
|
||||
});
|
||||
|
||||
var template = "LANG="+lang_str;
|
||||
var obj = {
|
||||
data: {
|
||||
id: uid,
|
||||
extra_param: template
|
||||
},
|
||||
error: onError
|
||||
};
|
||||
OpenNebula.User.update(obj);
|
||||
$.post('config',JSON.stringify({lang:lang_str}),refreshLang);
|
||||
};
|
||||
|
||||
function refreshLang(){
|
||||
window.location.href = ".";
|
||||
};
|
||||
|
||||
$(document).ready(function(){
|
||||
if (lang)
|
||||
$('#lang_sel option[value="'+lang+'"]').attr("selected","selected");
|
||||
$('#lang_sel').change(function(){
|
||||
setLang($(this).val());
|
||||
});
|
||||
|
||||
});
|
@ -25,12 +25,12 @@ var acls_tab_content =
|
||||
<table id="datatable_acls" class="display">\
|
||||
<thead>\
|
||||
<tr>\
|
||||
<th class="check"><input type="checkbox" class="check_all" value="">All</input></th>\
|
||||
<th>ID</th>\
|
||||
<th>Applies to</th>\
|
||||
<th>Affected resources</th>\
|
||||
<th>Resource ID / Owned by</th>\
|
||||
<th>Allowed operations</th>\
|
||||
<th class="check"><input type="checkbox" class="check_all" value="">'+tr("All")+'</input></th>\
|
||||
<th>'+tr("ID")+'</th>\
|
||||
<th>'+tr("Applies to")+'</th>\
|
||||
<th>'+tr("Affected resources")+'</th>\
|
||||
<th>'+tr("Resource ID / Owned by")+'</th>\
|
||||
<th>'+tr("Allowed operations")+'</th>\
|
||||
</tr>\
|
||||
</thead>\
|
||||
<tbody id="tbodyaclss">\
|
||||
@ -42,48 +42,48 @@ var create_acl_tmpl =
|
||||
'<form id="create_acl_form" action="">\
|
||||
<fieldset>\
|
||||
<div>\
|
||||
<label for="applies">This rule applies to:</label>\
|
||||
<label for="applies">'+tr("This rule applies to:")+'</label>\
|
||||
<select name="applies" id="applies"></select>\
|
||||
<div class="clear"></div>\
|
||||
<label style="height:9em">Affected resources:</label>\
|
||||
<input type="checkbox" name="res_host" class="resource_cb" value="HOST">Hosts</input><br />\
|
||||
<input type="checkbox" name="res_vm" class="resource_cb" value="VM">Virtual Machines</input><br />\
|
||||
<input type="checkbox" name="res_net" class="resource_cb" value="NET">Virtual Networks</input><br />\
|
||||
<input type="checkbox" name="res_image" class="resource_cb" value="IMAGE">Images</input><br />\
|
||||
<input type="checkbox" name="res_template" class="resource_cb" value="TEMPLATE">Templates</input><br />\
|
||||
<input type="checkbox" name="res_user" class="resource_cb" value="USER">Users</input><br />\
|
||||
<input type="checkbox" name="res_group" class="resource_cb" value="GROUP">Groups</input><br />\
|
||||
<label style="height:9em">'+tr("Affected resources")+':</label>\
|
||||
<input type="checkbox" name="res_host" class="resource_cb" value="HOST">'+tr("Hosts")+'</input><br />\
|
||||
<input type="checkbox" name="res_vm" class="resource_cb" value="VM">'+tr("Virtual Machines")+'</input><br />\
|
||||
<input type="checkbox" name="res_net" class="resource_cb" value="NET">'+tr("Virtual Networks")+'</input><br />\
|
||||
<input type="checkbox" name="res_image" class="resource_cb" value="IMAGE">'+tr("Images")+'</input><br />\
|
||||
<input type="checkbox" name="res_template" class="resource_cb" value="TEMPLATE">'+tr("Templates")+'</input><br />\
|
||||
<input type="checkbox" name="res_user" class="resource_cb" value="USER">'+tr("Users")+'</input><br />\
|
||||
<input type="checkbox" name="res_group" class="resource_cb" value="GROUP">'+tr("Groups")+'</input><br />\
|
||||
<div class="clear"></div>\
|
||||
<label for="mode_select" style="height:3em;">Resource subset:</label>\
|
||||
<input type="radio" class="res_subgroup" name="mode_select" value="*" id="res_subgroup_all">All</input><br />\
|
||||
<input type="radio" class="res_subgroup" name="mode_select" value="res_id" id="res_subgroup_id">Specific ID</input><br />\
|
||||
<input type="radio" class="res_subgroup" name="mode_select" value="belonging_to" id="res_subgroup_group">Owned by group</input><br />\
|
||||
<label for="mode_select" style="height:3em;">'+tr("Resource subset:")+'</label>\
|
||||
<input type="radio" class="res_subgroup" name="mode_select" value="*" id="res_subgroup_all">'+tr("All")+'</input><br />\
|
||||
<input type="radio" class="res_subgroup" name="mode_select" value="res_id" id="res_subgroup_id">'+tr("Specific ID")+'</input><br />\
|
||||
<input type="radio" class="res_subgroup" name="mode_select" value="belonging_to" id="res_subgroup_group">'+tr("Owned by group")+'</input><br />\
|
||||
<div class="clear"></div>\
|
||||
<label for="res_id">Resource ID:</label>\
|
||||
<label for="res_id">'+tr("Resource ID:")+'</label>\
|
||||
<input type="text" name="res_id" id="res_id"></input>\
|
||||
<div class="clear"></div>\
|
||||
<label for="belonging_to">Group:</label>\
|
||||
<label for="belonging_to">'+tr("Group")+':</label>\
|
||||
<select name="belonging_to" id="belonging_to"></select>\
|
||||
<div class="clear"></div>\
|
||||
<label style="height:12em;">Allowed operations:</label>\
|
||||
<input type="checkbox" name="right_create" class="right_cb" value="CREATE">Create</input><br />\
|
||||
<input type="checkbox" name="right_delete" class="right_cb" value="DELETE">Delete</input><br />\
|
||||
<input type="checkbox" name="right_use" class="right_cb" value="USE">Use</input><br />\
|
||||
<input type="checkbox" name="right_manage" class="right_cb" value="MANAGE">Manage</input><br />\
|
||||
<input type="checkbox" name="right_info" class="right_cb" value="INFO">Get Information</input><br />\
|
||||
<input type="checkbox" name="right_info_pool" class="right_cb" value="INFO_POOL">Get Pool of resources</input><br />\
|
||||
<input type="checkbox" name="right_info_pool_mine" class="right_cb" value="INFO_POOL_MINE">Get Pool of my/group\'s resources</input><br />\
|
||||
<input type="checkbox" name="right_chown" class="right_cb" value="CHOWN">Change owner</input><br />\
|
||||
<input type="checkbox" name="right_deploy" class="right_cb" value="DEPLOY">Deploy</input><br />\
|
||||
<label style="height:12em;">'+tr("Allowed operations")+':</label>\
|
||||
<input type="checkbox" name="right_create" class="right_cb" value="CREATE">'+tr("Create")+'</input><br />\
|
||||
<input type="checkbox" name="right_delete" class="right_cb" value="DELETE">'+tr("Delete")+'</input><br />\
|
||||
<input type="checkbox" name="right_use" class="right_cb" value="USE">'+tr("Use")+'</input><br />\
|
||||
<input type="checkbox" name="right_manage" class="right_cb" value="MANAGE">'+tr("Manage")+'</input><br />\
|
||||
<input type="checkbox" name="right_info" class="right_cb" value="INFO">'+tr("Get Information")+'</input><br />\
|
||||
<input type="checkbox" name="right_info_pool" class="right_cb" value="INFO_POOL">'+tr("Get Pool of resources")+'</input><br />\
|
||||
<input type="checkbox" name="right_info_pool_mine" class="right_cb" value="INFO_POOL_MINE">'+tr("Get Pool of my/group\'s resources")+'</input><br />\
|
||||
<input type="checkbox" name="right_chown" class="right_cb" value="CHOWN">'+tr("Change owner")+'</input><br />\
|
||||
<input type="checkbox" name="right_deploy" class="right_cb" value="DEPLOY">'+tr("Deploy")+'</input><br />\
|
||||
<div class="clear"></div>\
|
||||
<label for="acl_preview">ACL String preview:</label>\
|
||||
<label for="acl_preview">'+tr("ACL String preview:")+'</label>\
|
||||
<input type="text" name="acl_preview" id="acl_preview" style="width:400px;"></input>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button" id="create_acl_submit" value="Acl.create">Create</button>\
|
||||
<button class="button" type="reset" value="reset">Reset</button>\
|
||||
<button class="button" id="create_acl_submit" value="Acl.create">'+tr("Create")+'</button>\
|
||||
<button class="button" type="reset" value="reset">'+tr("Reset")+'</button>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
</form>';
|
||||
@ -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<resources_array.length;i++){
|
||||
switch (resources_array[i]){
|
||||
case "HOST":
|
||||
resources_str+="Hosts, ";
|
||||
resources_str+=tr("Hosts")+", ";
|
||||
break;
|
||||
case "VM":
|
||||
resources_str+="Virtual Machines, ";
|
||||
resources_str+=tr("Virtual Machines")+", ";
|
||||
break;
|
||||
case "NET":
|
||||
resources_str+="Virtual Networks, ";
|
||||
resources_str+=tr("Virtual Networks")+", ";
|
||||
break;
|
||||
case "IMAGE":
|
||||
resources_str+="Images, ";
|
||||
resources_str+=(tr("Images")+", ");
|
||||
break;
|
||||
case "TEMPLATE":
|
||||
resources_str+="VM Templates, ";
|
||||
resources_str+=tr("VM Templates")+", ";
|
||||
break;
|
||||
case "USER":
|
||||
resources_str+="Users, ";
|
||||
resources_str+=tr("Users")+", ";
|
||||
break;
|
||||
case "GROUP":
|
||||
resources_str+="Groups, ";
|
||||
resources_str+=tr("Groups")+", ";
|
||||
break;
|
||||
};
|
||||
};
|
||||
@ -303,7 +303,7 @@ function updateAclsView(request,list){
|
||||
}
|
||||
|
||||
function setupCreateAclDialog(){
|
||||
dialogs_context.append('<div title="Create ACL" id="create_acl_dialog"></div>');
|
||||
dialogs_context.append('<div title=\"'+tr("Create ACL")+'\" id="create_acl_dialog"></div>');
|
||||
$create_acl_dialog = $('#create_acl_dialog',dialogs_context);
|
||||
var dialog = $create_acl_dialog;
|
||||
dialog.html(create_acl_tmpl);
|
||||
@ -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 = $('<select>'+users_select+'</select>');
|
||||
$('.empty_value',users).remove();
|
||||
$('option',users).addClass("user");
|
||||
users.prepend('<option value="">---Users---</option>');
|
||||
users.prepend('<option value="">---'+tr("Users")+'---</option>');
|
||||
|
||||
var groups = $('<select>'+groups_select+'</select>');
|
||||
$('.empty_value',groups).remove();
|
||||
$('option',groups).addClass("group");
|
||||
groups.prepend('<option value="">---Groups---</option>');
|
||||
groups.prepend('<option value="">---'+tr("Groups")+'---</option>');
|
||||
|
||||
var dialog = $create_acl_dialog;
|
||||
$('#applies',dialog).html('<option value="*">All</option>'+
|
||||
$('#applies',dialog).html('<option value="*">'+tr("All")+'</option>'+
|
||||
users.html()+groups.html());
|
||||
$('#belonging_to',dialog).html(groups_select);
|
||||
|
||||
@ -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([
|
||||
|
@ -50,40 +50,40 @@ var dashboard_tab_content =
|
||||
<tr>\
|
||||
<td>\
|
||||
<div class="panel">\
|
||||
<h3>Summary of resources</h3>\
|
||||
<h3>' + tr('Summary of resources') + '</h3>\
|
||||
<div class="panel_info">\
|
||||
\
|
||||
<table class="info_table">\
|
||||
<tr>\
|
||||
<td class="key_td">Hosts (total/active)</td>\
|
||||
<td class="key_td">' + tr('Hosts (total/active)') + '</td>\
|
||||
<td class="value_td"><span id="total_hosts"></span><span id="active_hosts" class="green"></span></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Groups</td>\
|
||||
<td class="key_td">' + tr('Groups') + '</td>\
|
||||
<td class="value_td"><span id="total_groups"></span></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">VM Templates (total/public)</td>\
|
||||
<td class="key_td">' + tr('VM Templates (total/public)') + '</td>\
|
||||
<td class="value_td"><span id="total_templates"></span><span id="public_templates"></span></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">VM Instances (total/<span class="green">running</span>/<span class="red">failed</span>)</td>\
|
||||
<td class="key_td">' + tr('VM Instances')+' (' + tr('total') + '/<span class="green">' + tr('running') + '</span>/<span class="red">' + tr('failed') + '</span>)</td>\
|
||||
<td class="value_td"><span id="total_vms"></span><span id="running_vms" class="green"></span><span id="failed_vms" class="red"></span></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Virtual Networks (total/public)</td>\
|
||||
<td class="key_td">' + tr('Virtual Networks (total/public)') + '</td>\
|
||||
<td class="value_td"><span id="total_vnets"></span><span id="public_vnets"></span></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Images (total/public)</td>\
|
||||
<td class="key_td">' + tr('Images (total/public)') + '</td>\
|
||||
<td class="value_td"><span id="total_images"></span><span id="public_images"></span></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Users</td>\
|
||||
<td class="key_td">' + tr('Users')+'</td>\
|
||||
<td class="value_td"><span id="total_users"></span></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">ACL Rules</td>\
|
||||
<td class="key_td">' + tr('ACL Rules') + '</td>\
|
||||
<td class="value_td"><span id="total_acls"></span></td>\
|
||||
</tr>\
|
||||
</table>\
|
||||
@ -95,18 +95,18 @@ var dashboard_tab_content =
|
||||
<tr>\
|
||||
<td>\
|
||||
<div class="panel">\
|
||||
<h3>Quickstart</h3>\
|
||||
<h3>' + tr('Quickstart') + '</h3>\
|
||||
<form id="quickstart_form"><fieldset>\
|
||||
<table style="width:100%;"><tr style="vertical-align:middle;"><td style="width:70%">\
|
||||
<label style="font-weight:bold;width:40px;height:10em;">New:</label>\
|
||||
<input type="radio" name="quickstart" value="Host.create_dialog">Host</input><br />\
|
||||
<input type="radio" name="quickstart" value="VM.create_dialog">VM Instance</input><br />\
|
||||
<input type="radio" name="quickstart" value="Template.create_dialog">VM Template</input><br />\
|
||||
<input type="radio" name="quickstart" value="Network.create_dialog">Virtual Network</input><br />\
|
||||
<input type="radio" name="quickstart" value="Image.create_dialog">Image</input><br />\
|
||||
<input type="radio" name="quickstart" value="User.create_dialog">User</input><br />\
|
||||
<input type="radio" name="quickstart" value="Group.create_dialog">Group</input><br />\
|
||||
<input type="radio" name="quickstart" value="Acl.create_dialog">Acl</input><br />\
|
||||
<label style="font-weight:bold;width:40px;height:10em;">' + tr('New: ') + '</label>\
|
||||
<input type="radio" name="quickstart" value="Host.create_dialog">' + tr('Host') + '</input><br />\
|
||||
<input type="radio" name="quickstart" value="VM.create_dialog">' + tr('VM Instance') + '</input><br />\
|
||||
<input type="radio" name="quickstart" value="Template.create_dialog">' + tr('VM Template') + '</input><br />\
|
||||
<input type="radio" name="quickstart" value="Network.create_dialog">' + tr('Virtual Network') + '</input><br />\
|
||||
<input type="radio" name="quickstart" value="Image.create_dialog">' + tr('Image') + '</input><br />\
|
||||
<input type="radio" name="quickstart" value="User.create_dialog">' + tr('User') + '</input><br />\
|
||||
<input type="radio" name="quickstart" value="Group.create_dialog">' + tr('Group') + '</input><br />\
|
||||
<input type="radio" name="quickstart" value="Acl.create_dialog">' + tr('Acl') + '</input><br />\
|
||||
</td></tr></table>\
|
||||
</div>\
|
||||
</td>\
|
||||
@ -118,19 +118,19 @@ var dashboard_tab_content =
|
||||
<tr>\
|
||||
<td>\
|
||||
<div class="panel">\
|
||||
<h3>Historical monitoring information</h3>\
|
||||
<h3>' + tr('Historical monitoring information') + '</h3>\
|
||||
<div class="panel_info">\
|
||||
<table class="info_table">\
|
||||
<tr><td class="key_td graph_td">Hosts CPU</td>\
|
||||
<tr><td class="key_td graph_td">' + tr('Hosts CPU') + '</td>\
|
||||
<td class="graph_td" id="graph1_legend"></td></tr>\
|
||||
<tr><td id="graph1" colspan="2">'+spinner+'</td></tr>\
|
||||
<tr><td class="key_td graph_td">Hosts memory</td>\
|
||||
<tr><td class="key_td graph_td">' + tr('Hosts memory') + '</td>\
|
||||
<td class="graph_td" id="graph2_legend"></td></tr>\
|
||||
<tr><td id="graph2" colspan="2">'+spinner+'</td></tr>\
|
||||
<tr><td class="key_td graph_td">Total VM count</td>\
|
||||
<tr><td class="key_td graph_td">' + tr('Total VM count') + '</td>\
|
||||
<td class="graph_td" id="graph3_legend"></td></tr>\
|
||||
<tr><td id="graph3" colspan="2">'+spinner+'</td></tr>\
|
||||
<tr><td class="key_td graph_td">VM Network stats</td>\
|
||||
<tr><td class="key_td graph_td">' + tr('VM Network stats') + '</td>\
|
||||
<td class="graph_td" id="graph4_legend"></td></tr>\
|
||||
<tr><td id="graph4" colspan="2">'+spinner+'</td></tr>\
|
||||
</table>\
|
||||
@ -143,7 +143,7 @@ var dashboard_tab_content =
|
||||
</tr></table>';
|
||||
|
||||
var dashboard_tab = {
|
||||
title: 'Dashboard',
|
||||
title: tr('Dashboard'),
|
||||
content: dashboard_tab_content
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ function plot_global_graph(data,info){
|
||||
|
||||
for (var i=0; i<labels_array.length; i++) {
|
||||
serie = {
|
||||
label: labels_array[i],
|
||||
label: tr(labels_array[i]),
|
||||
data: monitoring[labels_array[i]]
|
||||
};
|
||||
series.push(serie);
|
||||
|
@ -50,24 +50,24 @@ var dashboard_tab_content =
|
||||
<tr>\
|
||||
<td>\
|
||||
<div class="panel">\
|
||||
<h3>Summary of resources</h3>\
|
||||
<h3>'+tr('Summary of resources')+'</h3>\
|
||||
<div class="panel_info">\
|
||||
\
|
||||
<table class="info_table">\
|
||||
<tr>\
|
||||
<td class="key_td">VM Templates (total/public)</td>\
|
||||
<td class="key_td">'+tr('VM Templates (total/public)')+'</td>\
|
||||
<td class="value_td"><span id="total_templates"></span><span id="public_templates"></span></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">VM Instances (total/<span class="green">running</span>/<span class="red">failed</span>)</td>\
|
||||
<td class="key_td">'+tr('VM Instances')+' ('+tr('total')+'/<span class="green">'+tr('running')+'</span>/<span class="red">'+tr('failed')+'</span>)</td>\
|
||||
<td class="value_td"><span id="total_vms"></span><span id="running_vms" class="green"></span><span id="failed_vms" class="red"></span></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Virtual Networks (total/public)</td>\
|
||||
<td class="key_td">'+tr('Virtual Networks (total/public)')+'</td>\
|
||||
<td class="value_td"><span id="total_vnets"></span><span id="public_vnets"></span></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Images (total/public)</td>\
|
||||
<td class="key_td">'+tr('Images (total/public)')+'</td>\
|
||||
<td class="value_td"><span id="total_images"></span><span id="public_images"></span></td>\
|
||||
</tr>\
|
||||
</table>\
|
||||
@ -79,14 +79,14 @@ var dashboard_tab_content =
|
||||
<tr>\
|
||||
<td>\
|
||||
<div class="panel">\
|
||||
<h3>Quickstart</h3>\
|
||||
<h3>'+tr('Quickstart')+'</h3>\
|
||||
<form id="quickstart_form"><fieldset>\
|
||||
<table style="width:100%;"><tr style="vertical-align:middle;"><td style="width:70%">\
|
||||
<label style="font-weight:bold;width:40px;height:4em;">New:</label>\
|
||||
<input type="radio" name="quickstart" value="Template.create_dialog">VM Template</input><br />\
|
||||
<input type="radio" name="quickstart" value="VM.create_dialog">VM Instance</input><br />\
|
||||
<input type="radio" name="quickstart" value="Network.create_dialog">Virtual Network</input><br />\
|
||||
<input type="radio" name="quickstart" value="Image.create_dialog">Image</input><br />\
|
||||
<input type="radio" name="quickstart" value="Template.create_dialog">'+tr('VM Template')+'</input><br />\
|
||||
<input type="radio" name="quickstart" value="VM.create_dialog">'+tr('VM Instance')+'</input><br />\
|
||||
<input type="radio" name="quickstart" value="Network.create_dialog">'+tr('Virtual Network')+'</input><br />\
|
||||
<input type="radio" name="quickstart" value="Image.create_dialog">'+tr('Image')+'</input><br />\
|
||||
</td></tr></table>\
|
||||
</div>\
|
||||
</td>\
|
||||
@ -98,19 +98,19 @@ var dashboard_tab_content =
|
||||
<tr>\
|
||||
<td>\
|
||||
<div class="panel">\
|
||||
<h3>Historical monitoring information</h3>\
|
||||
<h3>'+tr('Historical monitoring information')+'</h3>\
|
||||
<div class="panel_info">\
|
||||
<table class="info_table">\
|
||||
<tr><td class="key_td graph_td">Total VM count</td>\
|
||||
<tr><td class="key_td graph_td">'+tr('Total VM count')+'</td>\
|
||||
<td class="graph_td" id="graph1_legend"></td></tr>\
|
||||
<tr><td id="graph1" colspan="2">'+spinner+'</td></tr>\
|
||||
<tr><td class="key_td graph_td">Total VM CPU</td>\
|
||||
<tr><td class="key_td graph_td">'+tr('Total VM CPU')+'</td>\
|
||||
<td class="graph_td" id="graph2_legend"></td></tr>\
|
||||
<tr><td id="graph2" colspan="2">'+spinner+'</td></tr>\
|
||||
<tr><td class="key_td graph_td">Total VM Memory</td>\
|
||||
<tr><td class="key_td graph_td">'+tr('Total VM Memory')+'</td>\
|
||||
<td class="graph_td" id="graph3_legend"></td></tr>\
|
||||
<tr><td id="graph3" colspan="2">'+spinner+'</td></tr>\
|
||||
<tr><td class="key_td graph_td">VM Network stats</td>\
|
||||
<tr><td class="key_td graph_td">'+tr('VM Network stats')+'</td>\
|
||||
<td class="graph_td" id="graph4_legend"></td></tr>\
|
||||
<tr><td id="graph4" colspan="2">'+spinner+'</td></tr>\
|
||||
</table>\
|
||||
@ -123,7 +123,7 @@ var dashboard_tab_content =
|
||||
</tr></table>';
|
||||
|
||||
var dashboard_tab = {
|
||||
title: 'Dashboard',
|
||||
title: tr('Dashboard'),
|
||||
content: dashboard_tab_content
|
||||
}
|
||||
|
||||
|
@ -25,10 +25,10 @@ var groups_tab_content =
|
||||
<table id="datatable_groups" class="display">\
|
||||
<thead>\
|
||||
<tr>\
|
||||
<th class="check"><input type="checkbox" class="check_all" value="">All</input></th>\
|
||||
<th>ID</th>\
|
||||
<th>Name</th>\
|
||||
<th>Users</th>\
|
||||
<th class="check"><input type="checkbox" class="check_all" value="">'+tr("All")+'</input></th>\
|
||||
<th>'+tr("ID")+'</th>\
|
||||
<th>'+tr("Name")+'</th>\
|
||||
<th>'+tr("Users")+'</th>\
|
||||
</tr>\
|
||||
</thead>\
|
||||
<tbody id="tbodygroups">\
|
||||
@ -40,14 +40,14 @@ var create_group_tmpl =
|
||||
'<form id="create_group_form" action="">\
|
||||
<fieldset style="border:none;">\
|
||||
<div>\
|
||||
<label for="name">Group name:</label>\
|
||||
<label for="name">'+tr("Group name:")+'</label>\
|
||||
<input type="text" name="name" id="name" /><br />\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button" id="create_group_submit" value="Group.create">Create</button>\
|
||||
<button class="button" type="reset" value="reset">Reset</button>\
|
||||
<button class="button" id="create_group_submit" value="Group.create">'+tr("Create")+'</button>\
|
||||
<button class="button" type="reset" value="reset">'+tr("Reset")+'</button>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
</form>';
|
||||
@ -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('<div title="Create group" id="create_group_dialog"></div>');
|
||||
dialogs_context.append('<div title=\"'+tr("Create group")+'\" id="create_group_dialog"></div>');
|
||||
$create_group_dialog = $('#create_group_dialog',dialogs_context);
|
||||
var dialog = $create_group_dialog;
|
||||
|
||||
@ -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();
|
||||
|
@ -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 =
|
||||
<table id="datatable_hosts" class="display">\
|
||||
<thead>\
|
||||
<tr>\
|
||||
<th class="check"><input type="checkbox" class="check_all" value="">All</input></th>\
|
||||
<th>ID</th>\
|
||||
<th>Name</th>\
|
||||
<th>Running VMs</th>\
|
||||
<th>CPU Use</th>\
|
||||
<th>Memory use</th>\
|
||||
<th>Status</th>\
|
||||
<th class="check"><input type="checkbox" class="check_all" value="">' + tr('All') + '</input></th>\
|
||||
<th>' + tr('id') + '</th>\
|
||||
<th>' + tr('Name') + '</th>\
|
||||
<th>' + tr('Running VMs') + '</th>\
|
||||
<th>' + tr('CPU Use') + '</th>\
|
||||
<th>' + tr('Memory use') + '</th>\
|
||||
<th>' + tr('Status') + '</th>\
|
||||
</tr>\
|
||||
</thead>\
|
||||
<tbody id="tbodyhosts">\
|
||||
@ -57,42 +57,42 @@ var hosts_tab_content =
|
||||
var create_host_tmpl =
|
||||
'<div class="create_form"><form id="create_host_form" action="">\
|
||||
<fieldset>\
|
||||
<legend style="display:none;">Host parameters</legend>\
|
||||
<label for="name">Name: </label><input type="text" name="name" id="name" />\
|
||||
<legend style="display:none;">' + tr('Host parameters') + '</legend>\
|
||||
<label for="name">' + tr('Name') + ':</label><input type="text" name="name" id="name" />\
|
||||
</fieldset>\
|
||||
<h3>Drivers</h3>\
|
||||
<h3>' + tr('Drivers') + '</h3>\
|
||||
<fieldset>\
|
||||
<div class="manager clear" id="vmm_mads">\
|
||||
<label>Virtualization Manager:</label>\
|
||||
<label>' + tr('Virtualization Manager:') + '</label>\
|
||||
<select id="vmm_mad" name="vmm">\
|
||||
<option value="vmm_kvm">KVM</option>\
|
||||
<option value="vmm_xen">XEN</option>\
|
||||
<option value="vmm_ec2">EC2</option>\
|
||||
<option value="vmm_dummy">Dummy</option>\
|
||||
<option value="vmm_kvm">' + tr('KVM') + '</option>\
|
||||
<option value="vmm_xen">' + tr('XEN') + '</option>\
|
||||
<option value="vmm_ec2">' + tr('EC2') + '</option>\
|
||||
<option value="vmm_dummy">' + tr('Dummy') + '</option>\
|
||||
</select>\
|
||||
</div>\
|
||||
<div class="manager clear" id="im_mads">\
|
||||
<label>Information Manager:</label>\
|
||||
<label>' + tr('Information Manager:') + '</label>\
|
||||
<select id="im_mad" name="im">\
|
||||
<option value="im_kvm">KVM</option>\
|
||||
<option value="im_xen">XEN</option>\
|
||||
<option value="im_ec2">EC2</option>\
|
||||
<option value="im_dummy">Dummy</option>\
|
||||
<option value="im_kvm">' + tr('KVM') + '</option>\
|
||||
<option value="im_xen">' + tr('XEN') + '</option>\
|
||||
<option value="im_ec2">' + tr('EC2') + '</option>\
|
||||
<option value="im_dummy">' + tr('Dummy') + '</option>\
|
||||
</select>\
|
||||
</div>\
|
||||
<div class="manager clear" id="tm_mads">\
|
||||
<label>Transfer Manager:</label>\
|
||||
<label>' + tr('Transfer Manager:') + '</label>\
|
||||
<select id="tm_mad" name="tm">\
|
||||
<option value="tm_shared">SHARED</option>\
|
||||
<option value="tm_ssh">SSH</option>\
|
||||
<option value="tm_dummy">Dummy</option>\
|
||||
<option value="tm_shared">' + tr('SHARED') + '</option>\
|
||||
<option value="tm_ssh">' + tr('SSH') + '</option>\
|
||||
<option value="tm_dummy">' + tr('Dummy') + '</option>\
|
||||
</select>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<div class="form_buttons">\
|
||||
<div><button class="button" id="create_host_submit" value="OpenNebula.Host.create">Create</button>\
|
||||
<button class="button" type="reset" value="reset">Reset</button></div>\
|
||||
<div><button class="button" id="create_host_submit" value="OpenNebula.Host.create">' + tr('Create') + '</button>\
|
||||
<button class="button" type="reset" value="reset">' + tr('Reset') + '</button></div>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
</form></div>';
|
||||
@ -233,7 +233,7 @@ var host_actions = {
|
||||
type: "single",
|
||||
call: OpenNebula.Host.update,
|
||||
callback: function() {
|
||||
notifyMessage("Template updated correctly");
|
||||
notifyMessage(tr("Template updated correctly"));
|
||||
},
|
||||
error: onError
|
||||
}
|
||||
@ -242,51 +242,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
|
||||
}
|
||||
@ -420,62 +420,62 @@ function updateHostInfo(request,host){
|
||||
|
||||
//Information tab
|
||||
var info_tab = {
|
||||
title : "Host information",
|
||||
title : tr("Host information"),
|
||||
content :
|
||||
'<table id="info_host_table" class="info_table">\
|
||||
<thead>\
|
||||
<tr><th colspan="2">Host information - '+host_info.NAME+'</th></tr>\
|
||||
<tr><th colspan="2">' + tr('Host information') + ' - '+host_info.NAME+'</th></tr>\
|
||||
</thead>\
|
||||
<tbody>\
|
||||
<tr>\
|
||||
<td class="key_td">ID</td>\
|
||||
<td class="key_td">' + tr('id') + '</td>\
|
||||
<td class="value_td">'+host_info.ID+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">State</td>\
|
||||
<td class="value_td">'+OpenNebula.Helper.resource_state("host",host_info.STATE)+'</td>\
|
||||
<td class="key_td">' + tr('State') + '</td>\
|
||||
<td class="value_td">'+tr(OpenNebula.Helper.resource_state("host",host_info.STATE))+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">IM MAD</td>\
|
||||
<td class="key_td">' + tr('IM MAD') + '</td>\
|
||||
<td class="value_td">'+host_info.IM_MAD+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">VM MAD</td>\
|
||||
<td class="key_td">' + tr('VM MAD') + '</td>\
|
||||
<td class="value_td">'+host_info.VM_MAD+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">TM MAD</td>\
|
||||
<td class="key_td">' + tr('TM MAD') + '</td>\
|
||||
<td class="value_td">'+host_info.TM_MAD+'</td>\
|
||||
</tr>\
|
||||
</tbody>\
|
||||
</table>\
|
||||
<table id="host_shares_table" class="info_table">\
|
||||
<thead>\
|
||||
<tr><th colspan="2">Host shares</th></tr>\
|
||||
<tr><th colspan="2">' + tr('Host shares') + '</th></tr>\
|
||||
</thead>\
|
||||
<tbody>\
|
||||
<tr>\
|
||||
<td class="key_td">Max Mem</td>\
|
||||
<td class="key_td">' + tr('Max Mem') + '</td>\
|
||||
<td class="value_td">'+humanize_size(host_info.HOST_SHARE.MAX_MEM)+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Used Mem (real)</td>\
|
||||
<td class="key_td">' + tr('Used Mem (real)') + '</td>\
|
||||
<td class="value_td">'+humanize_size(host_info.HOST_SHARE.USED_MEM)+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Used Mem (allocated)</td>\
|
||||
<td class="key_td">' + tr('Used Mem (allocated)') + '</td>\
|
||||
<td class="value_td">'+humanize_size(host_info.HOST_SHARE.MAX_USAGE)+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Used CPU (real)</td>\
|
||||
<td class="key_td">' + tr('Used CPU (real)') + '</td>\
|
||||
<td class="value_td">'+host_info.HOST_SHARE.USED_CPU+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Used CPU (allocated)</td>\
|
||||
<td class="key_td">' + tr('Used CPU (allocated)') + '</td>\
|
||||
<td class="value_td">'+host_info.HOST_SHARE.CPU_USAGE+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Running VMs</td>\
|
||||
<td class="key_td">' + tr('Running VMs') + '</td>\
|
||||
<td class="value_td">'+host_info.HOST_SHARE.RUNNING_VMS+'</td>\
|
||||
</tr>\
|
||||
</tbody>\
|
||||
@ -484,16 +484,16 @@ function updateHostInfo(request,host){
|
||||
|
||||
//Template tab
|
||||
var template_tab = {
|
||||
title : "Host template",
|
||||
title : tr("Host template"),
|
||||
content :
|
||||
'<table id="host_template_table" class="info_table" style="width:80%">\
|
||||
<thead><tr><th colspan="2">Host template</th></tr></thead>'+
|
||||
<thead><tr><th colspan="2">' + tr('Host template') + '</th></tr></thead>'+
|
||||
prettyPrintJSON(host_info.TEMPLATE)+
|
||||
'</table>'
|
||||
}
|
||||
|
||||
var monitor_tab = {
|
||||
title: "Monitoring information",
|
||||
title: tr("Monitoring information"),
|
||||
content : generateMonitoringDivs(host_graphs,"host_monitor_")
|
||||
}
|
||||
|
||||
@ -513,7 +513,7 @@ function updateHostInfo(request,host){
|
||||
|
||||
//Prepares the host creation dialog
|
||||
function setupCreateHostDialog(){
|
||||
dialogs_context.append('<div title="Create host" id="create_host_dialog"></div>');
|
||||
dialogs_context.append('<div title=\"'+tr("Create host")+'\" id="create_host_dialog"></div>');
|
||||
$create_host_dialog = $('div#create_host_dialog');
|
||||
var dialog = $create_host_dialog;
|
||||
|
||||
@ -529,7 +529,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 = {
|
||||
@ -596,7 +596,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
|
||||
|
@ -23,18 +23,18 @@ var images_tab_content =
|
||||
<table id="datatable_images" class="display">\
|
||||
<thead>\
|
||||
<tr>\
|
||||
<th class="check"><input type="checkbox" class="check_all" value="">All</input></th>\
|
||||
<th>ID</th>\
|
||||
<th>Owner</th>\
|
||||
<th>Group</th>\
|
||||
<th>Name</th>\
|
||||
<th>Size</th>\
|
||||
<th>Type</th>\
|
||||
<th>Registration time</th>\
|
||||
<th>Public</th>\
|
||||
<th>Persistent</th>\
|
||||
<th>Status</th>\
|
||||
<th>#VMS</th>\
|
||||
<th class="check"><input type="checkbox" class="check_all" value="">'+tr('All')+'</input></th>\
|
||||
<th>'+tr('ID')+'</th>\
|
||||
<th>'+tr('Owner')+'</th>\
|
||||
<th>'+tr('Group')+'</th>\
|
||||
<th>'+tr('Name')+'</th>\
|
||||
<th>'+tr('Size')+'</th>\
|
||||
<th>'+tr('Type')+'</th>\
|
||||
<th>'+tr('Registration time')+'</th>\
|
||||
<th>'+tr('Public')+'</th>\
|
||||
<th>'+tr('Persistent')+'</th>\
|
||||
<th>'+tr('Status')+'</th>\
|
||||
<th>'+tr('#VMS')+'</th>\
|
||||
</tr>\
|
||||
</thead>\
|
||||
<tbody id="tbodyimages">\
|
||||
@ -44,114 +44,114 @@ var images_tab_content =
|
||||
|
||||
var create_image_tmpl =
|
||||
'<div id="img_tabs">\
|
||||
<ul><li><a href="#img_easy">Wizard</a></li>\
|
||||
<li><a href="#img_manual">Advanced mode</a></li>\
|
||||
<ul><li><a href="#img_easy">'+tr('Wizard')+'</a></li>\
|
||||
<li><a href="#img_manual">'+tr('Advanced mode')+'</a></li>\
|
||||
</ul>\
|
||||
<div id="img_easy">\
|
||||
<form id="create_image_form_easy" action="">\
|
||||
<p style="font-size:0.8em;text-align:right;"><i>Fields marked with <span style="display:inline-block;" class="ui-icon ui-icon-alert" /> are mandatory</i><br />\
|
||||
<p style="font-size:0.8em;text-align:right;"><i>'+tr('Fields marked with')+' <span style="display:inline-block;" class="ui-icon ui-icon-alert" /> '+tr('are mandatory')+'</i><br />\
|
||||
<fieldset>\
|
||||
<div class="img_param img_man">\
|
||||
<label for="img_name">Name:</label>\
|
||||
<label for="img_name">'+tr('Name')+':</label>\
|
||||
<input type="text" name="img_name" id="img_name" />\
|
||||
<div class="tip">Name that the Image will get. Every image must have a unique name.</div>\
|
||||
<div class="tip">'+tr('Name that the Image will get. Every image must have a unique name.')+'</div>\
|
||||
</div>\
|
||||
<div class="img_param">\
|
||||
<label for="img_desc">Description:</label>\
|
||||
<label for="img_desc">'+tr('Description')+':</label>\
|
||||
<textarea name="img_desc" id="img_desc" style="height:4em"></textarea>\
|
||||
<div class="tip">Human readable description of the image for other users.</div>\
|
||||
<div class="tip">'+tr('Human readable description of the image for other users.')+'</div>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<div class="img_param">\
|
||||
<label for="img_type">Type:</label>\
|
||||
<label for="img_type">'+tr('Type')+':</label>\
|
||||
<select name="img_type" id="img_type">\
|
||||
<option value="OS">OS</option>\
|
||||
<option value="CDROM">CD-ROM</option>\
|
||||
<option value="DATABLOCK">Datablock</option>\
|
||||
<option value="OS">'+tr('OS')+'</option>\
|
||||
<option value="CDROM">'+tr('CD-ROM')+'</option>\
|
||||
<option value="DATABLOCK">'+tr('Datablock')+'</option>\
|
||||
</select>\
|
||||
<div class="tip">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).</div>\
|
||||
<div class="tip">'+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).')+'</div>\
|
||||
</div>\
|
||||
<div class="img_param">\
|
||||
<label for="img_public">Public:</label>\
|
||||
<label for="img_public">'+tr('Public')+':</label>\
|
||||
<input type="checkbox" id="img_public" name="img_public" value="YES" />\
|
||||
<div class="tip">Public scope of the image</div>\
|
||||
<div class="tip">'+tr('Public scope of the image')+'</div>\
|
||||
</div>\
|
||||
<div class="img_param">\
|
||||
<label for="img_persistent">Persistent:</label>\
|
||||
<label for="img_persistent">'+tr('Persistent')+':</label>\
|
||||
<input type="checkbox" id="img_persistent" name="img_persistent" value="YES" />\
|
||||
<div class="tip">Persistence of the image</div>\
|
||||
<div class="tip">'+tr('Persistence of the image')+'</div>\
|
||||
</div>\
|
||||
<div class="img_param">\
|
||||
<label for="img_dev_prefix">Device prefix:</label>\
|
||||
<label for="img_dev_prefix">'+tr('Device prefix:')+'</label>\
|
||||
<input type="text" name="img_dev_prefix" id="img_dev_prefix" />\
|
||||
<div class="tip">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”).</div>\
|
||||
<div class="tip">'+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”).')+'</div>\
|
||||
</div>\
|
||||
<div class="img_param">\
|
||||
<label for="img_bus">Bus:</label>\
|
||||
<label for="img_bus">'+tr('Bus')+':</label>\
|
||||
<select name="img_bus" id="img_bus">\
|
||||
<option value="IDE">IDE</option>\
|
||||
<option value="SCSI">SCSI</option>\
|
||||
<option value="virtio">Virtio (KVM)</option>\
|
||||
<option value="IDE">'+tr('IDE')+'</option>\
|
||||
<option value="SCSI">'+tr('SCSI')+'</option>\
|
||||
<option value="virtio">'+tr('Virtio (KVM)')+'</option>\
|
||||
</select>\
|
||||
<div class="tip">Type of disk device to emulate.</div>\
|
||||
<div class="tip">'+tr('Type of disk device to emulate.')+'</div>\
|
||||
</div>\
|
||||
<div class="img_param">\
|
||||
<label for="img_driver">Driver:</label>\
|
||||
<label for="img_driver">'+tr('Driver')+':</label>\
|
||||
<input type="text" name="img_driver" id="img_driver" />\
|
||||
<div class="tip">Specific image mapping driver. KVM: raw, qcow2 and Xen:tap:aio:, file:</div>\
|
||||
<div class="tip">'+tr('Specific image mapping driver. KVM: raw, qcow2. XEN: tap:aio, file:')+'</div>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<div class="" id="src_path_select">\
|
||||
<label style="height:3em;">Path vs. source:</label>\
|
||||
<label style="height:3em;">'+tr('Path vs. source:')+'</label>\
|
||||
<input type="radio" name="src_path" id="path_img" value="path" />\
|
||||
<label style="float:none">Provide a path</label><br />\
|
||||
<label style="float:none">'+tr('Provide a path')+'</label><br />\
|
||||
<input type="radio" name="src_path" id="source_img" value="source" />\
|
||||
<label style="float:none">Provide a source</label><br />\
|
||||
<label style="float:none">'+tr('Provide a source')+'</label><br />\
|
||||
<input type="radio" name="src_path" id="datablock_img" value="datablock" />\
|
||||
<label style="float:none;vertical-align:top">Create an empty datablock</label>\
|
||||
<div class="tip">Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.</div><br />\
|
||||
<label style="float:none;vertical-align:top">'+tr('Create an empty datablock')+'</label>\
|
||||
<div class="tip">'+tr('Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.')+'</div><br />\
|
||||
</div>\
|
||||
<div class="img_param">\
|
||||
<label for="img_path">Path:</label>\
|
||||
<label for="img_path">'+tr('Path')+':</label>\
|
||||
<input type="text" name="img_path" id="img_path" />\
|
||||
<div class="tip">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.</div>\
|
||||
<div class="tip">'+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.')+'</div>\
|
||||
</div>\
|
||||
<div class="img_param">\
|
||||
<label for="img_source">Source:</label>\
|
||||
<label for="img_source">'+tr('Source')+':</label>\
|
||||
<input type="text" name="img_source" id="img_source" />\
|
||||
<div class="tip">Source to be used in the DISK attribute. Useful for not file-based images.</div>\
|
||||
<div class="tip">'+tr('Source to be used in the DISK attribute. Useful for not file-based images.')+'</div>\
|
||||
</div>\
|
||||
<div class="img_size">\
|
||||
<label for="img_size">Size:</label>\
|
||||
<label for="img_size">'+tr('Size')+':</label>\
|
||||
<input type="text" name="img_size" id="img_size" />\
|
||||
<div class="tip">Size of the datablock in MB.</div>\
|
||||
<div class="tip">'+tr('Size of the datablock in MB.')+'</div>\
|
||||
</div>\
|
||||
<div class="img_param">\
|
||||
<label for="img_fstype">FS type:</label>\
|
||||
<label for="img_fstype">'+tr('FS type')+':</label>\
|
||||
<input type="text" name="img_fstype" id="img_fstype" />\
|
||||
<div class="tip">Type of file system to be built. This can be any value understood by mkfs unix command.</div>\
|
||||
<div class="tip">'+tr('Type of file system to be built. This can be any value understood by mkfs unix command.')+'</div>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<div class="">\
|
||||
<label for="custom_var_image_name">Name:</label>\
|
||||
<label for="custom_var_image_name">'+tr('Name')+':</label>\
|
||||
<input type="text" id="custom_var_image_name" name="custom_var_image_name" />\
|
||||
<label for="custom_var_image_value">Value:</label>\
|
||||
<label for="custom_var_image_value">'+tr('Value')+':</label>\
|
||||
<input type="text" id="custom_var_image_value" name="custom_var_image_value" />\
|
||||
<button class="add_remove_button add_button" id="add_custom_var_image_button" value="add_custom_image_var">Add</button>\
|
||||
<button class="add_remove_button" id="remove_custom_var_image_button" value="remove_custom_image_var">Remove selected</button>\
|
||||
<button class="add_remove_button add_button" id="add_custom_var_image_button" value="add_custom_image_var">'+tr('Add')+'</button>\
|
||||
<button class="add_remove_button" id="remove_custom_var_image_button" value="remove_custom_image_var">'+tr('Remove selected')+'</button>\
|
||||
<div class="clear"></div>\
|
||||
<label for="custom_var_image_box">Custom attributes:</label>\
|
||||
<label for="custom_var_image_box">'+tr('Custom attributes')+':</label>\
|
||||
<select id="custom_var_image_box" name="custom_var_image_box" style="height:100px;" multiple>\
|
||||
</select>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button" id="create_image_submit" value="user/create">Create</button>\
|
||||
<button class="button" type="reset" value="reset">Reset</button>\
|
||||
<button class="button" id="create_image_submit" value="user/create">'+tr('Create')+'</button>\
|
||||
<button class="button" type="reset" value="reset">'+tr('Reset')+'</button>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
</form>\
|
||||
@ -159,16 +159,16 @@ var create_image_tmpl =
|
||||
<div id="img_manual">\
|
||||
<form id="create_image_form_manual" action="">\
|
||||
<fieldset style="border-top:none;">\
|
||||
<h3 style="margin-bottom:10px;">Write the image template here</h3>\
|
||||
<h3 style="margin-bottom:10px;">'+tr('Write the image template here')+'</h3>\
|
||||
<textarea id="template" rows="15" style="width:100%;">\
|
||||
</textarea>\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button" id="create_vn_submit_manual" value="vn/create">\
|
||||
Create\
|
||||
'+tr('Create')+'\
|
||||
</button>\
|
||||
<button class="button" type="reset" value="reset">Reset</button>\
|
||||
<button class="button" type="reset" value="reset">'+tr('Reset')+'</button>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
</form>\
|
||||
@ -177,27 +177,26 @@ var create_image_tmpl =
|
||||
|
||||
var update_image_tmpl =
|
||||
'<form action="javascript:alert(\'js error!\');">\
|
||||
<h3 style="margin-bottom:10px;">Please, choose and modify the image you want to update:</h3>\
|
||||
<h3 style="margin-bottom:10px;">'+tr('Please, choose and modify the image you want to update')+':</h3>\
|
||||
<fieldset style="border-top:none;">\
|
||||
<label for="image_template_update_select">Select an image:</label>\
|
||||
<label for="image_template_update_select">'+tr('Select an image')+':</label>\
|
||||
<select id="image_template_update_select" name="image_template_update_select"></select>\
|
||||
<div class="clear"></div>\
|
||||
<div>\
|
||||
<label for="image_template_update_public">Public:</label>\
|
||||
<label for="image_template_update_public">'+tr('Public')+':</label>\
|
||||
<input type="checkbox" name="image_template_update_public" id="image_template_update_public" />\
|
||||
</div>\
|
||||
<div>\
|
||||
<label for="image_template_update_public">Persistent:</label>\
|
||||
<label for="image_template_update_public">'+tr('Persistent')+':</label>\
|
||||
<input type="checkbox" name="image_template_update_persistent" id="image_template_update_persistent" />\
|
||||
</div>\
|
||||
<label for="image_template_update_textarea">Template:</label>\
|
||||
<label for="image_template_update_textarea">'+tr('Template')+':</label>\
|
||||
<div class="clear"></div>\
|
||||
<textarea id="image_template_update_textarea" style="width:100%; height:14em;"></textarea>\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button" id="image_template_update_button" value="Image.update_template">\
|
||||
Update\
|
||||
<button class="button" id="image_template_update_button" value="Image.update_template">'+tr('Update')+'\
|
||||
</button>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
@ -277,7 +276,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 +395,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 +426,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 +491,13 @@ function imageElementArray(image_json){
|
||||
var image = image_json.IMAGE;
|
||||
|
||||
var type = $('<select>\
|
||||
<option value="OS">OS</option>\
|
||||
<option value="CDROM">CD-ROM</option>\
|
||||
<option value="DATABLOCK">Datablock</option>\
|
||||
<option value="OS">'+tr('OS')+'</option>\
|
||||
<option value="CDROM">'+tr('CD-ROM')+'</option>\
|
||||
<option value="DATABLOCK">'+tr('Datablock')+'</option>\
|
||||
</select>');
|
||||
|
||||
var value = OpenNebula.Helper.image_type(image.TYPE);
|
||||
$('option[value="'+value+'"]',type).replaceWith('<option value="'+value+'" selected="selected">'+value+'</option>');
|
||||
$('option[value="'+value+'"]',type).replaceWith('<option value="'+value+'" selected="selected">'+tr(value)+'</option>');
|
||||
|
||||
|
||||
|
||||
@ -570,75 +569,75 @@ 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:
|
||||
'<table id="info_img_table" class="info_table" style="width:80%;">\
|
||||
<thead>\
|
||||
<tr><th colspan="2">Image "'+img_info.NAME+'" information</th></tr>\
|
||||
<tr><th colspan="2">'+tr('Image')+' "'+img_info.NAME+'" '+tr('information')+'</th></tr>\
|
||||
</thead>\
|
||||
<tr>\
|
||||
<td class="key_td">ID</td>\
|
||||
<td class="key_td">'+tr('ID')+'</td>\
|
||||
<td class="value_td">'+img_info.ID+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Name</td>\
|
||||
<td class="key_td">'+tr('Name')+'</td>\
|
||||
<td class="value_td">'+img_info.NAME+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Owner</td>\
|
||||
<td class="key_td">'+tr('Owner')+'</td>\
|
||||
<td class="value_td">'+img_info.UNAME+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Group</td>\
|
||||
<td class="key_td">'+tr('Group')+'</td>\
|
||||
<td class="value_td">'+img_info.GNAME+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Type</td>\
|
||||
<td class="key_td">'+tr('Type')+'</td>\
|
||||
<td class="value_td">'+OpenNebula.Helper.image_type(img_info.TYPE)+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Register time</td>\
|
||||
<td class="key_td">'+tr('Register time')+'</td>\
|
||||
<td class="value_td">'+pretty_time(img_info.REGTIME)+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Public</td>\
|
||||
<td class="value_td">'+(parseInt(img_info.PUBLIC) ? "yes" : "no")+'</td>\
|
||||
<td class="key_td">'+tr('Public')+'</td>\
|
||||
<td class="value_td">'+(parseInt(img_info.PUBLIC) ? tr("yes") : tr("no"))+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Persistent</td>\
|
||||
<td class="value_td">'+(parseInt(img_info.PERSISTENT) ? "yes" : "no")+'</td>\
|
||||
<td class="key_td">'+tr('Persistent')+'</td>\
|
||||
<td class="value_td">'+(parseInt(img_info.PERSISTENT) ? tr("yes") : tr("no"))+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Source</td>\
|
||||
<td class="key_td">'+tr('Source')+'</td>\
|
||||
<td class="value_td">'+(typeof img_info.SOURCE === "string" ? img_info.SOURCE : "--")+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Path</td>\
|
||||
<td class="key_td">'+tr('Path')+'</td>\
|
||||
<td class="value_td">'+(typeof img_info.PATH === "string" ? img_info.PATH : "--")+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Filesystem type</td>\
|
||||
<td class="key_td">'+tr('Filesystem type')+'</td>\
|
||||
<td class="value_td">'+(typeof img_info.FSTYPE === "string" ? img_info.FSTYPE : "--")+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Size (Mb)</td>\
|
||||
<td class="key_td">'+tr('Size (Mb)')+'</td>\
|
||||
<td class="value_td">'+img_info.SIZE+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">State</td>\
|
||||
<td class="key_td">'+tr('State')+'</td>\
|
||||
<td class="value_td">'+OpenNebula.Helper.resource_state("image",img_info.STATE)+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Running #VMS</td>\
|
||||
<td class="key_td">'+tr('Running #VMS')+'</td>\
|
||||
<td class="value_td">'+img_info.RUNNING_VMS+'</td>\
|
||||
</tr>\
|
||||
</table>'
|
||||
}
|
||||
|
||||
var template_tab = {
|
||||
title: "Image template",
|
||||
title: tr("Image template"),
|
||||
content: '<table id="img_template_table" class="info_table" style="width:80%;">\
|
||||
<thead><tr><th colspan="2">Image template</th></tr></thead>'+
|
||||
<thead><tr><th colspan="2">'+tr('Image template')+'</th></tr></thead>'+
|
||||
prettyPrintJSON(img_info.TEMPLATE)+
|
||||
'</table>'
|
||||
}
|
||||
@ -652,7 +651,7 @@ function updateImageInfo(request,img){
|
||||
|
||||
// Prepare the image creation dialog
|
||||
function setupCreateImageDialog(){
|
||||
dialogs_context.append('<div title="Create Image" id="create_image_dialog"></div>');
|
||||
dialogs_context.append('<div title="'+tr('Create Image')+'" id="create_image_dialog"></div>');
|
||||
$create_image_dialog = $('#create_image_dialog',dialogs_context);
|
||||
var dialog = $create_image_dialog;
|
||||
dialog.html(create_image_tmpl);
|
||||
@ -732,7 +731,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= '<option value=\''+value+'\' name=\''+name+'\'>'+
|
||||
@ -755,7 +754,7 @@ function setupCreateImageDialog(){
|
||||
var exit = false;
|
||||
$('.img_man',this).each(function(){
|
||||
if (!$('input',this).val().length){
|
||||
notifyError("There are mandatory parameters missing");
|
||||
notifyError(tr("There are mandatory parameters missing"));
|
||||
exit = true;
|
||||
return false;
|
||||
}
|
||||
@ -799,7 +798,7 @@ function setupCreateImageDialog(){
|
||||
source = $('#img_source',this).val();
|
||||
img_json["SOURCE"] = source;
|
||||
break;
|
||||
case "datablock":
|
||||
case "datablock":
|
||||
size = $('#img_size',this).val();
|
||||
fstype = $('#img_fstype',this).val();
|
||||
img_json["SIZE"] = size;
|
||||
@ -839,7 +838,7 @@ function popUpCreateImageDialog(){
|
||||
function setupImageTemplateUpdateDialog(){
|
||||
|
||||
//Append to DOM
|
||||
dialogs_context.append('<div id="image_template_update_dialog" title="Update image template"></div>');
|
||||
dialogs_context.append('<div id="image_template_update_dialog" title="'+tr('Update image template')+'"></div>');
|
||||
var dialog = $('#image_template_update_dialog',dialogs_context);
|
||||
|
||||
//Put HTML in place
|
||||
@ -860,7 +859,7 @@ function setupImageTemplateUpdateDialog(){
|
||||
var id = $(this).val();
|
||||
if (id && id.length){
|
||||
var dialog = $('#image_template_update_dialog');
|
||||
$('#image_template_update_textarea',dialog).val("Loading...");
|
||||
$('#image_template_update_textarea',dialog).val(tr("Loading")+"...");
|
||||
|
||||
var img_public = is_public_image(id);
|
||||
var img_persistent = is_persistent_image(id)
|
||||
@ -933,7 +932,7 @@ function popUpImageTemplateUpdateDialog(){
|
||||
|
||||
if (sel_elems.length >= 1){ //several items in the list are selected
|
||||
//grep them
|
||||
var new_select= sel_elems.length > 1? '<option value="">Please select</option>' : "";
|
||||
var new_select= sel_elems.length > 1? '<option value="">'+tr('Please select')+'</option>' : "";
|
||||
$('option','<select>'+select+'</select>').each(function(){
|
||||
var val = $(this).val();
|
||||
if ($.inArray(val,sel_elems) >= 0){
|
||||
@ -983,7 +982,7 @@ function setupImageActionCheckboxes(){
|
||||
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);
|
||||
@ -998,7 +997,7 @@ function setupImageActionCheckboxes(){
|
||||
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);
|
||||
@ -1030,7 +1029,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 +1051,6 @@ $(document).ready(function(){
|
||||
initCheckAllBoxes(dataTable_images);
|
||||
tableCheckboxesListener(dataTable_images);
|
||||
imageInfoListener();
|
||||
|
||||
|
||||
})
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -27,11 +27,11 @@ var users_tab_content =
|
||||
<table id="datatable_users" class="display">\
|
||||
<thead>\
|
||||
<tr>\
|
||||
<th class="check"><input type="checkbox" class="check_all" value="">All</input></th>\
|
||||
<th>ID</th>\
|
||||
<th>Name</th>\
|
||||
<th>Group</th>\
|
||||
<th>Authentication driver</th>\
|
||||
<th class="check"><input type="checkbox" class="check_all" value="">'+tr('All')+'</input></th>\
|
||||
<th>'+tr('ID')+'</th>\
|
||||
<th>'+tr('Name')+'</th>\
|
||||
<th>'+tr('Group')+'</th>\
|
||||
<th>'+tr('Authentication driver')+'</th>\
|
||||
</tr>\
|
||||
</thead>\
|
||||
<tbody id="tbodyusers">\
|
||||
@ -43,18 +43,18 @@ var create_user_tmpl =
|
||||
'<form id="create_user_form" action="">\
|
||||
<fieldset>\
|
||||
<div>\
|
||||
<label for="username">Username:</label>\
|
||||
<label for="username">'+tr('Username')+':</label>\
|
||||
<input type="text" name="username" id="username" /><br />\
|
||||
<label for="pass">Password:</label>\
|
||||
<label for="pass">'+tr('Password')+':</label>\
|
||||
<input type="password" name="pass" id="pass" />\
|
||||
<label for="driver">Authentication:</label>\
|
||||
<label for="driver">'+tr('Authentication')+':</label>\
|
||||
<select name="driver" id="driver">\
|
||||
<option value="core" selected="selected">Core</option>\
|
||||
<option value="ssh">SSH</option>\
|
||||
<option value="x509">x509</option>\
|
||||
<option value="server_cipher">Server (Cipher)</option>\
|
||||
<option value="server_x509">Server (x509)</option>\
|
||||
<option value="public">Public</option>\
|
||||
<option value="core" selected="selected">'+tr('Core')+'</option>\
|
||||
<option value="ssh">'+tr('SSH')+'</option>\
|
||||
<option value="x509">'+tr('x509')+'</option>\
|
||||
<option value="server_cipher">'+tr('Server (Cipher)')+'</option>\
|
||||
<option value="server_x509">'+tr('Server (x509)')+'</option>\
|
||||
<option value="public">'+tr('Public')+'</option>\
|
||||
</select>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
@ -69,15 +69,15 @@ var create_user_tmpl =
|
||||
var update_pw_tmpl = '<form id="update_user_pw_form" action="">\
|
||||
<fieldset>\
|
||||
<div>\
|
||||
<div>This will change the password for the selected users:</div>\
|
||||
<label for="new_password">New password:</label>\
|
||||
<div>'+tr('This will change the password for the selected users')+':</div>\
|
||||
<label for="new_password">'+tr('New password')+':</label>\
|
||||
<input type="password" name="new_password" id="new_password" />\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button" id="update_pw_submit" value="user/create">Change</button>\
|
||||
<button class="button" type="reset" value="reset">Reset</button>\
|
||||
<button class="button" id="update_pw_submit" value="User.update">'+tr('Change')+'</button>\
|
||||
<button class="button" type="reset" value="reset">'+tr('Reset')+'</button>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
</form>';
|
||||
@ -222,7 +222,7 @@ var user_actions = {
|
||||
type: "single",
|
||||
call: OpenNebula.User.update,
|
||||
callback: function() {
|
||||
notifyMessage("Template updated correctly");
|
||||
notifyMessage(tr("Template updated correctly"));
|
||||
},
|
||||
error: onError
|
||||
}
|
||||
@ -232,40 +232,40 @@ var user_actions = {
|
||||
var user_buttons = {
|
||||
"User.refresh" : {
|
||||
type: "image",
|
||||
text: "Refresh list",
|
||||
text: tr("Refresh list"),
|
||||
img: "images/Refresh-icon.png"
|
||||
},
|
||||
"User.create_dialog" : {
|
||||
type: "create_dialog",
|
||||
text: "+ New"
|
||||
text: tr("+ New")
|
||||
},
|
||||
"User.update_dialog" : {
|
||||
type: "action",
|
||||
text: "Update a template",
|
||||
text: tr("Update a template"),
|
||||
alwaysActive: true
|
||||
},
|
||||
"User.update_password" : {
|
||||
type : "action",
|
||||
text : "Change password",
|
||||
text : tr("Change password"),
|
||||
},
|
||||
"User.chgrp" : {
|
||||
type: "confirm_with_select",
|
||||
text: "Change group",
|
||||
text: tr("Change group"),
|
||||
select: groups_sel,
|
||||
tip: "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: "Change authentication",
|
||||
text: tr("Change authentication"),
|
||||
select: function() {
|
||||
return '<option value="core" selected="selected">Core</option>\
|
||||
<option value="ssh">SSH</option>\
|
||||
<option value="x509">x509</option>\
|
||||
<option value="server_cipher">Server (Cipher)</option>\
|
||||
<option value="server_x509">Server (x509)</option>\
|
||||
<option value="public">Public</option>'
|
||||
return '<option value="core" selected="selected">'+tr('Core')+'</option>\
|
||||
<option value="ssh">'+tr('SSH')+'</option>\
|
||||
<option value="x509">'+tr('x509')+'</option>\
|
||||
<option value="server_cipher">'+tr('Server (Cipher)')+'</option>\
|
||||
<option value="server_x509">'+tr('Server (x509)')+'</option>\
|
||||
<option value="public">'+tr('Public')+'</option>'
|
||||
},
|
||||
tip: "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",
|
||||
@ -288,7 +288,7 @@ var user_buttons = {
|
||||
}
|
||||
|
||||
var users_tab = {
|
||||
title: "Users",
|
||||
title: tr("Users"),
|
||||
content: users_tab_content,
|
||||
buttons: user_buttons
|
||||
}
|
||||
@ -358,7 +358,7 @@ function updateUsersView(request,users_list){
|
||||
|
||||
// Prepare the user creation dialog
|
||||
function setupCreateUserDialog(){
|
||||
dialogs_context.append('<div title="Create user" id="create_user_dialog"></div>');
|
||||
dialogs_context.append('<div title=\"'+tr("Create user")+'\" id="create_user_dialog"></div>');
|
||||
$create_user_dialog = $('#create_user_dialog',dialogs_context);
|
||||
var dialog = $create_user_dialog;
|
||||
dialog.html(create_user_tmpl);
|
||||
@ -378,7 +378,7 @@ function setupCreateUserDialog(){
|
||||
var driver = $('#driver', this).val();
|
||||
|
||||
if (!user_name.length || !user_password.length){
|
||||
notifyError("User name and password must be filled in");
|
||||
notifyError(tr("User name and password must be filled in"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -395,7 +395,7 @@ function setupCreateUserDialog(){
|
||||
}
|
||||
|
||||
function setupUpdatePasswordDialog(){
|
||||
dialogs_context.append('<div title="Change password" id="update_user_pw_dialog"></div>');
|
||||
dialogs_context.append('<div title="'+tr('Change password')+'" id="update_user_pw_dialog"></div>');
|
||||
$update_pw_dialog = $('#update_user_pw_dialog',dialogs_context);
|
||||
var dialog = $update_pw_dialog;
|
||||
dialog.html(update_pw_tmpl);
|
||||
@ -413,7 +413,7 @@ function setupUpdatePasswordDialog(){
|
||||
var pw=$('#new_password',this).val();
|
||||
|
||||
if (!pw.length){
|
||||
notifyError("Fill in a new password");
|
||||
notifyError(tr("Fill in a new password"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -458,7 +458,11 @@ $(document).ready(function(){
|
||||
{ "sWidth": "60px", "aTargets": [0] },
|
||||
{ "sWidth": "35px", "aTargets": [1] },
|
||||
{ "sWidth": "150px", "aTargets": [4] }
|
||||
]
|
||||
],
|
||||
"oLanguage": (datatable_lang != "") ?
|
||||
{
|
||||
sUrl: "locale/"+lang+"/"+datatable_lang
|
||||
} : ""
|
||||
});
|
||||
dataTable_users.fnClearTable();
|
||||
addElement([
|
||||
|
@ -25,22 +25,22 @@ function loadVNC(){
|
||||
loadVNC();
|
||||
|
||||
var vm_graphs = [
|
||||
{ title : "CPU",
|
||||
{ title : tr("CPU"),
|
||||
monitor_resources : "cpu_usage",
|
||||
humanize_figures : false,
|
||||
history_length : VM_HISTORY_LENGTH
|
||||
},
|
||||
{ title : "Memory",
|
||||
{ title : tr("Memory"),
|
||||
monitor_resources : "mem_usage",
|
||||
humanize_figures : true,
|
||||
history_length : VM_HISTORY_LENGTH
|
||||
},
|
||||
{ title : "Network transmission",
|
||||
{ title : tr("Network transmission"),
|
||||
monitor_resources : "net_tx",
|
||||
humanize_figures : true,
|
||||
history_length : VM_HISTORY_LENGTH
|
||||
},
|
||||
{ title : "Network reception",
|
||||
{ title : tr("Network reception"),
|
||||
monitor_resources : "net_rx",
|
||||
humanize_figures : true,
|
||||
history_length : VM_HISTORY_LENGTH
|
||||
@ -54,17 +54,17 @@ var vms_tab_content =
|
||||
<table id="datatable_vmachines" class="display">\
|
||||
<thead>\
|
||||
<tr>\
|
||||
<th class="check"><input type="checkbox" class="check_all" value="">All</input></th>\
|
||||
<th>ID</th>\
|
||||
<th>Owner</th>\
|
||||
<th>Group</th>\
|
||||
<th>Name</th>\
|
||||
<th>Status</th>\
|
||||
<th>CPU</th>\
|
||||
<th>Memory</th>\
|
||||
<th>Hostname</th>\
|
||||
<th>Start Time</th>\
|
||||
<th>VNC Access</th>\
|
||||
<th class="check"><input type="checkbox" class="check_all" value="">'+tr("All")+'</input></th>\
|
||||
<th>'+tr("ID")+'</th>\
|
||||
<th>'+tr("Owner")+'</th>\
|
||||
<th>'+tr("Group")+'</th>\
|
||||
<th>'+tr("Name")+'</th>\
|
||||
<th>'+tr("Status")+'</th>\
|
||||
<th>'+tr("CPU")+'</th>\
|
||||
<th>'+tr("Memory")+'</th>\
|
||||
<th>'+tr("Hostname")+'</th>\
|
||||
<th>'+tr("Start Time")+'</th>\
|
||||
<th>'+tr("VNC Access")+'</th>\
|
||||
</tr>\
|
||||
</thead>\
|
||||
<tbody id="tbodyvmachines">\
|
||||
@ -75,19 +75,19 @@ var vms_tab_content =
|
||||
var create_vm_tmpl ='<form id="create_vm_form" action="">\
|
||||
<fieldset>\
|
||||
<div>\
|
||||
<label for="vm_name">VM Name:</label>\
|
||||
<label for="vm_name">'+tr("VM Name:")+'</label>\
|
||||
<input type="text" name="vm_name" id="vm_name" /><br />\
|
||||
<label for="template_id">Select template:</label>\
|
||||
<label for="template_id">'+tr("Select template:")+'</label>\
|
||||
<select id="template_id">\
|
||||
</select><br />\
|
||||
<label for="vm_n_times">Deploy # VMs:</label>\
|
||||
<label for="vm_n_times">'+tr("Deploy # VMs:")+'</label>\
|
||||
<input type="text" name="vm_n_times" id="vm_n_times" value="1">\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button" id="create_vm_proceed" value="VM.create">Create</button>\
|
||||
<button class="button" type="reset" value="reset">Reset</button>\
|
||||
<button class="button" id="create_vm_proceed" value="VM.create">'+tr("Create")+'</button>\
|
||||
<button class="button" type="reset" value="reset">'+tr("Reset")+'</button>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
</form>';
|
||||
@ -372,36 +372,36 @@ var vm_actions = {
|
||||
var vm_buttons = {
|
||||
"VM.refresh" : {
|
||||
type: "image",
|
||||
text: "Refresh list",
|
||||
text: tr("Refresh list"),
|
||||
img: "images/Refresh-icon.png"
|
||||
},
|
||||
|
||||
"VM.create_dialog" : {
|
||||
type: "action",
|
||||
text: "+ New",
|
||||
text: tr("+ New"),
|
||||
alwaysActive: true
|
||||
},
|
||||
|
||||
"VM.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
|
||||
},
|
||||
|
||||
"VM.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
|
||||
},
|
||||
|
||||
"VM.shutdown" : {
|
||||
type: "confirm",
|
||||
text: "Shutdown",
|
||||
tip: "This will initiate the shutdown process in the selected VMs"
|
||||
text: tr("Shutdown"),
|
||||
tip: tr("This will initiate the shutdown process in the selected VMs")
|
||||
},
|
||||
|
||||
"action_list" : {
|
||||
@ -409,97 +409,97 @@ var vm_buttons = {
|
||||
actions: {
|
||||
"VM.deploy" : {
|
||||
type: "confirm_with_select",
|
||||
text: "Deploy",
|
||||
tip: "This will deploy the selected VMs on the chosen host",
|
||||
text: tr("Deploy"),
|
||||
tip: tr("This will deploy the selected VMs on the chosen host"),
|
||||
select: hosts_sel,
|
||||
condition: mustBeAdmin
|
||||
},
|
||||
"VM.migrate" : {
|
||||
type: "confirm_with_select",
|
||||
text: "Migrate",
|
||||
tip: "This will migrate the selected VMs to the chosen host",
|
||||
text: tr("Migrate"),
|
||||
tip: tr("This will migrate the selected VMs to the chosen host"),
|
||||
select: hosts_sel,
|
||||
condition: mustBeAdmin
|
||||
|
||||
},
|
||||
"VM.livemigrate" : {
|
||||
type: "confirm_with_select",
|
||||
text: "Live migrate",
|
||||
tip: "This will live-migrate the selected VMs to the chosen host",
|
||||
text: tr("Live migrate"),
|
||||
tip: tr("This will live-migrate the selected VMs to the chosen host"),
|
||||
select: hosts_sel,
|
||||
condition: mustBeAdmin
|
||||
},
|
||||
"VM.hold" : {
|
||||
type: "confirm",
|
||||
text: "Hold",
|
||||
tip: "This will hold selected pending VMs from being deployed"
|
||||
text: tr("Hold"),
|
||||
tip: tr("This will hold selected pending VMs from being deployed")
|
||||
},
|
||||
"VM.release" : {
|
||||
type: "confirm",
|
||||
text: "Release",
|
||||
tip: "This will release held machines"
|
||||
text: tr("Release"),
|
||||
tip: tr("This will release held machines")
|
||||
},
|
||||
"VM.suspend" : {
|
||||
type: "confirm",
|
||||
text: "Suspend",
|
||||
tip: "This will suspend selected machines"
|
||||
text: tr("Suspend"),
|
||||
tip: tr("This will suspend selected machines")
|
||||
},
|
||||
"VM.resume" : {
|
||||
type: "confirm",
|
||||
text: "Resume",
|
||||
tip: "This will resume selected stopped or suspended VMs"
|
||||
text: tr("Resume"),
|
||||
tip: tr("This will resume selected stopped or suspended VMs")
|
||||
},
|
||||
"VM.stop" : {
|
||||
type: "confirm",
|
||||
text: "Stop",
|
||||
text: tr("Stop"),
|
||||
tip: "This will stop selected VMs"
|
||||
},
|
||||
"VM.restart" : {
|
||||
type: "confirm",
|
||||
text: "Restart",
|
||||
tip: "This will redeploy selected VMs (in UNKNOWN or BOOT state)"
|
||||
text: tr("Restart"),
|
||||
tip: tr("This will redeploy selected VMs (in UNKNOWN or BOOT state)")
|
||||
},
|
||||
"VM.resubmit" : {
|
||||
type: "confirm",
|
||||
text: "Resubmit",
|
||||
tip: "This will resubmits VMs to PENDING state"
|
||||
text: tr("Resubmit"),
|
||||
tip: tr("This will resubmits VMs to PENDING state")
|
||||
},
|
||||
"VM.saveasmultiple" : {
|
||||
type: "action",
|
||||
text: "Save as"
|
||||
text: tr("Save as")
|
||||
},
|
||||
"VM.cancel" : {
|
||||
type: "confirm",
|
||||
text: "Cancel",
|
||||
tip: "This will cancel selected VMs"
|
||||
text: tr("Cancel"),
|
||||
tip: tr("This will cancel selected VMs")
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"VM.delete" : {
|
||||
type: "confirm",
|
||||
text: "Delete",
|
||||
tip: "This will delete the selected VMs from the database"
|
||||
text: tr("Delete"),
|
||||
tip: tr("This will delete the selected VMs from the database")
|
||||
}
|
||||
}
|
||||
|
||||
var vm_info_panel = {
|
||||
"vm_info_tab" : {
|
||||
title: "Virtual Machine information",
|
||||
title: tr("Virtual Machine information"),
|
||||
content: ""
|
||||
},
|
||||
"vm_template_tab" : {
|
||||
title: "VM template",
|
||||
title: tr("VM template"),
|
||||
content: ""
|
||||
},
|
||||
"vm_log_tab" : {
|
||||
title: "VM log",
|
||||
title: tr("VM log"),
|
||||
content: ""
|
||||
}
|
||||
}
|
||||
|
||||
var vms_tab = {
|
||||
title: "Virtual Machines",
|
||||
title: tr("Virtual Machines"),
|
||||
content: vms_tab_content,
|
||||
buttons: vm_buttons
|
||||
}
|
||||
@ -617,73 +617,73 @@ function updateVMInfo(request,vm){
|
||||
};
|
||||
|
||||
var info_tab = {
|
||||
title : "VM information",
|
||||
title : tr("VM information"),
|
||||
content:
|
||||
'<table id="info_vm_table" class="info_table">\
|
||||
<thead>\
|
||||
<tr><th colspan="2">Virtual Machine information - '+vm_info.NAME+'</th></tr>\
|
||||
<tr><th colspan="2">'+tr("Virtual Machine information")+' - '+vm_info.NAME+'</th></tr>\
|
||||
</thead>\
|
||||
<tbody>\
|
||||
<tr>\
|
||||
<td class="key_td">ID</td>\
|
||||
<td class="key_td">'+tr("ID")+'</td>\
|
||||
<td class="value_td">'+vm_info.ID+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Name</td>\
|
||||
<td class="key_td">'+tr("Name")+'</td>\
|
||||
<td class="value_td">'+vm_info.NAME+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Owner</td>\
|
||||
<td class="key_td">'+tr("Owner")+'</td>\
|
||||
<td class="value_td">'+vm_info.UNAME+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Group</td>\
|
||||
<td class="key_td">'+tr("Group")+'</td>\
|
||||
<td class="value_td">'+vm_info.GNAME+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">State</td>\
|
||||
<td class="value_td">'+vm_state+'</td>\
|
||||
<td class="key_td">'+tr("State")+'</td>\
|
||||
<td class="value_td">'+tr(vm_state)+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">LCM State</td>\
|
||||
<td class="value_td">'+OpenNebula.Helper.resource_state("vm_lcm",vm_info.LCM_STATE)+'</td>\
|
||||
<td class="key_td">'+tr("LCM State")+'</td>\
|
||||
<td class="value_td">'+tr(OpenNebula.Helper.resource_state("vm_lcm",vm_info.LCM_STATE))+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Hostname</td>\
|
||||
<td class="key_td">'+tr("Hostname")+'</td>\
|
||||
<td class="value_td">'+ hostname +'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Start time</td>\
|
||||
<td class="key_td">'+tr("Start time")+'</td>\
|
||||
<td class="value_td">'+pretty_time(vm_info.STIME)+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Deploy ID</td>\
|
||||
<td class="key_td">'+tr("Deploy ID")+'</td>\
|
||||
<td class="value_td">'+(typeof(vm_info.DEPLOY_ID) == "object" ? "-" : vm_info.DEPLOY_ID)+'</td>\
|
||||
</tr></tbody>\
|
||||
</table>\
|
||||
<table id="vm_monitoring_table" class="info_table">\
|
||||
<thead>\
|
||||
<tr><th colspan="2">Monitoring information</th></tr>\
|
||||
<tr><th colspan="2">'+tr("Monitoring information")+'</th></tr>\
|
||||
</thead>\
|
||||
<tbody>\
|
||||
<tr>\
|
||||
<td class="key_td">Net_TX</td>\
|
||||
<td class="key_td">'+tr("Net_TX")+'</td>\
|
||||
<td class="value_td">'+vm_info.NET_TX+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Net_RX</td>\
|
||||
<td class="key_td">'+tr("Net_RX")+'</td>\
|
||||
<td class="value_td">'+vm_info.NET_RX+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Used Memory</td>\
|
||||
<td class="key_td">'+tr("Used Memory")+'</td>\
|
||||
<td class="value_td">'+humanize_size(vm_info.MEMORY)+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Used CPU</td>\
|
||||
<td class="key_td">'+tr("Used CPU")+'</td>\
|
||||
<td class="value_td">'+vm_info.CPU+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">VNC Session</td>\
|
||||
<td class="key_td">'+tr("VNC Session")+'</td>\
|
||||
<td class="value_td">'+vncIcon(vm_info)+'</td>\
|
||||
</tr>\
|
||||
</tbody>\
|
||||
@ -691,21 +691,21 @@ function updateVMInfo(request,vm){
|
||||
}
|
||||
|
||||
var template_tab = {
|
||||
title: "VM Template",
|
||||
title: tr("VM Template"),
|
||||
content:
|
||||
'<table id="vm_template_table" class="info_table" style="width:80%">\
|
||||
<thead><tr><th colspan="2">VM template</th></tr></thead>'+
|
||||
<thead><tr><th colspan="2">'+tr("VM template")+'</th></tr></thead>'+
|
||||
prettyPrintJSON(vm_info.TEMPLATE)+
|
||||
'</table>'
|
||||
}
|
||||
|
||||
var log_tab = {
|
||||
title: "VM log",
|
||||
title: tr("VM log"),
|
||||
content: '<div>'+spinner+'</div>'
|
||||
}
|
||||
|
||||
var monitoring_tab = {
|
||||
title: "Monitoring information",
|
||||
title: tr("Monitoring information"),
|
||||
content: generateMonitoringDivs(vm_graphs,"vm_monitor_")
|
||||
}
|
||||
|
||||
@ -726,7 +726,7 @@ function updateVMInfo(request,vm){
|
||||
// which is a lot.
|
||||
function setupCreateVMDialog(){
|
||||
|
||||
dialogs_context.append('<div title="Create Virtual Machine" id="create_vm_dialog"></div>');
|
||||
dialogs_context.append('<div title=\"'+tr("Create Virtual Machine")+'\" id="create_vm_dialog"></div>');
|
||||
//Insert HTML in place
|
||||
$create_vm_dialog = $('#create_vm_dialog')
|
||||
var dialog = $create_vm_dialog;
|
||||
@ -748,7 +748,7 @@ function setupCreateVMDialog(){
|
||||
var n_times_int=1;
|
||||
|
||||
if (!template_id.length){
|
||||
notifyError("You have not selected a template");
|
||||
notifyError(tr("You have not selected a template"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -781,7 +781,7 @@ function popUpCreateVMDialog(){
|
||||
//Prepares a dialog to saveas a VM
|
||||
function setupSaveasDialog(){
|
||||
//Append to DOM
|
||||
dialogs_context.append('<div id="saveas_vm_dialog" title="VM Save As"></div>');
|
||||
dialogs_context.append('<div id="saveas_vm_dialog" title=\"'+tr("VM Save As")+'\"></div>');
|
||||
$saveas_vm_dialog = $('#saveas_vm_dialog',dialogs_context);
|
||||
var dialog = $saveas_vm_dialog;
|
||||
|
||||
@ -791,8 +791,8 @@ function setupSaveasDialog(){
|
||||
<div id="saveas_tabs">\
|
||||
</div>\
|
||||
<div class="form_buttons">\
|
||||
<button id="vm_saveas_proceed" value="">OK</button>\
|
||||
<button id="vm_saveas_cancel" value="">Cancel</button>\
|
||||
<button id="vm_saveas_proceed" value="">'+tr("OK")+'</button>\
|
||||
<button id="vm_saveas_cancel" value="">'+tr("Cancel")+'</button>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
</form>');
|
||||
@ -815,8 +815,8 @@ function setupSaveasDialog(){
|
||||
var type = $('#image_type',this).val();
|
||||
|
||||
if (!id.length || !disk_id.length || !image_name.length) {
|
||||
notifyError("Skipping VM "+id+
|
||||
". 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 = '<li><a href="#saveas_tab_'+this+'">VM '+this+'</a></li>'
|
||||
$('#saveas_tabs ul',dialog).append(li);
|
||||
var tab = '<div class="saveas_tab" id="saveas_tab_'+this+'">\
|
||||
<div id="vm_id_text">Saveas for VM with ID <span id="vm_id">'+this+'</span></div>\
|
||||
<div id="vm_id_text">'+tr('Saveas for VM with ID')+' <span id="vm_id">'+this+'</span></div>\
|
||||
<fieldset>\
|
||||
<div>\
|
||||
<label for="vm_disk_id">Select disk:</label>\
|
||||
<label for="vm_disk_id">'+tr('Select disk')+':</label>\
|
||||
<select id="vm_disk_id" name="vm_disk_id">\
|
||||
<option value="">Retrieving...</option>\
|
||||
<option value="">'+tr('Retrieving')+'...</option>\
|
||||
</select>\
|
||||
</div>\
|
||||
<div>\
|
||||
<label for="image_name">Image name:</label>\
|
||||
<label for="image_name">'+tr('Image name')+':</label>\
|
||||
<input type="text" id="image_name" name="image_name" value="" />\
|
||||
</div>\
|
||||
<div>\
|
||||
<label for="img_attr_value">Type:</label>\
|
||||
<label for="img_attr_value">'+tr('Type')+':</label>\
|
||||
<select id="image_type" name="image_type">\
|
||||
<option value="">Default (current image type)</option>\
|
||||
<option value="os">OS</option>\
|
||||
<option value="datablock">Datablock</option>\
|
||||
<option value="cdrom">CD-ROM</option>\
|
||||
<option value="">'+tr('Default (current image type)')+'</option>\
|
||||
<option value="os">'+tr('OS')+'</option>\
|
||||
<option value="datablock">'+tr('Datablock')+'</option>\
|
||||
<option value="cdrom">'+tr('CD-ROM')+'</option>\
|
||||
</select>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
@ -891,15 +891,15 @@ function saveasDisksCallback(req,response){
|
||||
|
||||
var gen_option = function(id, name, source){
|
||||
if (name){
|
||||
return '<option value="'+id+'">'+name+' (disk id: '+id+')</option>';
|
||||
return '<option value="'+id+'">'+name+" ("+tr("(disk id")+"): "+id+')</option>';
|
||||
}
|
||||
else {
|
||||
return '<option value="'+id+'">'+source+' (disk id: '+id+')</option>';
|
||||
return '<option value="'+id+'">'+source+" ("+tr("disk id")+"): "+id+')</option>';
|
||||
}
|
||||
}
|
||||
|
||||
var disks = vm_info.TEMPLATE.DISK;
|
||||
if (!disks) { select = '<option value="">No disks defined</option>';}
|
||||
if (!disks) { select = '<option value="">'+tr("No disks defined")+'</option>';}
|
||||
else if (disks.constructor == Array) //several disks
|
||||
{
|
||||
for (var i=0;i<disks.length;i++){
|
||||
@ -963,14 +963,14 @@ function updateVNCState(rfb, state, oldstate, msg) {
|
||||
function setupVNC(){
|
||||
|
||||
//Append to DOM
|
||||
dialogs_context.append('<div id="vnc_dialog" title="VNC connection"></div>');
|
||||
dialogs_context.append('<div id="vnc_dialog" title=\"'+tr("VNC connection")+'\"></div>');
|
||||
$vnc_dialog = $('#vnc_dialog',dialogs_context);
|
||||
var dialog = $vnc_dialog;
|
||||
|
||||
dialog.html('\
|
||||
<div id="VNC_status_bar" class="VNC_status_bar" style="margin-top: 0px;">\
|
||||
<table border=0 width="100%"><tr>\
|
||||
<td><div id="VNC_status">Loading</div></td>\
|
||||
<td><div id="VNC_status">'+tr("Loading")+'</div></td>\
|
||||
<td width="1%"><div id="VNC_buttons">\
|
||||
<input type=button value="Send CtrlAltDel"\
|
||||
id="sendCtrlAltDelButton">\
|
||||
@ -978,7 +978,7 @@ function setupVNC(){
|
||||
</tr></table>\
|
||||
</div>\
|
||||
<canvas id="VNC_canvas" width="640px" height="20px">\
|
||||
Canvas not supported.\
|
||||
'+tr("Canvas not supported.")+'\
|
||||
</canvas>\
|
||||
');
|
||||
|
||||
@ -1040,10 +1040,10 @@ function vncIcon(vm){
|
||||
var gr_icon;
|
||||
if (graphics && graphics.TYPE == "vnc" && state == "RUNNING"){
|
||||
gr_icon = '<a class="vnc" href="#" vm_id="'+vm.ID+'">';
|
||||
gr_icon += '<img src="images/vnc_on.png" alt="Open VNC Session" /></a>';
|
||||
gr_icon += '<img src="images/vnc_on.png" alt=\"'+tr("Open VNC Session")+'\" /></a>';
|
||||
}
|
||||
else {
|
||||
gr_icon = '<img src="images/vnc_off.png" alt="VNC Disabled" />';
|
||||
gr_icon = '<img src="images/vnc_off.png" alt=\"'+tr("VNC Disabled")+'\" />';
|
||||
}
|
||||
return gr_icon;
|
||||
}
|
||||
@ -1071,7 +1071,11 @@ $(document).ready(function(){
|
||||
{ "sWidth": "35px", "aTargets": [1,10] },
|
||||
{ "sWidth": "150px", "aTargets": [5,9] },
|
||||
{ "sWidth": "100px", "aTargets": [2,3] }
|
||||
]
|
||||
],
|
||||
"oLanguage": (datatable_lang != "") ?
|
||||
{
|
||||
sUrl: "locale/"+lang+"/"+datatable_lang
|
||||
} : ""
|
||||
});
|
||||
|
||||
dataTable_vMachines.fnClearTable();
|
||||
|
@ -23,15 +23,15 @@ var vnets_tab_content =
|
||||
<table id="datatable_vnetworks" class="display">\
|
||||
<thead>\
|
||||
<tr>\
|
||||
<th class="check"><input type="checkbox" class="check_all" value="">All</input></th>\
|
||||
<th>ID</th>\
|
||||
<th>Owner</th>\
|
||||
<th>Group</th>\
|
||||
<th>Name</th>\
|
||||
<th>Type</th>\
|
||||
<th>Bridge</th>\
|
||||
<th>Public</th>\
|
||||
<th>Total Leases</th>\
|
||||
<th class="check"><input type="checkbox" class="check_all" value="">'+tr("All")+'</input></th>\
|
||||
<th>'+tr("ID")+'</th>\
|
||||
<th>'+tr("Owner")+'</th>\
|
||||
<th>'+tr("Group")+'</th>\
|
||||
<th>'+tr("Name")+'</th>\
|
||||
<th>'+tr("Type")+'</th>\
|
||||
<th>'+tr("Bridge")+'</th>\
|
||||
<th>'+tr("Public")+'</th>\
|
||||
<th>'+tr("Total Leases")+'</th>\
|
||||
</tr>\
|
||||
</thead>\
|
||||
<tbody id="tbodyvnetworks">\
|
||||
@ -42,40 +42,40 @@ var vnets_tab_content =
|
||||
var create_vn_tmpl =
|
||||
'<div id="vn_tabs">\
|
||||
<ul>\
|
||||
<li><a href="#easy">Wizard</a></li>\
|
||||
<li><a href="#manual">Advanced mode</a></li>\
|
||||
<li><a href="#easy">'+tr("Wizard")+'</a></li>\
|
||||
<li><a href="#manual">'+tr("Advanced mode")+'</a></li>\
|
||||
</ul>\
|
||||
<div id="easy">\
|
||||
<form id="create_vn_form_easy" action="">\
|
||||
<fieldset>\
|
||||
<label for="name">Name:</label>\
|
||||
<label for="name">'+tr("Name")+':</label>\
|
||||
<input type="text" name="name" id="name" /><br />\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<label for="bridge">Bridge:</label>\
|
||||
<label for="bridge">'+tr("Bridge")+':</label>\
|
||||
<input type="text" name="bridge" id="bridge" /><br />\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<label style="height:2em;">Network type:</label>\
|
||||
<input type="radio" name="fixed_ranged" id="fixed_check" value="fixed" checked="checked">Fixed network</input><br />\
|
||||
<input type="radio" name="fixed_ranged" id="ranged_check" value="ranged">Ranged network</input><br />\
|
||||
<label style="height:2em;">'+tr("Network type:")+'</label>\
|
||||
<input type="radio" name="fixed_ranged" id="fixed_check" value="fixed" checked="checked">'+tr("Fixed network")+'</input><br />\
|
||||
<input type="radio" name="fixed_ranged" id="ranged_check" value="ranged">'+tr("Ranged network")+'</input><br />\
|
||||
</fieldset>\
|
||||
<div class="clear"></div>\
|
||||
<div id="easy_tabs">\
|
||||
<div id="fixed">\
|
||||
<fieldset>\
|
||||
<label for="leaseip">Lease IP:</label>\
|
||||
<label for="leaseip">'+tr("Lease IP:")+'</label>\
|
||||
<input type="text" name="leaseip" id="leaseip" /><br />\
|
||||
<label for="leasemac">Lease MAC (opt):</label>\
|
||||
<label for="leasemac">'+tr("Lease MAC (opt):")+'</label>\
|
||||
<input type="text" name="leasemac" id="leasemac" />\
|
||||
<div class="clear"></div>\
|
||||
<button class="add_remove_button add_button" id="add_lease" value="add/lease">\
|
||||
Add\
|
||||
'+tr("Add")+'\
|
||||
</button>\
|
||||
<button class="add_remove_button" id="remove_lease" value="remove/lease">\
|
||||
Remove selected\
|
||||
'+tr("Remove selected")+'\
|
||||
</button>\
|
||||
<label for="leases">Current leases:</label>\
|
||||
<label for="leases">'+tr("Current leases:")+'</label>\
|
||||
<select id="leases" name="leases" style="height:10em;" multiple>\
|
||||
<!-- insert leases -->\
|
||||
</select><br />\
|
||||
@ -83,9 +83,9 @@ var create_vn_tmpl =
|
||||
</div>\
|
||||
<div id="ranged">\
|
||||
<fieldset>\
|
||||
<label for="net_address">Network Address:</label>\
|
||||
<label for="net_address">'+tr("Network Address:")+'</label>\
|
||||
<input type="text" name="net_address" id="net_address" /><br />\
|
||||
<label for="net_size">Network size:</label>\
|
||||
<label for="net_size">'+tr("Network size:")+'</label>\
|
||||
<input type="text" name="net_size" id="net_size" />\
|
||||
</fieldset>\
|
||||
</div>\
|
||||
@ -94,14 +94,14 @@ var create_vn_tmpl =
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<div class="">\
|
||||
<label for="custom_var_vnet_name">Name:</label>\
|
||||
<label for="custom_var_vnet_name">'+tr('Name')+':</label>\
|
||||
<input type="text" id="custom_var_vnet_name" name="custom_var_vnet_name" />\
|
||||
<label for="custom_var_vnet_value">Value:</label>\
|
||||
<label for="custom_var_vnet_value">'+tr('Value')+':</label>\
|
||||
<input type="text" id="custom_var_vnet_value" name="custom_var_vnet_value" />\
|
||||
<button class="add_remove_button add_button" id="add_custom_var_vnet_button" value="add_custom_vnet_var">Add</button>\
|
||||
<button class="add_remove_button" id="remove_custom_var_vnet_button" value="remove_custom_vnet_var">Remove selected</button>\
|
||||
<button class="add_remove_button add_button" id="add_custom_var_vnet_button" value="add_custom_vnet_var">'+tr('Add')+'</button>\
|
||||
<button class="add_remove_button" id="remove_custom_var_vnet_button" value="remove_custom_vnet_var">'+tr('Remove selected')+'</button>\
|
||||
<div class="clear"></div>\
|
||||
<label for="custom_var_vnet_box">Custom attributes:</label>\
|
||||
<label for="custom_var_vnet_box">'+tr('Custom attributes')+':</label>\
|
||||
<select id="custom_var_vnet_box" name="custom_var_vnet_box" style="height:100px;" multiple>\
|
||||
</select>\
|
||||
</div>\
|
||||
@ -109,16 +109,16 @@ var create_vn_tmpl =
|
||||
<fieldset>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button" id="create_vn_submit_easy" value="vn/create">\
|
||||
Create\
|
||||
'+tr("Create")+'\
|
||||
</button>\
|
||||
<button class="button" type="reset" value="reset">Reset</button>\
|
||||
<button class="button" type="reset" value="reset">'+tr("Reset")+'</button>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
</form>\
|
||||
</div>\
|
||||
<div id="manual">\
|
||||
<form id="create_vn_form_manual" action="">\
|
||||
<h3 style="margin-bottom:10px;">Write the Virtual Network template here</h3>\
|
||||
<h3 style="margin-bottom:10px;">'+tr("Write the Virtual Network template here")+'</h3>\
|
||||
<fieldset style="border-top:none;">\
|
||||
<textarea id="template" rows="15" style="width:100%;"></textarea>\
|
||||
<div class="clear"></div>\
|
||||
@ -126,9 +126,9 @@ var create_vn_tmpl =
|
||||
<fieldset>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button" id="create_vn_submit_manual" value="vn/create">\
|
||||
Create\
|
||||
'+tr("Create")+'\
|
||||
</button>\
|
||||
<button class="button" type="reset" value="reset">Reset</button>\
|
||||
<button class="button" type="reset" value="reset">'+tr("Reset")+'</button>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
</form>\
|
||||
@ -137,23 +137,23 @@ var create_vn_tmpl =
|
||||
|
||||
var update_vnet_tmpl =
|
||||
'<form action="javascript:alert(\'js error!\');">\
|
||||
<h3 style="margin-bottom:10px;">Please, choose and modify the virtual network you want to update:</h3>\
|
||||
<h3 style="margin-bottom:10px;">'+tr('Please, choose and modify the virtual network you want to update')+':</h3>\
|
||||
<fieldset style="border-top:none;">\
|
||||
<label for="vnet_template_update_select">Select a network:</label>\
|
||||
<label for="vnet_template_update_select">'+tr('Select a network')+':</label>\
|
||||
<select id="vnet_template_update_select" name="vnet_template_update_select"></select>\
|
||||
<div class="clear"></div>\
|
||||
<div>\
|
||||
<label for="vnet_template_update_public">Public:</label>\
|
||||
<label for="vnet_template_update_public">'+tr('Public')+':</label>\
|
||||
<input type="checkbox" name="vnet_template_update_public" id="vnet_template_update_public" />\
|
||||
</div>\
|
||||
<label for="vnet_template_update_textarea">Template:</label>\
|
||||
<label for="vnet_template_update_textarea">'+tr('Template')+':</label>\
|
||||
<div class="clear"></div>\
|
||||
<textarea id="vnet_template_update_textarea" style="width:100%; height:14em;"></textarea>\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button" id="vnet_template_update_button" value="Network.update_template">\
|
||||
Update\
|
||||
'+tr('Update')+'\
|
||||
</button>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
@ -328,36 +328,36 @@ var vnet_actions = {
|
||||
var vnet_buttons = {
|
||||
"Network.refresh" : {
|
||||
type: "image",
|
||||
text: "Refresh list",
|
||||
text: tr("Refresh list"),
|
||||
img: "images/Refresh-icon.png"
|
||||
},
|
||||
|
||||
"Network.create_dialog" : {
|
||||
type: "create_dialog",
|
||||
text: "+ New"
|
||||
text: tr("+ New")
|
||||
},
|
||||
|
||||
"Network.update_dialog" : {
|
||||
type: "action",
|
||||
text: "Update a template",
|
||||
text: tr("Update a template"),
|
||||
alwaysActive: true
|
||||
},
|
||||
|
||||
"Network.publish" : {
|
||||
type: "action",
|
||||
text: "Publish"
|
||||
text: tr("Publish")
|
||||
},
|
||||
|
||||
"Network.unpublish" : {
|
||||
type: "action",
|
||||
text: "Unpublish"
|
||||
text: tr("Unpublish")
|
||||
},
|
||||
|
||||
"Network.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
|
||||
},
|
||||
|
||||
@ -365,7 +365,7 @@ var vnet_buttons = {
|
||||
type: "confirm_with_select",
|
||||
text: "Change group",
|
||||
select: groups_sel,
|
||||
tip: "Select the new group:",
|
||||
tip: tr("Select the new group")+":",
|
||||
condition: mustBeAdmin,
|
||||
},
|
||||
|
||||
@ -374,34 +374,34 @@ var vnet_buttons = {
|
||||
actions: {
|
||||
"Network.addleases_dialog" : {
|
||||
type: "action",
|
||||
text: "Add lease"
|
||||
text: tr("Add lease")
|
||||
},
|
||||
"Network.rmleases_dialog" : {
|
||||
type: "action",
|
||||
text: "Remove lease"
|
||||
text: tr("Remove lease")
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"Network.delete" : {
|
||||
type: "action",
|
||||
text: "Delete"
|
||||
text: tr("Delete")
|
||||
}
|
||||
}
|
||||
|
||||
var vnet_info_panel = {
|
||||
"vnet_info_tab" : {
|
||||
title: "Virtual network information",
|
||||
title: tr("Virtual network information"),
|
||||
content: ""
|
||||
},
|
||||
"vnet_template_tab" : {
|
||||
title: "Virtual network template",
|
||||
title: tr("Virtual network template"),
|
||||
content: ""
|
||||
}
|
||||
}
|
||||
|
||||
var vnets_tab = {
|
||||
title: "Virtual Networks",
|
||||
title: tr("Virtual Networks"),
|
||||
content: vnets_tab_content,
|
||||
buttons: vnet_buttons
|
||||
}
|
||||
@ -488,32 +488,32 @@ function updateVNetworkInfo(request,vn){
|
||||
var info_tab_content =
|
||||
'<table id="info_vn_table" class="info_table">\
|
||||
<thead>\
|
||||
<tr><th colspan="2">Virtual Network '+vn_info.ID+' information</th></tr>\
|
||||
<tr><th colspan="2">'+tr('Virtual Network')+' '+vn_info.ID+' '+tr('information')+'</th></tr>\
|
||||
</thead>\
|
||||
<tr>\
|
||||
<td class="key_td">ID</td>\
|
||||
<td class="key_td">'+tr('ID')+'</td>\
|
||||
<td class="value_td">'+vn_info.ID+'</td>\
|
||||
<tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Owner</td>\
|
||||
<td class="key_td">'+tr('Owner')+'</td>\
|
||||
<td class="value_td">'+vn_info.UNAME+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Group</td>\
|
||||
<td class="key_td">'+tr('Group')+'</td>\
|
||||
<td class="value_td">'+vn_info.GNAME+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Public</td>\
|
||||
<td class="key_td">'+tr('Public')+'</td>\
|
||||
<td class="value_td">'+(parseInt(vn_info.PUBLIC) ? "yes" : "no" )+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">Physical device</td>\
|
||||
<td class="key_td">'+tr('Physical device')+'</td>\
|
||||
<td class="value_td">'+(vn_info.PHYDEV ? vn_info.PHYDEV : "--" )+'</td>\
|
||||
</tr>\
|
||||
</table>\
|
||||
<table id="vn_leases_info_table" class="info_table">\
|
||||
<thead>\
|
||||
<tr><th colspan="2">Leases information</th></tr>\
|
||||
<tr><th colspan="2">'+tr('Leases information')+'</th></tr>\
|
||||
</thead>'+
|
||||
printLeases(vn_info.LEASES)+
|
||||
'</table>';;
|
||||
@ -521,15 +521,15 @@ function updateVNetworkInfo(request,vn){
|
||||
|
||||
|
||||
var info_tab = {
|
||||
title: "Virtual Network information",
|
||||
title: tr("Virtual Network information"),
|
||||
content: info_tab_content
|
||||
}
|
||||
|
||||
var template_tab = {
|
||||
title: "Virtual Network template",
|
||||
title: tr("Virtual Network template"),
|
||||
content:
|
||||
'<table id="vn_template_table" class="info_table" style="width:80%">\
|
||||
<thead><tr><th colspan="2">Virtual Network template</th></tr></thead>'+
|
||||
<thead><tr><th colspan="2">'+tr("Virtual Network template")+'</th></tr></thead>'+
|
||||
prettyPrintJSON(vn_info.TEMPLATE)+
|
||||
'</table>'
|
||||
}
|
||||
@ -558,7 +558,7 @@ function printLeases(leases){
|
||||
|
||||
//Prepares the vnet creation dialog
|
||||
function setupCreateVNetDialog() {
|
||||
dialogs_context.append('<div title="Create Virtual Network" id="create_vn_dialog"></div>');
|
||||
dialogs_context.append('<div title=\"'+tr("Create Virtual Network")+'\" id="create_vn_dialog"></div>');
|
||||
$create_vn_dialog = $('#create_vn_dialog',dialogs_context)
|
||||
var dialog = $create_vn_dialog;
|
||||
dialog.html(create_vn_tmpl);
|
||||
@ -597,7 +597,7 @@ function setupCreateVNetDialog() {
|
||||
|
||||
//We don't add anything to the list if there is nothing to add
|
||||
if (lease_ip == null) {
|
||||
notifyError("Please provide a lease IP");
|
||||
notifyError(tr("Please provide a lease IP"));
|
||||
return false;
|
||||
};
|
||||
|
||||
@ -652,7 +652,7 @@ function setupCreateVNetDialog() {
|
||||
//Fetch values
|
||||
var name = $('#name',this).val();
|
||||
if (!name.length){
|
||||
notifyError("Virtual Network name missing!");
|
||||
notifyError(tr("Virtual Network name missing!"));
|
||||
return false;
|
||||
}
|
||||
var bridge = $('#bridge',this).val();
|
||||
@ -683,7 +683,7 @@ function setupCreateVNetDialog() {
|
||||
var network_addr = $('#net_address',this).val();
|
||||
var network_size = $('#net_size',this).val();
|
||||
if (!network_addr.length){
|
||||
notifyError("Please provide a network address");
|
||||
notifyError(tr("Please provide a network address"));
|
||||
return false;
|
||||
};
|
||||
|
||||
@ -728,7 +728,7 @@ function popUpCreateVnetDialog() {
|
||||
|
||||
function setupVNetTemplateUpdateDialog(){
|
||||
//Append to DOM
|
||||
dialogs_context.append('<div id="vnet_template_update_dialog" title="Update network template"></div>');
|
||||
dialogs_context.append('<div id="vnet_template_update_dialog" title="'+tr('Update network template')+'"></div>');
|
||||
var dialog = $('#vnet_template_update_dialog',dialogs_context);
|
||||
|
||||
//Put HTML in place
|
||||
@ -749,7 +749,7 @@ function setupVNetTemplateUpdateDialog(){
|
||||
var id = $(this).val();
|
||||
if (id && id.length){
|
||||
var dialog = $('#vnet_template_update_dialog');
|
||||
$('#vnet_template_update_textarea',dialog).val("Loading...");
|
||||
$('#vnet_template_update_textarea',dialog).val(tr("Loading")+"...");
|
||||
|
||||
var vnet_public = is_public_vnet(id);
|
||||
|
||||
@ -827,7 +827,7 @@ function popUpVNetTemplateUpdateDialog(){
|
||||
}
|
||||
|
||||
function setupAddRemoveLeaseDialog() {
|
||||
dialogs_context.append('<div title="Lease management" id="lease_vn_dialog"></div>');
|
||||
dialogs_context.append('<div title="'+tr('Lease management')+'" id="lease_vn_dialog"></div>');
|
||||
$lease_vn_dialog = $('#lease_vn_dialog',dialogs_context)
|
||||
|
||||
var dialog = $lease_vn_dialog;
|
||||
@ -835,17 +835,17 @@ function setupAddRemoveLeaseDialog() {
|
||||
dialog.html(
|
||||
'<form id="lease_vn_form" action="javascript:alert(\'js error!\');">\
|
||||
<fieldset>\
|
||||
<div>Please specify:</div>\
|
||||
<label for="add_lease_ip">Lease IP:</label>\
|
||||
<div>'+tr("Please specify:")+'</div>\
|
||||
<label for="add_lease_ip">'+tr("Lease IP:")+'</label>\
|
||||
<input type="text" name="add_lease_ip" id="add_lease_ip" /><br />\
|
||||
<label id="add_lease_mac_label" for="add_lease_mac">Lease MAC:</label>\
|
||||
<label id="add_lease_mac_label" for="add_lease_mac">'+tr("Lease MAC:")+'</label>\
|
||||
<input type="text" name="add_lease_mac" id="add_lease_mac" />\
|
||||
</select>\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<div class="form_buttons">\
|
||||
<button id="lease_vn_proceed" class="" value="">OK</button>\
|
||||
<button class="confirm_cancel" value="">Cancel</button>\
|
||||
<button id="lease_vn_proceed" class="" value="">'+tr("OK")+'</button>\
|
||||
<button class="confirm_cancel" value="">'+tr("Cancel")+'</button>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
</form>'
|
||||
@ -878,7 +878,7 @@ function setupAddRemoveLeaseDialog() {
|
||||
}
|
||||
|
||||
function popUpAddLeaseDialog() {
|
||||
$lease_vn_dialog.dialog("option","title","Add lease");
|
||||
$lease_vn_dialog.dialog("option","title",tr("Add lease"));
|
||||
$('#add_lease_mac',$lease_vn_dialog).show();
|
||||
$('#add_lease_mac_label',$lease_vn_dialog).show();
|
||||
$('#lease_vn_proceed',$lease_vn_dialog).val("Network.addleases");
|
||||
@ -886,7 +886,7 @@ function popUpAddLeaseDialog() {
|
||||
}
|
||||
|
||||
function popUpRemoveLeaseDialog() {
|
||||
$lease_vn_dialog.dialog("option","title","Remove lease");
|
||||
$lease_vn_dialog.dialog("option","title",tr("Remove lease"));
|
||||
$('#add_lease_mac',$lease_vn_dialog).hide();
|
||||
$('#add_lease_mac_label',$lease_vn_dialog).hide();
|
||||
$('#lease_vn_proceed',$lease_vn_dialog).val("Network.rmleases");
|
||||
@ -935,7 +935,11 @@ $(document).ready(function(){
|
||||
{ "sWidth": "60px", "aTargets": [0,5,6,7,8] },
|
||||
{ "sWidth": "35px", "aTargets": [1] },
|
||||
{ "sWidth": "100px", "aTargets": [2,3] }
|
||||
]
|
||||
],
|
||||
"oLanguage": (datatable_lang != "") ?
|
||||
{
|
||||
sUrl: "locale/"+lang+"/"+datatable_lang
|
||||
} : ""
|
||||
});
|
||||
|
||||
dataTable_vNetworks.fnClearTable();
|
||||
|
@ -186,10 +186,12 @@ function stringJSON(json){
|
||||
function notifySubmit(action, args, extra_param){
|
||||
var action_text = action.replace(/OpenNebula\./,'').replace(/\./,' ');
|
||||
|
||||
var msg = "<h1>Submitted</h1>";
|
||||
var msg = '<h1>'+tr("Submitted")+'</h1>';
|
||||
if (!args || (typeof args == 'object' && args.constructor != Array)){
|
||||
|
||||
msg += action_text;
|
||||
} else {
|
||||
|
||||
msg += action_text + ": " + args;
|
||||
};
|
||||
if (extra_param && extra_param.constructor != Object) {
|
||||
@ -201,13 +203,13 @@ function notifySubmit(action, args, extra_param){
|
||||
|
||||
//Notification on error
|
||||
function notifyError(msg){
|
||||
msg = "<h1>Error</h1>" + msg;
|
||||
msg = "<h1>"+tr("Error")+"</h1>" + msg;
|
||||
$.jGrowl(msg, {theme: "jGrowl-notify-error", position: "bottom-right", sticky: true });
|
||||
}
|
||||
|
||||
//Standard notification
|
||||
function notifyMessage(msg){
|
||||
msg = "<h1>Info</h1>" + msg;
|
||||
msg = "<h1>"+tr("Info")+"</h1>" + msg;
|
||||
$.jGrowl(msg, {theme: "jGrowl-notify-submit", position: "bottom-right"});
|
||||
}
|
||||
|
||||
@ -248,7 +250,7 @@ function prettyPrintRowJSON(field,value,padding,weight, border_bottom,padding_to
|
||||
border-bottom:'+border_bottom+';\
|
||||
padding-top:'+padding_top_bottom+'px;\
|
||||
padding-bottom:'+padding_top_bottom+'px;">'
|
||||
+field+
|
||||
+tr(field)+
|
||||
'</td>\
|
||||
<td class="value_td" style=\
|
||||
"border-bottom:'+border_bottom+';\
|
||||
@ -275,7 +277,7 @@ function prettyPrintRowJSON(field,value,padding,weight, border_bottom,padding_to
|
||||
border-bottom:'+border_bottom+';\
|
||||
padding-top:'+padding_top_bottom+'px;\
|
||||
padding-bottom:'+padding_top_bottom+'px">'+
|
||||
field+
|
||||
tr(field)+
|
||||
'</td>\
|
||||
<td class="value_td" style="\
|
||||
border-bottom:'+border_bottom+';\
|
||||
@ -332,7 +334,7 @@ function onError(request,error_json) {
|
||||
|
||||
if (!message){
|
||||
if (!onError.disabled){
|
||||
notifyError("Cannot contact server: is it running and reachable?");
|
||||
notifyError(tr("Cannot contact server: is it running and reachable?"));
|
||||
onError.disabled=true;
|
||||
}
|
||||
return false;
|
||||
@ -340,7 +342,7 @@ function onError(request,error_json) {
|
||||
|
||||
if (message.match(/^Network is unreachable .+$/)){
|
||||
if (!onError.disabled){
|
||||
notifyError("Network is unreachable: is OpenNebula running?");
|
||||
notifyError(tr("Network is unreachable: is OpenNebula running?"));
|
||||
onError.disabled=true;
|
||||
};
|
||||
return false;
|
||||
@ -361,7 +363,7 @@ function onError(request,error_json) {
|
||||
} else if (m = message.match(auth_error)) {
|
||||
method = m[1];
|
||||
object = m[3];
|
||||
reason = "Unauthorized";
|
||||
reason = tr("Unauthorized");
|
||||
};
|
||||
|
||||
if (m) {
|
||||
@ -498,7 +500,7 @@ function makeSelectOptions(dataTable,
|
||||
status_cols,
|
||||
bad_status_values){
|
||||
var nodes = dataTable.fnGetData();
|
||||
var select = '<option class="empty_value" value="">Please select</option>';
|
||||
var select = '<option class="empty_value" value="">'+tr("Please select")+'</option>';
|
||||
var array;
|
||||
for (var j=0; j<nodes.length;j++){
|
||||
var elem = nodes[j];
|
||||
@ -632,23 +634,23 @@ function shortenedInfoFields(context){
|
||||
function setupTemplateUpdateDialog(){
|
||||
|
||||
//Append to DOM
|
||||
dialogs_context.append('<div id="template_update_dialog" title="Update template"></div>');
|
||||
dialogs_context.append('<div id="template_update_dialog" title=\"'+tr("Update template")+'"></div>');
|
||||
var dialog = $('#template_update_dialog',dialogs_context);
|
||||
|
||||
//Put HTML in place
|
||||
dialog.html(
|
||||
'<form action="javascript:alert(\'js error!\');">\
|
||||
<h3 style="margin-bottom:10px;">Please, choose and modify the template you want to update:</h3>\
|
||||
<h3 style="margin-bottom:10px;">'+tr("Please, choose and modify the template you want to update:")+'</h3>\
|
||||
<fieldset style="border-top:none;">\
|
||||
<label for="template_update_select">Select a template:</label>\
|
||||
<label for="template_update_select">'+tr("Select a template")+':</label>\
|
||||
<select id="template_update_select" name="template_update_select"></select>\
|
||||
<div class="clear"></div>\
|
||||
<textarea id="template_update_textarea" style="width:100%; height:14em;">Select a template</textarea>\
|
||||
<textarea id="template_update_textarea" style="width:100%; height:14em;">'+tr("Select a template")+'</textarea>\
|
||||
</fieldset>\
|
||||
<fieldset>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button" id="template_update_button" value="">\
|
||||
Update\
|
||||
'+tr("Update")+'\
|
||||
</button>\
|
||||
</div>\
|
||||
</fieldset>\
|
||||
@ -706,7 +708,7 @@ function popUpTemplateUpdateDialog(elem_str,select_items,sel_elems){
|
||||
|
||||
if (sel_elems.length >= 1){ //several items in the list are selected
|
||||
//grep them
|
||||
var new_select= sel_elems.length > 1? '<option value="">Please select</option>' : "";
|
||||
var new_select= sel_elems.length > 1? '<option value="">'+tr("Please select")+'</option>' : "";
|
||||
$('option','<select>'+select_items+'</select>').each(function(){
|
||||
var val = $(this).val();
|
||||
if ($.inArray(val,sel_elems) >= 0){
|
||||
|
@ -549,7 +549,7 @@ function initListButtons(){
|
||||
$('.multi_action_slct',main_tabs_context).each(function(){
|
||||
//prepare replacement buttons
|
||||
var buttonset = $('<div style="display:inline-block;" class="top_button"></div');
|
||||
var button1 = $('<button class="last_action_button action_button confirm_button confirm_with_select_button" value="">Previous action</button>').button();
|
||||
var button1 = $('<button class="last_action_button action_button confirm_button confirm_with_select_button" value="">'+tr('Previous action')+'</button>').button();
|
||||
button1.attr("disabled","disabled");
|
||||
var button2 = $('<button class="list_button" value="">See more</button>').button({
|
||||
text:false,
|
||||
@ -612,19 +612,19 @@ function initListButtons(){
|
||||
|
||||
//Prepares the standard confirm dialogs
|
||||
function setupConfirmDialogs(){
|
||||
dialogs_context.append('<div id="confirm_dialog" title="Confirmation of action"></div>');
|
||||
dialogs_context.append('<div id="confirm_dialog" title=\"'+tr("Confirmation of action")+'\"></div>');
|
||||
var dialog = $('div#confirm_dialog',dialogs_context);
|
||||
|
||||
//add the HTML with the standard question and buttons.
|
||||
dialog.html(
|
||||
'<form action="javascript:alert(\'js error!\');">\
|
||||
<div id="confirm_tip">You have to confirm this action.</div>\
|
||||
<div id="confirm_tip">'+tr("You have to confirm this action.")+'</div>\
|
||||
<br />\
|
||||
<div id="question">Do you want to proceed?</div>\
|
||||
<div id="question">'+tr("Do you want to proceed?")+'</div>\
|
||||
<br />\
|
||||
<div class="form_buttons">\
|
||||
<button id="confirm_proceed" class="action_button" value="">OK</button>\
|
||||
<button class="confirm_cancel" value="">Cancel</button>\
|
||||
<button id="confirm_proceed" class="action_button" value="">'+tr("OK")+'</button>\
|
||||
<button class="confirm_cancel" value="">'+tr("Cancel")+'</button>\
|
||||
</div>\
|
||||
</form>');
|
||||
|
||||
@ -646,17 +646,17 @@ function setupConfirmDialogs(){
|
||||
return false;
|
||||
});
|
||||
|
||||
dialogs_context.append('<div id="confirm_with_select_dialog" title="Confirmation of action"></div>');
|
||||
dialogs_context.append('<div id="confirm_with_select_dialog" title=\"'+tr("Confirmation of action")+'\"></div>');
|
||||
dialog = $('div#confirm_with_select_dialog',dialogs_context);
|
||||
|
||||
dialog.html(
|
||||
'<form action="javascript:alert(\'js error!\');">\
|
||||
<div id="confirm_with_select_tip">You need to select something.</div>\
|
||||
<div id="confirm_with_select_tip">'+tr("You need to select something.")+'</div>\
|
||||
<select style="margin: 10px 0;" id="confirm_select">\
|
||||
</select>\
|
||||
<div class="form_buttons">\
|
||||
<button id="confirm_with_select_proceed" class="" value="">OK</button>\
|
||||
<button class="confirm_cancel" value="">Cancel</button>\
|
||||
<button id="confirm_with_select_proceed" class="" value="">'+tr("OK")+'</button>\
|
||||
<button class="confirm_cancel" value="">'+tr("Cancel")+'</button>\
|
||||
</div>\
|
||||
</form>');
|
||||
|
||||
|
1036
src/sunstone/public/locale/ru/ru.js
Normal file
1036
src/sunstone/public/locale/ru/ru.js
Normal file
File diff suppressed because it is too large
Load Diff
17
src/sunstone/public/locale/ru/ru_datatable.txt
Normal file
17
src/sunstone/public/locale/ru/ru_datatable.txt
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"sProcessing": "Ждите. Выполняется обработка...",
|
||||
"sLengthMenu": "Показывать _MENU_ элементов списка",
|
||||
"sZeroRecords": "Список пуст",
|
||||
"sInfo": "Показаны элементы списка с _START_ по _END_ из _TOTAL_",
|
||||
"sInfoEmpty": "Список пуст",
|
||||
"sInfoFiltered": "(отфильтровано из _MAX_ элементов списка)",
|
||||
"sInfoPostFix": "",
|
||||
"sSearch": "Поиск:",
|
||||
"sUrl": "",
|
||||
"oPaginate": {
|
||||
"sFirst": "Первая",
|
||||
"sPrevious": "Предыдущая",
|
||||
"sNext": "Следующая",
|
||||
"sLast": "Последняя"
|
||||
}
|
||||
}
|
@ -114,6 +114,12 @@ helpers do
|
||||
session[:ip] = request.ip
|
||||
session[:remember] = params[:remember]
|
||||
|
||||
if user['TEMPLATE/LANG']
|
||||
session[:lang] = user['TEMPLATE/LANG']
|
||||
else
|
||||
session[:lang] = settings.config[:lang]
|
||||
end
|
||||
|
||||
if params[:remember]
|
||||
env['rack.session.options'][:expire_after] = 30*60*60*24
|
||||
end
|
||||
@ -209,12 +215,26 @@ get '/config' do
|
||||
@SunstoneServer.get_configuration(session[:user_id])
|
||||
end
|
||||
|
||||
post '/config' do
|
||||
begin
|
||||
body = JSON.parse(request.body.read)
|
||||
rescue
|
||||
[500, OpenNebula::Error.new(msg).to_json]
|
||||
end
|
||||
|
||||
body.each do | key,value |
|
||||
case key
|
||||
when "lang" then session[:lang]=value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
get '/vm/:id/log' do
|
||||
@SunstoneServer.get_vm_log(params[:id])
|
||||
end
|
||||
|
||||
##############################################################################
|
||||
# Logs
|
||||
# Monitoring
|
||||
##############################################################################
|
||||
|
||||
get '/:resource/monitor' do
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>OpenNebula Sunstone: Cloud Operations Center</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<!-- Vendor Libraries -->
|
||||
<link rel="stylesheet" type="text/css" href="vendor/dataTables/demo_table_jui.css" />
|
||||
@ -20,6 +20,13 @@
|
||||
|
||||
<!-- End Vendor Libraries -->
|
||||
|
||||
<!--Languages-->
|
||||
<script type="text/javascript" src="js/locale.js"></script>
|
||||
<%if session[:lang]%>
|
||||
<script type="text/javascript" src="locale/<%=session[:lang]%>/<%=session[:lang]%>.js"></script>
|
||||
<%end%>
|
||||
<!--endLanguages-->
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="css/application.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/layout.css" />
|
||||
<script type="text/javascript" src="js/opennebula.js"></script>
|
||||
@ -42,6 +49,7 @@
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="outer-center">
|
||||
<div class="inner-center">
|
||||
</div>
|
||||
@ -60,6 +68,14 @@
|
||||
<div id="login-info">
|
||||
Welcome <span id="user"></span> | <a href="#" id="logout">Sign Out</a>
|
||||
</div>
|
||||
<div id="language">
|
||||
<form>
|
||||
<select id="lang_sel">
|
||||
<option value="en_US">English</option>
|
||||
<option value="ru">Russian</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
<div id="links">
|
||||
<a href="http://opennebula.org/documentation:documentation" target="_blank">Documentation</a> |
|
||||
<a href="http://opennebula.org/support:support" target="_blank">Support</a> |
|
||||
|
Loading…
x
Reference in New Issue
Block a user