mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-07 12:52:54 -05:00
fix logoutOnIdleSessionTimeout spelling and extra translations #6851
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
@@ -1524,8 +1524,22 @@
|
||||
function setSessionActivity() { sessionActivity = Date.now(); }
|
||||
function checkIdleSessionTimeout() {
|
||||
var delta = (Date.now() - sessionActivity);
|
||||
if (delta > serverinfo.timeout && serverinfo.logoutOnIdleSessionTimeout) {
|
||||
window.location.href = 'logout';
|
||||
if (delta > serverinfo.timeout) {
|
||||
if (desktop != null) { // Disconnect remote desktop
|
||||
desktop.Stop();
|
||||
desktopNode = desktop = null;
|
||||
}
|
||||
if (terminal != null) { // Disconnect terminal
|
||||
terminal.Stop();
|
||||
terminal = null;
|
||||
}
|
||||
if (files != null) { // Disconnect files
|
||||
files.Stop();
|
||||
files = null;
|
||||
}
|
||||
if (serverinfo.logoutonidlesessiontimeout) {
|
||||
window.location.href = 'logout';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2447,17 +2447,28 @@
|
||||
files.Stop();
|
||||
files = null;
|
||||
}
|
||||
if (serverinfo.logoutOnIdleSessionTimeout) {
|
||||
if (serverinfo.logoutonidlesessiontimeout) {
|
||||
window.location.href = 'logout';
|
||||
}
|
||||
} else {
|
||||
var ds = Math.round((serverinfo.timeout - delta) / 1000);
|
||||
var sessionInProgress = desktop != null || terminal != null || files != null;
|
||||
var show = serverinfo.logoutonidlesessiontimeout || sessionInProgress;
|
||||
var isLogout = serverinfo.logoutonidlesessiontimeout;
|
||||
var theText = ''; // Initialize theText
|
||||
if (ds <= 60) {
|
||||
QH('idleTimeoutNotify', '<br />' + format((ds == 1)?"1 second until disconnect":"{0} seconds until disconnect", ds));
|
||||
theText = isLogout
|
||||
? (ds == 1 ? "1 second until logout" : "{0} seconds until logout")
|
||||
: (ds == 1 ? "1 second until disconnect" : "{0} seconds until disconnect");
|
||||
} else {
|
||||
ds = Math.round(ds / 60);
|
||||
if (ds <= 5) { QH('idleTimeoutNotify', '<br />' + format((ds == 1)?"1 minute until disconnect":"{0} minutes until disconnect", ds)); }
|
||||
if (ds <= 5) {
|
||||
theText = isLogout
|
||||
? (ds == 1 ? "1 minute until logout" : "{0} minutes until logout")
|
||||
: (ds == 1 ? "1 minute until disconnect" : "{0} minutes until disconnect");
|
||||
}
|
||||
}
|
||||
QH('idleTimeoutNotify', show && theText ? '<br />' + format(theText, ds) : '');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11356,7 +11367,7 @@
|
||||
}
|
||||
|
||||
function p13openfilefolder() {
|
||||
setDialogMode(2, "Open File/Folder", 3, p13openfilefolderEx, "Are you sure you want to open this file/folder on the remote devices desktop ?");
|
||||
setDialogMode(2, "Open File/Folder", 3, p13openfilefolderEx, "Are you sure you want to open this file/folder on the remote devices desktop?");
|
||||
}
|
||||
function p13openfilefolderEx() {
|
||||
var openfilefolder = "", checkboxes = document.getElementsByName('fd');
|
||||
|
||||
@@ -2897,17 +2897,28 @@
|
||||
files.Stop();
|
||||
files = null;
|
||||
}
|
||||
if (serverinfo.logoutOnIdleSessionTimeout) {
|
||||
if (serverinfo.logoutonidlesessiontimeout) {
|
||||
window.location.href = 'logout';
|
||||
}
|
||||
} else {
|
||||
var ds = Math.round((serverinfo.timeout - delta) / 1000);
|
||||
var sessionInProgress = (desktop != null || terminal != null || files != null);
|
||||
var show = serverinfo.logoutonidlesessiontimeout || sessionInProgress;
|
||||
var isLogout = serverinfo.logoutonidlesessiontimeout;
|
||||
var theText = '';
|
||||
if (ds <= 60) {
|
||||
QH('idleTimeoutNotify', '<br />' + format((ds == 1) ? "1 second until disconnect" : "{0} seconds until disconnect", ds));
|
||||
theText = isLogout
|
||||
? (ds == 1 ? "1 second until logout" : "{0} seconds until logout")
|
||||
: (ds == 1 ? "1 second until disconnect" : "{0} seconds until disconnect");
|
||||
} else {
|
||||
ds = Math.round(ds / 60);
|
||||
if (ds <= 5) { QH('idleTimeoutNotify', '<br />' + format((ds == 1) ? "1 minute until disconnect" : "{0} minutes until disconnect", ds)); }
|
||||
if (ds <= 5) {
|
||||
theText = isLogout
|
||||
? (ds == 1 ? "1 minute until logout" : "{0} minutes until logout")
|
||||
: (ds == 1 ? "1 minute until disconnect" : "{0} minutes until disconnect");
|
||||
}
|
||||
}
|
||||
QH('idleTimeoutNotify', show && theText ? '<br />' + format(theText, ds) : '');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12150,7 +12161,7 @@
|
||||
}
|
||||
|
||||
function p13openfilefolder() {
|
||||
setModalContent('xxAddAgent', "Open File/Folder", 'Are you sure you want to open this file/folder on the remote devices desktop ?');
|
||||
setModalContent('xxAddAgent', "Open File/Folder", "Are you sure you want to open this file/folder on the remote devices desktop?");
|
||||
showModal('xxAddAgentModal', 'idx_dlgOkButton', () => p13openfilefolderEx());
|
||||
}
|
||||
function p13openfilefolderEx() {
|
||||
|
||||
@@ -822,8 +822,22 @@
|
||||
function setSessionActivity() { sessionActivity = Date.now(); }
|
||||
function checkIdleSessionTimeout() {
|
||||
var delta = (Date.now() - sessionActivity);
|
||||
if (delta > serverinfo.timeout && serverinfo.logoutOnIdleSessionTimeout) {
|
||||
window.location.href = 'logout';
|
||||
if (delta > serverinfo.timeout) {
|
||||
if (desktop != null) { // Disconnect remote desktop
|
||||
desktop.Stop();
|
||||
desktopNode = desktop = null;
|
||||
}
|
||||
if (terminal != null) { // Disconnect terminal
|
||||
terminal.Stop();
|
||||
terminal = null;
|
||||
}
|
||||
if (files != null) { // Disconnect files
|
||||
files.Stop();
|
||||
files = null;
|
||||
}
|
||||
if (serverinfo.logoutonidlesessiontimeout) {
|
||||
window.location.href = 'logout';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user