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

Added deviceinfo support to meshCtrl.

This commit is contained in:
Ylian Saint-Hilaire 2020-05-02 13:49:56 -07:00
parent 947f320335
commit a2b944cd33
6 changed files with 253 additions and 11 deletions

View file

@ -196,6 +196,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
if (obj.debugmode > 1) { console.log("KRecv(" + str.length + "): " + rstr2hex(str.substring(0, Math.min(str.length, 40)))); }
if (str.length < 4) return;
var cmdmsg = null, X = 0, Y = 0, command = ReadShort(str, 0), cmdsize = ReadShort(str, 2), jumboAdd = 0;
if (obj.recordedData != null) { obj.recordedData.push({ t: Date.now(), d: str }); }
if ((command == 27) && (cmdsize == 8)) {
// Jumbo packet
if (str.length < 12) return;
@ -777,6 +778,18 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
return true;
}
obj.StartRecording = function () {
obj.recordedData = [];
obj.recordedStart = Date.now();
}
obj.StopRecording = function () {
var r = obj.recordedData;
delete obj.recordedData;
delete obj.recordedStart;
return r;
}
// Private method
obj.MuchTheSame = function (a, b) { return (Math.abs(a - b) < 4); }
obj.Debug = function (msg) { console.log(msg); }