mirror of
https://github.com/unraid/webgui.git
synced 2026-01-15 22:19:58 -06:00
Multi-language support
This commit is contained in:
@@ -3,7 +3,7 @@ function ajaxVMDispatch(params, spin){
|
||||
$.post("/plugins/dynamix.vm.manager/include/VMajax.php", params, function(data) {
|
||||
if (data.error) {
|
||||
swal({
|
||||
title:"Execution error", html:true,
|
||||
title:_("Execution error"), html:true,
|
||||
text:data.error, type:"error"
|
||||
},function(){
|
||||
if (spin) setTimeout(spin+'()',500); else location=window.location.href;
|
||||
@@ -19,69 +19,69 @@ function addVMContext(name, uuid, template, state, vncurl, log){
|
||||
var x = path.indexOf("?");
|
||||
if (x!=-1) path = path.substring(0,x);
|
||||
if (vncurl !== "") {
|
||||
opts.push({text:"VNC Remote", icon:"fa-desktop", action:function(e) {
|
||||
opts.push({text:_("VNC Remote"), icon:"fa-desktop", action:function(e) {
|
||||
e.preventDefault();
|
||||
window.open(vncurl, '_blank', 'scrollbars=yes,resizable=yes');
|
||||
}});
|
||||
opts.push({divider:true});
|
||||
}
|
||||
if (state == "running") {
|
||||
opts.push({text:"Stop", icon:"fa-stop", action:function(e) {
|
||||
opts.push({text:_("Stop"), icon:"fa-stop", action:function(e) {
|
||||
e.preventDefault();
|
||||
ajaxVMDispatch({action:"domain-stop", uuid:uuid}, "loadlist");
|
||||
}});
|
||||
opts.push({text:"Pause", icon:"fa-pause", action:function(e) {
|
||||
opts.push({text:_("Pause"), icon:"fa-pause", action:function(e) {
|
||||
e.preventDefault();
|
||||
ajaxVMDispatch({action:"domain-pause", uuid:uuid}, "loadlist");
|
||||
}});
|
||||
opts.push({text:"Restart", icon:"fa-refresh", action:function(e) {
|
||||
opts.push({text:_("Restart"), icon:"fa-refresh", action:function(e) {
|
||||
e.preventDefault();
|
||||
ajaxVMDispatch({action:"domain-restart", uuid:uuid}, "loadlist");
|
||||
}});
|
||||
opts.push({text:"Hibernate", icon:"fa-bed", action:function(e) {
|
||||
opts.push({text:_("Hibernate"), icon:"fa-bed", action:function(e) {
|
||||
e.preventDefault();
|
||||
ajaxVMDispatch({action:"domain-pmsuspend", uuid:uuid}, "loadlist");
|
||||
}});
|
||||
opts.push({text:"Force Stop", icon:"fa-bomb", action:function(e) {
|
||||
opts.push({text:_("Force Stop"), icon:"fa-bomb", action:function(e) {
|
||||
e.preventDefault();
|
||||
ajaxVMDispatch( {action:"domain-destroy", uuid:uuid}, "loadlist");
|
||||
}});
|
||||
} else if (state == "pmsuspended") {
|
||||
opts.push({text:"Resume", icon:"fa-play", action:function(e) {
|
||||
opts.push({text:_("Resume"), icon:"fa-play", action:function(e) {
|
||||
e.preventDefault();
|
||||
ajaxVMDispatch({action:"domain-pmwakeup", uuid:uuid}, "loadlist");
|
||||
}});
|
||||
opts.push({text:"Force Stop", icon:"fa-bomb", action:function(e) {
|
||||
opts.push({text:_("Force Stop"), icon:"fa-bomb", action:function(e) {
|
||||
e.preventDefault();
|
||||
ajaxVMDispatch({action:"domain-destroy", uuid:uuid}, "loadlist");
|
||||
}});
|
||||
} else if (state == "paused" || state == "unknown") {
|
||||
opts.push({text:"Resume", icon:"fa-play", action:function(e) {
|
||||
opts.push({text:_("Resume"), icon:"fa-play", action:function(e) {
|
||||
e.preventDefault();
|
||||
ajaxVMDispatch({action:"domain-resume", uuid:uuid}, "loadlist");
|
||||
}});
|
||||
opts.push({text:"Force Stop", icon:"fa-bomb", action:function(e) {
|
||||
opts.push({text:_("Force Stop"), icon:"fa-bomb", action:function(e) {
|
||||
e.preventDefault();
|
||||
ajaxVMDispatch({action:"domain-destroy", uuid:uuid}, "loadlist");
|
||||
}});
|
||||
} else {
|
||||
opts.push({text:"Start", icon:"fa-play", action:function(e) {
|
||||
opts.push({text:_("Start"), icon:"fa-play", action:function(e) {
|
||||
e.preventDefault();
|
||||
ajaxVMDispatch({action:"domain-start", uuid:uuid}, "loadlist");
|
||||
}});
|
||||
}
|
||||
opts.push({divider:true});
|
||||
if (log !== "") {
|
||||
opts.push({text:"Logs", icon:"fa-navicon", action:function(e){e.preventDefault(); openWindow('/webGui/scripts/tail_log&arg1='+log, 'Log for:'+name, 600, 900);}});
|
||||
opts.push({text:_("Logs"), icon:"fa-navicon", action:function(e){e.preventDefault(); openWindow('/webGui/scripts/tail_log&arg1='+log, 'Log for:'+name, 600, 900);}});
|
||||
}
|
||||
opts.push({text:"Edit", icon:"fa-pencil", href:path+'/UpdateVM?uuid='+uuid});
|
||||
opts.push({text:_("Edit"), icon:"fa-pencil", href:path+'/UpdateVM?uuid='+uuid});
|
||||
if (state == "shutoff") {
|
||||
opts.push({divider:true});
|
||||
opts.push({text:"Remove VM", icon:"fa-minus", action:function(e) {
|
||||
opts.push({text:_("Remove VM"), icon:"fa-minus", action:function(e) {
|
||||
e.preventDefault();
|
||||
swal({
|
||||
title:"Are you sure?",
|
||||
text:"Remove definition:"+name,
|
||||
title:_("Are you sure?"),
|
||||
text:_("Remove definition:")+name,
|
||||
type:"warning",
|
||||
showCancelButton:true
|
||||
},function(){
|
||||
@@ -90,11 +90,11 @@ function addVMContext(name, uuid, template, state, vncurl, log){
|
||||
});
|
||||
}});
|
||||
if (template != 'OpenELEC') {
|
||||
opts.push({text:"Remove VM & Disks", icon:"fa-trash", action:function(e) {
|
||||
opts.push({text:_("Remove VM")+" & "+_("Disks"), icon:"fa-trash", action:function(e) {
|
||||
e.preventDefault();
|
||||
swal({
|
||||
title:"Are you sure?",
|
||||
text:"Completely REMOVE "+name+" disk image and definition",
|
||||
title:_("Are you sure?"),
|
||||
text:_("Completely REMOVE")+" "+name+" "+_("disk image and definition"),
|
||||
type:"warning",
|
||||
showCancelButton:true
|
||||
},function(){
|
||||
|
||||
Reference in New Issue
Block a user