1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Server fixes.

This commit is contained in:
Ylian Saint-Hilaire 2019-06-17 15:20:47 -07:00
parent d8ba9159ba
commit c3fc3a0d2a
6 changed files with 62 additions and 26 deletions

View file

@ -8909,16 +8909,23 @@ var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this
flag = Q('aginsSelect').value;
if (parseInt(flag) >= 5) { name = name.toLowerCase(); } else { name += '.exe'; }
}
try { xdr = new XDomainRequest(); } catch (e) { }
if (!xdr) xdr = new XMLHttpRequest();
xdr.open("GET", window.location.href + path + flag);
xdr.timeout = 15000;
xdr.responseType = "blob";
xdr.onprogress = function (x) { /*console.log(x);*/ };
xdr.onload = function (e) { saveAs(new Blob([e.target.response], { type: "application/octet-stream" }), name); if (xxdialogTag == 'fileDownload') { setDialogMode(0); } };
xdr.onerror = function () { if (xxdialogTag == 'fileDownload') { setDialogMode(0); } alert('Agent downloads timeout.'); };
xdr.ontimeout = function () { if (xxdialogTag == 'fileDownload') { setDialogMode(0); } alert('Unable to download agent.'); };
xdr.send();
if (args.filedownloadtab == 1) {
// Open a new tab with download
window.open(window.location.origin + '/' + path + flag, '_blank');
} else {
// Background download & save
try { xdr = new XDomainRequest(); } catch (e) { }
if (!xdr) xdr = new XMLHttpRequest();
xdr.open("GET", window.location.origin + '/' + path + flag);
xdr.timeout = 15000;
xdr.responseType = "blob";
xdr.onprogress = function (x) { /*console.log(x);*/ };
xdr.onload = function (e) { saveAs(new Blob([e.target.response], { type: "application/octet-stream" }), name); if (xxdialogTag == 'fileDownload') { setDialogMode(0); } };
xdr.onerror = function () { if (xxdialogTag == 'fileDownload') { setDialogMode(0); } alert('Agent downloads timeout.'); };
xdr.ontimeout = function () { if (xxdialogTag == 'fileDownload') { setDialogMode(0); } alert('Unable to download agent.'); };
xdr.send();
}
}
function addAgentToMeshClick() {
@ -10047,6 +10054,11 @@ var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this
// Update the web page title
if ((currentNode) && (xxcurrentView >= 10) && (xxcurrentView < 20)) { document.title = decodeURIComponent("{{{extitle}}}") + ' - ' + currentNode.name; } else { document.title = decodeURIComponent("{{{extitle}}}"); }
// Clear user consent status if present
p11clearConsoleMsg();
p12clearConsoleMsg();
p13clearConsoleMsg();
}
setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching.
if (!panel) panel = 10;
@ -10529,6 +10541,7 @@ var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this
function autoConnectDesktop(e) { if (autoConnectDesktopTimer == null) { autoConnectDesktopTimer = setInterval(connectDesktop, 100); } else { clearInterval(autoConnectDesktopTimer); autoConnectDesktopTimer = null; } }
function connectDesktop(e, contype) {
p11clearConsoleMsg();
if (desktop == null) {
desktopNode = currentNode;
if (contype == 2) {
@ -11122,6 +11135,7 @@ var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this
function autoConnectTerminal(e) { if (autoConnectTerminalTimer == null) { autoConnectTerminalTimer = setInterval(connectTerminal, 100); } else { clearInterval(autoConnectTerminalTimer); autoConnectTerminalTimer = null; } }
function connectTerminal(e, contype) {
p12clearConsoleMsg();
if (!terminal) {
if (contype == 2) {
// Setup the Intel AMT terminal
@ -11156,7 +11170,6 @@ var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this
terminal.attemptWebRTC = attemptWebRTC;
terminal.onStateChanged = onTerminalStateChange;
terminal.onConsoleMessageChange = function () {
console.log('terminal.consoleMessage', terminal.consoleMessage);
p12clearConsoleMsg();
if (terminal.consoleMessage) {
QH('p12TermConsoleMsg', EscapeHtml(terminal.consoleMessage).split('\n').join('<br />'));
@ -11278,6 +11291,7 @@ var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this
function autoConnectFiles(e) { if (autoConnectFilesTimer == null) { autoConnectFilesTimer = setInterval(connectFiles, 100); } else { clearInterval(autoConnectFilesTimer); autoConnectFilesTimer = null; } }
function connectFiles(e) {
p13clearConsoleMsg();
if (!files) {
// Setup a mesh agent files
files = CreateAgentRedirect(meshserver, CreateRemoteFiles(p13gotFiles), serverPublicNamePort, authCookie, domainUrl);

View file

@ -2861,16 +2861,23 @@
flag = Q('aginsSelect').value;
if (parseInt(flag) >= 5) { name = name.toLowerCase(); } else { name += '.exe'; }
}
try { xdr = new XDomainRequest(); } catch (e) { }
if (!xdr) xdr = new XMLHttpRequest();
xdr.open("GET", window.location.href + path + flag);
xdr.timeout = 15000;
xdr.responseType = "blob";
xdr.onprogress = function (x) { /*console.log(x);*/ };
xdr.onload = function (e) { saveAs(new Blob([e.target.response], { type: "application/octet-stream" }), name); if (xxdialogTag == 'fileDownload') { setDialogMode(0); } };
xdr.onerror = function () { if (xxdialogTag == 'fileDownload') { setDialogMode(0); } alert('Agent downloads timeout.'); };
xdr.ontimeout = function () { if (xxdialogTag == 'fileDownload') { setDialogMode(0); } alert('Unable to download agent.'); };
xdr.send();
if (args.filedownloadtab == 1) {
// Open a new tab with download
window.open(window.location.origin + '/' + path + flag, '_blank');
} else {
// Background download & save
try { xdr = new XDomainRequest(); } catch (e) { }
if (!xdr) xdr = new XMLHttpRequest();
xdr.open("GET", window.location.origin + '/' + path + flag);
xdr.timeout = 15000;
xdr.responseType = "blob";
xdr.onprogress = function (x) { /*console.log(x);*/ };
xdr.onload = function (e) { saveAs(new Blob([e.target.response], { type: "application/octet-stream" }), name); if (xxdialogTag == 'fileDownload') { setDialogMode(0); } };
xdr.onerror = function () { if (xxdialogTag == 'fileDownload') { setDialogMode(0); } alert('Agent downloads timeout.'); };
xdr.ontimeout = function () { if (xxdialogTag == 'fileDownload') { setDialogMode(0); } alert('Unable to download agent.'); };
xdr.send();
}
}
function addAgentToMeshClick() {
@ -3999,6 +4006,11 @@
// Update the web page title
if ((currentNode) && (xxcurrentView >= 10) && (xxcurrentView < 20)) { document.title = decodeURIComponent("{{{extitle}}}") + ' - ' + currentNode.name; } else { document.title = decodeURIComponent("{{{extitle}}}"); }
// Clear user consent status if present
p11clearConsoleMsg();
p12clearConsoleMsg();
p13clearConsoleMsg();
}
setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching.
if (!panel) panel = 10;
@ -4481,6 +4493,7 @@
function autoConnectDesktop(e) { if (autoConnectDesktopTimer == null) { autoConnectDesktopTimer = setInterval(connectDesktop, 100); } else { clearInterval(autoConnectDesktopTimer); autoConnectDesktopTimer = null; } }
function connectDesktop(e, contype) {
p11clearConsoleMsg();
if (desktop == null) {
desktopNode = currentNode;
if (contype == 2) {
@ -5074,6 +5087,7 @@
function autoConnectTerminal(e) { if (autoConnectTerminalTimer == null) { autoConnectTerminalTimer = setInterval(connectTerminal, 100); } else { clearInterval(autoConnectTerminalTimer); autoConnectTerminalTimer = null; } }
function connectTerminal(e, contype) {
p12clearConsoleMsg();
if (!terminal) {
if (contype == 2) {
// Setup the Intel AMT terminal
@ -5108,7 +5122,6 @@
terminal.attemptWebRTC = attemptWebRTC;
terminal.onStateChanged = onTerminalStateChange;
terminal.onConsoleMessageChange = function () {
console.log('terminal.consoleMessage', terminal.consoleMessage);
p12clearConsoleMsg();
if (terminal.consoleMessage) {
QH('p12TermConsoleMsg', EscapeHtml(terminal.consoleMessage).split('\n').join('<br />'));
@ -5230,6 +5243,7 @@
function autoConnectFiles(e) { if (autoConnectFilesTimer == null) { autoConnectFilesTimer = setInterval(connectFiles, 100); } else { clearInterval(autoConnectFilesTimer); autoConnectFilesTimer = null; } }
function connectFiles(e) {
p13clearConsoleMsg();
if (!files) {
// Setup a mesh agent files
files = CreateAgentRedirect(meshserver, CreateRemoteFiles(p13gotFiles), serverPublicNamePort, authCookie, domainUrl);