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

Added copy in network interface dialog, commented out sysinfo until agent binary fix.

This commit is contained in:
Ylian Saint-Hilaire 2019-08-07 11:08:36 -07:00
parent e684b5ce01
commit 6c1f3cd64d
6 changed files with 33 additions and 24 deletions

View file

@ -822,6 +822,7 @@ function createMeshCore(agent)
sendConsoleText('getScript: ' + JSON.stringify(data));
break;
}
/*
case 'sysinfo': {
// Fetch system information
if (process.platform != 'win32') break; // Remove this when Linux/MacOS support this.
@ -837,7 +838,6 @@ function createMeshCore(agent)
try { delete x.TotalVirtualMemorySize; } catch (ex) { }
try { delete x.TotalVisibleMemorySize; } catch (ex) { }
}
/*
if (process.platform == 'win32')
{
var defragResult = function (r)
@ -857,18 +857,18 @@ function createMeshCore(agent)
if (data.hash != results.hash) { mesh.SendCommand({ "action": "sysinfo", "sessionid": this.sessionid, "data": results }); }
}
}
var pr = require('win-info').defrag({ volume: 'C:' }); // Defrag
var pr = require('win-info').defrag({ volume: 'C:' }); // Defrag TODO
pr.callname = 'defrag';
pr.sessionid = data.sessionid;
pr.then(defragResult, defragResult);
} else {
*/
results.hash = require('SHA384Stream').create().syncHash(JSON.stringify(results)).toString('hex');
if (data.hash != results.hash) { mesh.SendCommand({ "action": "sysinfo", "sessionid": this.sessionid, "data": results }); }
//}
results.hash = require('SHA384Stream').create().syncHash(JSON.stringify(results)).toString('hex');
if (data.hash != results.hash) { mesh.SendCommand({ "action": "sysinfo", "sessionid": this.sessionid, "data": results }); }
}
} catch (ex) { }
break;
}
*/
case 'ping': { mesh.SendCommand('{"action":"pong"}'); break; }
case 'pong': { break; }
default:
@ -1650,7 +1650,7 @@ function createMeshCore(agent)
var response = null;
switch (cmd) {
case 'help': { // Displays available commands
response = 'Available commands: help, info, osinfo, args, print, type, dbget, dbset, dbcompact, eval, parseuri, httpget,\r\nwslist, wsconnect, wssend, wsclose, notify, ls, ps, kill, amt, netinfo, location, power, wakeonlan, scanwifi,\r\nscanamt, setdebug, smbios, rawsmbios, toast, lock, users, sendcaps, openurl, amtreset, amtccm, amtacm,\r\namtdeactivate, amtpolicy, getscript, getclip, setclip, log, av, cpuinfo, sysinfo.';
response = 'Available commands: help, info, osinfo, args, print, type, dbget, dbset, dbcompact, eval, parseuri, httpget,\r\nwslist, wsconnect, wssend, wsclose, notify, ls, ps, kill, amt, netinfo, location, power, wakeonlan, scanwifi,\r\nscanamt, setdebug, smbios, rawsmbios, toast, lock, users, sendcaps, openurl, amtreset, amtccm, amtacm,\r\namtdeactivate, amtpolicy, getscript, getclip, setclip, log, av.'; // cpuinfo, sysinfo
break;
}
/*
@ -1814,6 +1814,7 @@ function createMeshCore(agent)
}
break;
}
/*
case 'cpuinfo': { // Return system information
// CPU & memory utilization
pr = require('sysinfo').cpuUtilization();
@ -1849,6 +1850,7 @@ function createMeshCore(agent)
}
break;
}
*/
case 'info': { // Return information about the agent and agent core module
response = 'Current Core: ' + meshCoreObj.value + '.\r\nAgent Time: ' + Date() + '.\r\nUser Rights: 0x' + rights.toString(16) + '.\r\nPlatform: ' + process.platform + '.\r\nCapabilities: ' + meshCoreObj.caps + '.\r\nServer URL: ' + mesh.ServerUrl + '.';
if (amt != null) { response += '\r\nBuilt-in LMS: ' + ['Disabled', 'Connecting..', 'Connected'][amt.lmsstate] + '.'; }