mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-26 22:23:14 -05:00
updated sysinfo/volumes
This commit is contained in:
parent
25ca362e15
commit
2739432997
@ -1272,8 +1272,10 @@ function onFileWatcher(a, b) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function getSystemInformation(func) {
|
function getSystemInformation(func) {
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
var results = { hardware: require('identifiers').get() }; // Hardware info
|
var results = { hardware: require('identifiers').get() }; // Hardware info
|
||||||
|
|
||||||
if (results.hardware && results.hardware.windows) {
|
if (results.hardware && results.hardware.windows) {
|
||||||
// Remove extra entries and things that change quickly
|
// Remove extra entries and things that change quickly
|
||||||
var x = results.hardware.windows.osinfo;
|
var x = results.hardware.windows.osinfo;
|
||||||
@ -1290,43 +1292,39 @@ function getSystemInformation(func) {
|
|||||||
if (results.hardware.windows.partitions) { for (var i in results.hardware.windows.partitions) { delete results.hardware.windows.partitions[i].Node; } }
|
if (results.hardware.windows.partitions) { for (var i in results.hardware.windows.partitions) { delete results.hardware.windows.partitions[i].Node; } }
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
}
|
}
|
||||||
if (process.platform == 'win32') {
|
|
||||||
results.pendingReboot = require('win-info').pendingReboot(); // Pending reboot
|
|
||||||
if (require('identifiers').volumes != null) {
|
|
||||||
try {
|
|
||||||
results.volumes = require('identifiers').volumes();
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
results.hardware.agentvers = process.versions;
|
results.hardware.agentvers = process.versions;
|
||||||
|
|
||||||
/*
|
if (process.platform == 'win32')
|
||||||
if (process.platform == 'win32') {
|
{
|
||||||
var defragResult = function (r) {
|
results.pendingReboot = require('win-info').pendingReboot(); // Pending reboot
|
||||||
if (typeof r == 'object') { results[this.callname] = r; }
|
|
||||||
if (this.callname == 'defrag') {
|
if (require('identifiers').volumes_promise != null)
|
||||||
var pr = require('win-info').installedApps(); // Installed apps
|
{
|
||||||
pr.callname = 'installedApps';
|
var p = require('identifiers').volumes_promise();
|
||||||
pr.sessionid = data.sessionid;
|
p.then(function (res)
|
||||||
pr.then(defragResult, defragResult);
|
{
|
||||||
}
|
results.volumes = res;
|
||||||
else {
|
|
||||||
results.winpatches = require('win-info').qfe(); // Windows patches
|
|
||||||
results.hash = require('SHA384Stream').create().syncHash(JSON.stringify(results)).toString('hex');
|
results.hash = require('SHA384Stream').create().syncHash(JSON.stringify(results)).toString('hex');
|
||||||
func(results);
|
func(results);
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
var pr = require('win-info').defrag({ volume: 'C:' }); // Defrag TODO
|
else if (require('identifiers').volumes != null)
|
||||||
pr.callname = 'defrag';
|
{
|
||||||
pr.sessionid = data.sessionid;
|
results.volumes = require('identifiers').volumes();
|
||||||
pr.then(defragResult, defragResult);
|
results.hash = require('SHA384Stream').create().syncHash(JSON.stringify(results)).toString('hex');
|
||||||
} else {
|
func(results);
|
||||||
*/
|
}
|
||||||
results.hash = require('SHA384Stream').create().syncHash(JSON.stringify(results)).toString('hex');
|
else
|
||||||
func(results);
|
{
|
||||||
//}
|
results.hash = require('SHA384Stream').create().syncHash(JSON.stringify(results)).toString('hex');
|
||||||
|
func(results);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
results.hash = require('SHA384Stream').create().syncHash(JSON.stringify(results)).toString('hex');
|
||||||
|
func(results);
|
||||||
|
}
|
||||||
} catch (e) { func(null, e); }
|
} catch (e) { func(null, e); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user