Drag & drop a .mcrec file or click "Open File..."');
+ QH('metadatadiv', 'MeshCentral Session Player
' + "Drag & drop a .mcrec file or click \"Open File...\"" + '');
QV('DeskParent', true);
QV('TermParent', false);
}
@@ -529,10 +529,9 @@
function messagebox(t, m) { setSessionActivity(); QH('id_dialogMessage', m); setDialogMode(1, t, 1); }
function statusbox(t, m) { setSessionActivity(); QH('id_dialogMessage', m); setDialogMode(1, t); }
-
-
function haltEvent(e) { if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); return false; }
- function pad2(num) { var s = "00" + num; return s.substr(s.length - 2); }
+ function pad2(num) { var s = '00' + num; return s.substr(s.length - 2); }
+ function format(format) { var args = Array.prototype.slice.call(arguments, 1); return format.replace(/{(\d+)}/g, function (match, number) { return typeof args[number] != 'undefined' ? args[number] : match; }); };
start();
diff --git a/views/default.handlebars b/views/default.handlebars
index 30d03707..b8b4dbd7 100644
--- a/views/default.handlebars
+++ b/views/default.handlebars
@@ -983,15 +983,15 @@
'use strict';
// Process server-side web state
- var webState = "{{{webstate}}}";
- if (webState != "") { webState = JSON.parse(decodeURIComponent(webState)); }
+ var webState = '{{{webstate}}}';
+ if (webState != '') { webState = JSON.parse(decodeURIComponent(webState)); }
for (var i in webState) { localStorage.setItem(i, webState[i]); }
if (!webState.loctag) { delete localStorage.removeItem('loctag'); }
var args;
var autoReconnect = true;
- var powerStatetable = ['', 'Powered', 'Sleep', 'Sleep', 'Sleep', 'Hibernating', 'Power off', 'Present'];
- var StatusStrs = ['Disconnected', 'Connecting...', 'Setup...', 'Connected', 'Intel® AMT Connected'];
+ var powerStatetable = ['', "Powered", "Sleep", "Sleep", "Sleep", "Hibernating", "Power off", "Present"];
+ var StatusStrs = ["Disconnected", "Connecting...", "Setup...", "Connected", "Intel® AMT Connected"];
var sort = 0;
var searchFocus = 0;
var mapSearchFocus = 0;
@@ -1014,23 +1014,23 @@
var multidesktopsettings = { quality: 20, scaling: 128, framerate: 1000 };
var terminal;
var files;
- var debugLevel = parseInt("{{{debuglevel}}}");
- var features = parseInt("{{{features}}}");
- var sessionTime = parseInt("{{{sessiontime}}}");
- var domain = "{{{domain}}}";
- var domainUrl = "{{{domainurl}}}";
- var authCookie = "{{{authCookie}}}";
- var authRelayCookie = "{{{authRelayCookie}}}";
+ var debugLevel = parseInt('{{{debuglevel}}}');
+ var features = parseInt('{{{features}}}');
+ var sessionTime = parseInt('{{{sessiontime}}}');
+ var domain = '{{{domain}}}';
+ var domainUrl = '{{{domainurl}}}';
+ var authCookie = '{{{authCookie}}}';
+ var authRelayCookie = '{{{authRelayCookie}}}';
var authCookieRenewTimer = null;
var multiDesktop = {};
var multiDesktopFilter = null;
- var serverPublicNamePort = "{{{serverDnsName}}}:{{{serverPublicPort}}}";
+ var serverPublicNamePort = '{{{serverDnsName}}}:{{{serverPublicPort}}}';
var amtScanResults = null;
var debugmode = 0;
var clickOnce = (((features & 256) != 0) && detectClickOnce());
var attemptWebRTC = ((features & 128) != 0);
- var passRequirements = "{{{passRequirements}}}";
- if (passRequirements != "") { passRequirements = JSON.parse(decodeURIComponent(passRequirements)); }
+ var passRequirements = '{{{passRequirements}}}';
+ if (passRequirements != '') { passRequirements = JSON.parse(decodeURIComponent(passRequirements)); }
var deskAspectRatio = 0;
try { deskAspectRatio = parseInt(getstore('deskAspectRatio', '0')); } catch (ex) { }
var uiMode = parseInt(getstore('uiMode', 1));
@@ -1126,8 +1126,8 @@
document.onkeypress = ondockeypress;
document.onkeydown = ondockeydown;
document.onkeyup = ondockeyup;
- //window.addEventListener("focus", ondocfocus, false);
- window.addEventListener("blur", ondocblur, false);
+ //window.addEventListener('focus', ondocfocus, false);
+ window.addEventListener('blur', ondocblur, false);
window.onresize = function () { masterUpdate(512); }
setTimeout(function() { masterUpdate(512); }, 200);
@@ -1139,12 +1139,12 @@
meshserver.Start();
// Setup page controls
- Q('sortselect').selectedIndex = sort = getstore("sort", 0);
- Q('sizeselect').selectedIndex = getstore("_viewsize", 1);
- Q('SearchInput').value = getstore("_search", "");
- showRealNames = (getstore("showRealNames", 0) == 1);
+ Q('sortselect').selectedIndex = sort = getstore('sort', 0);
+ Q('sizeselect').selectedIndex = getstore('_viewsize', 1);
+ Q('SearchInput').value = getstore('_search', '');
+ showRealNames = (getstore('showRealNames', 0) == 1);
Q('RealNameCheckBox').checked = showRealNames;
- Q('viewselect').value = getstore("_deviceView", 1);
+ Q('viewselect').value = getstore('_deviceView', 1);
Q('DeskControl').checked = (getstore('DeskControl', 1) == 1);
QV('accountChangeEmailAddressSpan', (features & 0x200000) == 0);
@@ -1154,17 +1154,17 @@
Q('devViewButton' + Q('viewselect').value).classList.add('viewSelectorSel');
// Setup upload drag & drop
- Q('p5filetable').addEventListener("drop", p5fileDragDrop, false);
- Q('p5filetable').addEventListener("dragover", p5fileDragOver, false);
- Q('p5filetable').addEventListener("dragleave", p5fileDragLeave, false);
- //Q('p5fileCatchAllInput').addEventListener("drop", p5fileDragDrop, false);
- //Q('p5fileCatchAllInput').addEventListener("dragover", p5fileDragOver, false);
- //Q('p5fileCatchAllInput').addEventListener("dragleave", p5fileDragLeave, false);
+ Q('p5filetable').addEventListener('drop', p5fileDragDrop, false);
+ Q('p5filetable').addEventListener('dragover', p5fileDragOver, false);
+ Q('p5filetable').addEventListener('dragleave', p5fileDragLeave, false);
+ //Q('p5fileCatchAllInput').addEventListener('drop', p5fileDragDrop, false);
+ //Q('p5fileCatchAllInput').addEventListener('dragover', p5fileDragOver, false);
+ //Q('p5fileCatchAllInput').addEventListener('dragleave', p5fileDragLeave, false);
// Setup upload drag & drop
- Q('p13filetable').addEventListener("drop", p13fileDragDrop, false);
- Q('p13filetable').addEventListener("dragover", p13fileDragOver, false);
- Q('p13filetable').addEventListener("dragleave", p13fileDragLeave, false);
+ Q('p13filetable').addEventListener('drop', p13fileDragDrop, false);
+ Q('p13filetable').addEventListener('dragover', p13fileDragOver, false);
+ Q('p13filetable').addEventListener('dragleave', p13fileDragLeave, false);
// Timeline update interval
setInterval(updateDeviceTimeline, 120000); // Check every 2 minutes
@@ -1178,7 +1178,7 @@
// Terminal special keys
var x = '';
- for (var c = 1; c < 27; c++) x += "";
+ for (var c = 1; c < 27; c++) x += '';
QH('specialkeylist', x);
// Setup server stats panels
@@ -1206,9 +1206,9 @@
putstore('webPageStackMenu', webPageStackMenu);
}
if (webPageStackMenu == false) {
- QC('body').remove("menu_stack");
+ QC('body').remove('menu_stack');
} else {
- QC('body').add("menu_stack");
+ QC('body').add('menu_stack');
if (xxcurrentView >= 10) QC('column_l').remove('room4submenu');
}
deskAdjust();
@@ -1248,15 +1248,15 @@
var hide = 0;
if (args.hide) { hide = parseInt(args.hide); }
if (webPageFullScreen == false) {
- QC('body').remove("menu_stack");
- QC('body').remove("fullscreen");
- QC('body').remove("arg_hide");
+ QC('body').remove('menu_stack');
+ QC('body').remove('fullscreen');
+ QC('body').remove('arg_hide');
if (xxcurrentView >= 10) QC('column_l').add('room4submenu');
QV('UserDummyMenuSpan', false);
//QV('page_leftbar', false);
} else {
- QC('body').add("fullscreen");
- if (hide & 16) QC('body').add("arg_hide"); // This is replacement for QV('page_leftbar', !(hide & 16));
+ QC('body').add('fullscreen');
+ if (hide & 16) QC('body').add('arg_hide'); // This is replacement for QV('page_leftbar', !(hide & 16));
QV('page_leftbar', !(hide & 16));
QV('MainMenuSpan', !(hide & 16));
if (xxcurrentView >= 10) QC('column_l').remove('room4submenu');
@@ -1288,8 +1288,8 @@
hideContextMenu(); // Hide the context menu if present
QV('verifyEmailId2', false);
QV('logoutControl', false);
- if (errorCode == 'noauth') { QH('p0span', 'Unable to perform authentication'); return; }
- if (prevState == 2) { if (autoReconnect) { setTimeout(serverPoll, 5000); } } else { QH('p0span', 'Unable to connect web socket'); }
+ if (errorCode == 'noauth') { QH('p0span', "Unable to perform authentication"); return; }
+ if (prevState == 2) { if (autoReconnect) { setTimeout(serverPoll, 5000); } } else { QH('p0span', "Unable to connect web socket"); }
if (authCookieRenewTimer != null) { clearInterval(authCookieRenewTimer); authCookieRenewTimer = null; }
} else if (state == 2) {
// Fetch list of meshes, nodes, files
@@ -1306,7 +1306,7 @@
var xdr = null;
try { xdr = new XDomainRequest(); } catch (e) { }
if (!xdr) xdr = new XMLHttpRequest();
- xdr.open("HEAD", window.location.href);
+ xdr.open('HEAD', window.location.href);
xdr.timeout = 15000;
xdr.onload = function () { reload(); };
xdr.onerror = xdr.ontimeout = function () { setTimeout(serverPoll, 10000); };
@@ -1315,13 +1315,13 @@
// Return true if this browser supports clickonce
function detectClickOnce() {
- for (var i in window.navigator.mimeTypes) { if (window.navigator.mimeTypes[i].type == "application/x-ms-application") { return true; } }
+ for (var i in window.navigator.mimeTypes) { if (window.navigator.mimeTypes[i].type == 'application/x-ms-application') { return true; } }
var userAgent = window.navigator.userAgent.toUpperCase();
return (userAgent.indexOf('.NET CLR 3.5') >= 0) || (userAgent.indexOf('(WINDOWS NT ') >= 0);
}
function updateSiteAdmin() {
- var noServerBackup = "{{{noServerBackup}}}";
+ var noServerBackup = '{{{noServerBackup}}}';
var siteRights = userinfo.siteadmin;
if (noServerBackup == 1) { siteRights &= 0xFFFFFFFA; } // If not server backups allowed, remove server backup and restore permissions
@@ -1401,7 +1401,7 @@
// Check if backup codes should really be enabled
if ((backupCodesWarningDone == false) && !(userinfo.otpkeys > 0) && (((userinfo.otpsecret == 1) && !(userinfo.otphkeys > 0)) || ((userinfo.otpsecret != 1) && (userinfo.otphkeys == 1)))) {
- var n = { text: 'Please add two-factor backup codes. If the current factor is lost, there is not way to recover this account.', title: 'Two factor authentication' };
+ var n = { text: "Please add two-factor backup codes. If the current factor is lost, there is not way to recover this account.", title: "Two factor authentication" };
addNotification(n);
backupCodesWarningDone = true;
}
@@ -1414,13 +1414,13 @@
QV('getStarted2', !newGroupsAllowed);
if (typeof userinfo.passchange == 'number') {
- if (userinfo.passchange == -1) { QH('p2nextPasswordUpdateTime', ' - Reset on next login.'); }
+ if (userinfo.passchange == -1) { QH('p2nextPasswordUpdateTime', " - Reset on next login."); }
else if ((passRequirements != null) && (typeof passRequirements.reset == 'number')) {
var seconds = (userinfo.passchange) + (passRequirements.reset * 86400) - Math.floor(Date.now() / 1000);
- if (seconds < 0) { QH('p2nextPasswordUpdateTime', ' - Reset on next login.'); }
- else if (seconds < 3600) { QH('p2nextPasswordUpdateTime', ' - Reset in ' + Math.floor(seconds / 60) + ' minute' + addLetterS(Math.floor(seconds / 60)) + '.'); }
- else if (seconds < 86400) { QH('p2nextPasswordUpdateTime', ' - Reset in ' + Math.floor(seconds / 3600) + ' hour' + addLetterS(Math.floor(seconds / 3600)) + '.'); }
- else { QH('p2nextPasswordUpdateTime', ' - Reset in ' + Math.floor(seconds / 86400) + ' day' + addLetterS(Math.floor(seconds / 86400)) + '.'); }
+ if (seconds < 0) { QH('p2nextPasswordUpdateTime', " - Reset on next login."); }
+ else if (seconds < 3600) { QH('p2nextPasswordUpdateTime', format(" - Reset in {0} minute{1}.", Math.floor(seconds / 60), addLetterS(Math.floor(seconds / 60)))); }
+ else if (seconds < 86400) { QH('p2nextPasswordUpdateTime', format(" - Reset in {0} hour{1}.", Math.floor(seconds / 3600), addLetterS(Math.floor(seconds / 3600)))); }
+ else { QH('p2nextPasswordUpdateTime', format(" - Reset in {0} day{1}."), Math.floor(seconds / 86400), addLetterS(Math.floor(seconds / 86400))); }
}
}
}
@@ -1432,10 +1432,10 @@
if (delta > serverinfo.timeout) { window.location.href = 'logout'; } else {
var ds = Math.round((serverinfo.timeout - delta) / 1000);
if (ds <= 60) {
- QH('idleTimeoutNotify', ' ' + ds + ' second' + addLetterS(ds) + ' until disconnect');
+ QH('idleTimeoutNotify', ' ' + format("{0} second{1} until disconnect", ds, addLetterS(ds)));
} else {
ds = Math.round(ds / 60);
- if (ds <= 5) { QH('idleTimeoutNotify', ' ' + ds + ' minute' + addLetterS(ds) + ' until disconnect'); }
+ if (ds <= 5) { QH('idleTimeoutNotify', ' ' + format("{0} minute{1} until disconnect", ds, addLetterS(ds))); }
}
}
}
@@ -1476,7 +1476,7 @@
case 'serverinfo': {
serverinfo = message.serverinfo;
if (serverinfo.timeout) { setInterval(checkIdleSessionTimeout, 10000); checkIdleSessionTimeout(); }
- if (debugmode == 1) { console.log("Server time: ", printDateTime(new Date(serverinfo.serverTime))); }
+ if (debugmode == 1) { console.log('Server time: ', printDateTime(new Date(serverinfo.serverTime))); }
break;
}
case 'userinfo': {
@@ -1545,32 +1545,32 @@
if (message.nodeid != powerTimelineReq) break;
//console.log('getsysinfo', message); // ***********************
if (message.noinfo === true) {
- QH('p17info', 'No information for this device.');
+ QH('p17info', "No information for this device.");
} else {
var x = '', s = {};
if (message.hardware) {
if (message.hardware.identifiers) {
var ident = message.hardware.identifiers;
// BIOS
- x += '
BIOS
';
- if (ident.bios_vendor) { x += addDetailItem('Vendor', ident.bios_vendor, s); }
- if (ident.bios_version) { x += addDetailItem('Version', ident.bios_version, s); }
+ x += '
' + "BIOS" + '
';
+ if (ident.bios_vendor) { x += addDetailItem("Vendor", ident.bios_vendor, s); }
+ if (ident.bios_version) { x += addDetailItem("Version", ident.bios_version, s); }
x += ' ';
// Motherboard
- x += '
Motherboard
';
- if (ident.board_vendor) { x += addDetailItem('Vendor', ident.board_vendor, s); }
- if (ident.board_name) { x += addDetailItem('Name', ident.board_name, s); }
- if (ident.board_serial && (ident.board_serial != '')) { x += addDetailItem('Serial', ident.board_serial, s); }
- if (ident.board_version) { x += addDetailItem('Version', ident.board_version, s); }
- if (ident.product_uuid) { x += addDetailItem('Identifier', ident.product_uuid, s); }
+ x += '
' + "Motherboard" + '
';
+ if (ident.board_vendor) { x += addDetailItem("Vendor", ident.board_vendor, s); }
+ if (ident.board_name) { x += addDetailItem("Name", ident.board_name, s); }
+ if (ident.board_serial && (ident.board_serial != '')) { x += addDetailItem("Serial", ident.board_serial, s); }
+ if (ident.board_version) { x += addDetailItem("Version", ident.board_version, s); }
+ if (ident.product_uuid) { x += addDetailItem("Identifier", ident.product_uuid, s); }
x += ' ';
}
if (message.hardware.windows) {
if (message.hardware.windows.memory) {
// Memory
- x += '
Memory
';
+ x += '
' + "Memory" + '
';
// Sort Memory
function memorySort(a, b) { if (a.BankLabel > b.BankLabel) return 1; if (a.BankLabel < b.BankLabel) return -1; return 0; }
@@ -1582,8 +1582,8 @@
x += '
';
}
x += ' ';
@@ -1592,10 +1592,10 @@
if (message.hardware.windows.osinfo) {
// Operating System
var m = message.hardware.windows.osinfo;
- x += '
Operating System
';
- if (m.Caption) { x += addDetailItem('Name', m.Caption, s); }
- if (m.Version) { x += addDetailItem('Version', m.Version, s); }
- if (m.OSArchitecture) { x += addDetailItem('Architecture', m.OSArchitecture, s); }
+ x += '
' + "Operating System" + '
';
+ if (m.Caption) { x += addDetailItem("Name", m.Caption, s); }
+ if (m.Version) { x += addDetailItem("Version", m.Version, s); }
+ if (m.OSArchitecture) { x += addDetailItem("Architecture", m.OSArchitecture, s); }
x += ' ';
}
@@ -1615,7 +1615,7 @@
node.lastconnect = message.time;
node.lastaddr = message.addr;
if ((currentNode._id == node._id) && (Q('MainComputerState').innerHTML == '')) {
- QH('MainComputerState', 'Last seen: ' + printDateTime(new Date(node.lastconnect)) + '');
+ QH('MainComputerState', '' + "Last seen:" + ' ' + printDateTime(new Date(node.lastconnect)) + '');
}
}
break;
@@ -1644,7 +1644,7 @@
Q('d2clipText').value = message.data;
} else if ((message.type == 'setclip') && (xxdialogTag == 'clipboard') && (currentNode != null) && (currentNode._id == message.nodeid)) {
// Display success/fail on the clipboard dialog box.
- QH('dlgClipStatus', message.success ? 'Success' : 'Failed')
+ QH('dlgClipStatus', message.success ? '' + "Success" + '' : '' + "Failed" + '')
setTimeout(function () { try { QH('dlgClipStatus', ''); } catch (ex) { } }, 2000);
}
}
@@ -1661,38 +1661,38 @@
case 'getnetworkinfo': {
if ((currentNode._id == message.nodeid) && (xxdialogMode == 2) && (xxdialogTag == 'if' + message.nodeid)) {
if (message.netif == null) {
- QH('d2netinfo', 'No network interface information available for this device.');
+ QH('d2netinfo', "No network interface information available for this device.");
} else {
var x = '
';
- if (currentNode.lastconnect) { x += addHtmlValue2('Last agent connection', printDateTime(new Date(currentNode.lastconnect))); }
+ if (currentNode.lastconnect) { x += addHtmlValue2("Last agent connection", printDateTime(new Date(currentNode.lastconnect))); }
if (currentNode.lastaddr) {
var splitip = currentNode.lastaddr.split(':');
if (splitip.length > 2) {
// IPv6
- x += addHtmlValue2('Last agent address', currentNode.lastaddr + ' ');
+ x += addHtmlValue2("Last agent address", currentNode.lastaddr + ' ');
} else {
// IPv4
if (isPrivateIP(currentNode.lastaddr)) {
- x += addHtmlValue2('Last agent address', splitip[0] + ' ');
+ x += addHtmlValue2("Last agent address", splitip[0] + ' ');
} else {
- x += addHtmlValue2('Last agent address', '' + splitip[0] + ' ');
+ x += addHtmlValue2("Last agent address", '' + splitip[0] + ' ');
}
}
}
- x += addHtmlValue2('Last interfaces update', printDateTime(new Date(message.updateTime)));
+ x += addHtmlValue2("Last interfaces update", printDateTime(new Date(message.updateTime)));
for (var i in message.netif) {
var net = message.netif[i];
x += ''
- if (net.name) { x += addHtmlValue2('Name', '' + EscapeHtml(net.name) + ''); }
- if (net.desc) { x += addHtmlValue2('Description', EscapeHtml(net.desc).replace('(R)', '®').replace('(r)', '®')); }
- if (net.dnssuffix) { x += addHtmlValue2('DNS suffix', EscapeHtml(net.dnssuffix) + ' '); }
- if (net.mac) { x += addHtmlValue2('MAC address', '' + EscapeHtml(net.mac.toLowerCase()) + ' '); }
- if (net.v4addr) { x += addHtmlValue2('IPv4 address', EscapeHtml(net.v4addr) + ' '); }
- if (net.v4mask) { x += addHtmlValue2('IPv4 mask', EscapeHtml(net.v4mask) + ' '); }
- if (net.v4gateway) { x += addHtmlValue2('IPv4 gateway', EscapeHtml(net.v4gateway) + ' '); }
- if (net.gatewaymac) { x += addHtmlValue2('Gateway MAC', '' + EscapeHtml(net.gatewaymac.toLowerCase()) + ' '); }
+ if (net.name) { x += addHtmlValue2("Name", '' + EscapeHtml(net.name) + ''); }
+ if (net.desc) { x += addHtmlValue2("Description", EscapeHtml(net.desc).replace('(R)', '®').replace('(r)', '®')); }
+ if (net.dnssuffix) { x += addHtmlValue2("DNS suffix", EscapeHtml(net.dnssuffix) + ' '); }
+ if (net.mac) { x += addHtmlValue2("MAC address", '' + EscapeHtml(net.mac.toLowerCase()) + ' '); }
+ if (net.v4addr) { x += addHtmlValue2("IPv4 address", EscapeHtml(net.v4addr) + ' '); }
+ if (net.v4mask) { x += addHtmlValue2("IPv4 mask", EscapeHtml(net.v4mask) + ' '); }
+ if (net.v4gateway) { x += addHtmlValue2("IPv4 gateway", EscapeHtml(net.v4gateway) + ' '); }
+ if (net.gatewaymac) { x += addHtmlValue2("Gateway MAC", '' + EscapeHtml(net.gatewaymac.toLowerCase()) + ' '); }
}
x += '
';
QH('d2netinfo', x);
@@ -1703,15 +1703,15 @@
case 'serverversion': {
if ((xxdialogMode == 2) && (xxdialogTag == 'MeshCentralServerUpdate')) {
var x = '
';
- if (!message.current) { message.current = 'Unknown'; }
- if (!message.latest) { message.latest = 'Unknown'; }
- x += addHtmlValue2('Current Version', '' + EscapeHtml(message.current) + '');
- x += addHtmlValue2('Latest Version', '' + EscapeHtml(message.latest) + '');
+ if (!message.current) { message.current = "Unknown"; }
+ if (!message.latest) { message.latest = "Unknown"; }
+ x += addHtmlValue2("Current Version", '' + EscapeHtml(message.current) + '');
+ x += addHtmlValue2("Latest Version", '' + EscapeHtml(message.latest) + '');
x += '
';
if ((message.latest.indexOf('.') == -1) || (message.current == message.latest) || ((features & 2048) == 0)) {
setDialogMode(2, "MeshCentral Version", 1, null, x);
} else {
- setDialogMode(2, "MeshCentral Version", 3, server_showVersionDlgEx, x + ' ');
+ setDialogMode(2, "MeshCentral Version", 3, server_showVersionDlgEx, x + ' ');
server_showVersionDlgUpdate();
}
}
@@ -1720,10 +1720,10 @@
case 'servererrors': {
if ((xxdialogMode == 2) && (xxdialogTag == 'MeshCentralServerErrors')) {
if (message.data == null) {
- setDialogMode(2, "MeshCentral Server Errors", 1, null, 'Server has no error log.');
+ setDialogMode(2, "MeshCentral Server Errors", 1, null, "Server has no error log.");
} else {
var x = '
Install Google Authenticator or a compatible application and scan the barcode, use this link or enter the secret. Then, enter the current 6 digit token below to activate 2-Step login.
Secret ' + secret + '
Enter the token here for 2-step login: = 48 && event.charCode <= 57)\" onkeyup=account_addOtpCheck(event) onkeydown=account_addOtpCheck() maxlength=6 id=d2otpauthinput type=text>
' + "Install Google Authenticator or a compatible application and scan the barcode, use this link or enter the secret. Then, enter the current 6 digit token below to activate 2-Step login." + '
Secret ' + secret + '
' + "Enter the token here for 2-step login:" + ' = 48 && event.charCode <= 57)\" onkeyup=account_addOtpCheck(event) onkeydown=account_addOtpCheck() maxlength=6 id=d2otpauthinput type=text>
');
+ new QRCode(Q('qrcode'), { text: message.url, width: 128, height: 128, colorDark: '#000000', colorLight: '#EEE', correctLevel: QRCode.CorrectLevel.H });
QV('idx_dlgOkButton', true);
QE('idx_dlgOkButton', false);
Q('d2otpauthinput').focus();
@@ -1795,7 +1795,7 @@
case 'otpauth-getpasswords': {
if (xxdialogMode) return;
var x = "One time tokens can be used as secondary authentication. Generate a set, print them and keep them in a safe place.";
- x += "
";
+ x += '
';
if (message.passwords) {
var j = 0, clipb = '';
for (var i in message.passwords) {
@@ -1811,38 +1811,38 @@
}
}
} else {
- x += '
No Active Tokens';
+ x += '
' + "No Active Tokens";
}
- x += "
";
- x += "
";
- x += "";
+ x += '
';
+ x += '
';
+ x += '';
if (message.passwords != null) {
- x += "";
- x += ' ';
+ x += '';
+ x += ' ';
}
- x += "
";
+ x += ' ';
setDialogMode(2, "Manage Backup Codes", 8, null, x, 'otpauth-manage');
break;
}
case 'otp-hkey-get': {
if (xxdialogMode && (xxdialogTag != 'otpauth-hardware-manage')) return;
- var start = "
";
- var end = "
";
- var x = "Hardware keys are used as secondary login authentication.";
- x += "
";
+ var start = '
';
+ var end = '
';
+ var x = "Hardware keys are used as secondary login authentication.";
+ x += '
';
if (message.keys && message.keys.length > 0) {
for (var i in message.keys) {
var key = message.keys[i], type = (key.type == 2)?'OTP':'WebAuthn';
- x += start + '
' + key.name + "
" + end;
+ x += start + '
' + key.name + '
' + end;
}
} else {
- x += start + '
No Keys Configured' + end;
+ x += start + '
' + "No Keys Configured" + end;
}
- x += "";
- x += "
";
- if ((features & 0x00020000) != 0) { x += ""; }
- if ((features & 0x00004000) != 0) { x += ""; }
- x += "
";
+ x += '';
+ x += '
';
+ if ((features & 0x00020000) != 0) { x += ''; }
+ if ((features & 0x00004000) != 0) { x += ''; }
+ x += '
';
setDialogMode(2, "Manage Security Keys", 8, null, x, 'otpauth-hardware-manage');
if (u2fSupported() == false) { QE('d2addkey1', false); }
break;
@@ -1851,7 +1851,7 @@
if (message.result) {
meshserver.send({ action: 'otp-hkey-get' }); // Success, ask for the full list of keys.
} else {
- setDialogMode(2, "Add Security Key", 1, null, ' Error, Unable to add key.
', 'otpauth-hardware-manage');
}
break;
}
case 'webauthn-startregister': {
if (xxdialogMode && (xxdialogTag != 'otpauth-hardware-manage')) return;
- var x = "Press the key button now.