mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-04 02:15:57 -05:00
Added desktop console message when getting invalid commands.
This commit is contained in:
parent
cbc7a1ec76
commit
051d1acd98
@ -212,7 +212,12 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
|
|||||||
jumboAdd = 8;
|
jumboAdd = 8;
|
||||||
}
|
}
|
||||||
if ((cmdsize != str.length) && (obj.debugmode > 0)) { console.log(cmdsize, str.length, cmdsize == str.length); }
|
if ((cmdsize != str.length) && (obj.debugmode > 0)) { console.log(cmdsize, str.length, cmdsize == str.length); }
|
||||||
if ((command >= 18) && (command != 65) && (command != 88)) { console.error("Invalid KVM command " + command + " of size " + cmdsize); console.log("Invalid KVM data", str.length, rstr2hex(str.substring(0, 40)) + '...'); return; }
|
if ((command >= 18) && (command != 65) && (command != 88)) {
|
||||||
|
console.error("Invalid KVM command " + command + " of size " + cmdsize);
|
||||||
|
console.log("Invalid KVM data", str.length, rstr2hex(str.substring(0, 40)) + '...');
|
||||||
|
if (obj.parent && obj.parent.setConsoleMessage) { obj.parent.setConsoleMessage("Invalid KVM command " + command + " of size " + cmdsize); }
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (cmdsize > str.length) {
|
if (cmdsize > str.length) {
|
||||||
//console.log('KVM accumulator set to ' + str.length + ' bytes, need ' + cmdsize + ' bytes.');
|
//console.log('KVM accumulator set to ' + str.length + ' bytes, need ' + cmdsize + ' bytes.');
|
||||||
obj.accumulator = str;
|
obj.accumulator = str;
|
||||||
@ -287,10 +292,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
|
|||||||
str = str.substring(4);
|
str = str.substring(4);
|
||||||
if (str[0] != '.') {
|
if (str[0] != '.') {
|
||||||
console.log(str); //alert('KVM: ' + str);
|
console.log(str); //alert('KVM: ' + str);
|
||||||
if (obj.parent != null) {
|
if (obj.parent && obj.parent.setConsoleMessage) { obj.parent.setConsoleMessage(str); }
|
||||||
obj.parent.consoleMessage = str;
|
|
||||||
if (obj.parent.onConsoleMessageChange) { obj.parent.onConsoleMessageChange(obj.parent, str); }
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.log('KVM: ' + str.substring(1));
|
console.log('KVM: ' + str.substring(1));
|
||||||
}
|
}
|
||||||
|
@ -72,8 +72,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au
|
|||||||
//console.log(controlMsg);
|
//console.log(controlMsg);
|
||||||
if ((typeof args != 'undefined') && args.redirtrace) { console.log('RedirRecv', controlMsg); }
|
if ((typeof args != 'undefined') && args.redirtrace) { console.log('RedirRecv', controlMsg); }
|
||||||
if (controlMsg.type == 'console') {
|
if (controlMsg.type == 'console') {
|
||||||
obj.consoleMessage = controlMsg.msg;
|
setConsoleMessage(controlMsg.msg);
|
||||||
if (obj.onConsoleMessageChange) { obj.onConsoleMessageChange(obj, obj.consoleMessage); }
|
|
||||||
} else if ((controlMsg.type == 'rtt') && (typeof controlMsg.time == 'number')) {
|
} else if ((controlMsg.type == 'rtt') && (typeof controlMsg.time == 'number')) {
|
||||||
obj.latency.current = (new Date().getTime()) - controlMsg.time;
|
obj.latency.current = (new Date().getTime()) - controlMsg.time;
|
||||||
if (obj.latency.callbacks != null) { obj.latency.callback(obj.latency.current); }
|
if (obj.latency.callbacks != null) { obj.latency.callback(obj.latency.current); }
|
||||||
@ -91,6 +90,13 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set the console message
|
||||||
|
obj.setConsoleMessage = function (str) {
|
||||||
|
if (obj.consoleMessage == str) return;
|
||||||
|
obj.consoleMessage = str;
|
||||||
|
if (obj.onConsoleMessageChange) { obj.onConsoleMessageChange(obj, obj.consoleMessage); }
|
||||||
|
}
|
||||||
|
|
||||||
obj.sendCtrlMsg = function (x) { if (obj.ctrlMsgAllowed == true) { if ((typeof args != 'undefined') && args.redirtrace) { console.log('RedirSend', typeof x, x); } try { obj.socket.send(x); } catch (ex) { } } }
|
obj.sendCtrlMsg = function (x) { if (obj.ctrlMsgAllowed == true) { if ((typeof args != 'undefined') && args.redirtrace) { console.log('RedirSend', typeof x, x); } try { obj.socket.send(x); } catch (ex) { } } }
|
||||||
|
|
||||||
function performWebRtcSwitch() {
|
function performWebRtcSwitch() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user