mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-11-22 04:33:16 +03:00
add Capacity Remaining
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
parent
26bb350122
commit
0b2368df9d
@ -5723,6 +5723,7 @@ function cleanGetBitLockerVolumeInfo(volumes) {
|
||||
for (var i in volumes) {
|
||||
const v = volumes[i];
|
||||
if (typeof v.size == 'string') { v.size = parseInt(v.size); }
|
||||
if (typeof v.sizeremaining == 'string') { v.sizeremaining = parseInt(v.sizeremaining); }
|
||||
if (v.identifier == '') { delete v.identifier; }
|
||||
if (v.name == '') { delete v.name; }
|
||||
if (v.removable != true) { delete v.removable; }
|
||||
|
@ -390,7 +390,7 @@ function windows_volumes()
|
||||
p1.child = child;
|
||||
child.promise = p1;
|
||||
child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); });
|
||||
child.stdin.write('Get-Volume | Select-Object -Property DriveLetter,FileSystemLabel,FileSystemType,Size,DriveType | ConvertTo-Csv -NoTypeInformation\nexit\n');
|
||||
child.stdin.write('Get-Volume | Select-Object -Property DriveLetter,FileSystemLabel,FileSystemType,Size,SizeRemaining,DriveType | ConvertTo-Csv -NoTypeInformation\nexit\n');
|
||||
child.on('exit', function (c)
|
||||
{
|
||||
var a, i, tokens, key;
|
||||
@ -407,7 +407,8 @@ function windows_volumes()
|
||||
name: tokens[1].split('"')[1],
|
||||
type: tokens[2].split('"')[1],
|
||||
size: tokens[3].split('"')[1],
|
||||
removable: tokens[4].split('"')[1] == 'Removable'
|
||||
sizeremaining: tokens[4].split('"')[1],
|
||||
removable: tokens[5].split('"')[1] == 'Removable'
|
||||
};
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -6152,6 +6152,12 @@
|
||||
var fsize = (j === 0 ? `${m.size} ${sizes[j]}` : `${(m.size / (1024 ** j)).toFixed(2)} ${sizes[j]}`);
|
||||
x += addDetailItem("Capacity", EscapeHtml(fsize), s);
|
||||
}
|
||||
if (m.sizeremaining) {
|
||||
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
||||
var j = parseInt(Math.floor(Math.log(Math.abs(m.sizeremaining)) / Math.log(1024)), 10);
|
||||
var fsize = (j === 0 ? `${m.sizeremaining} ${sizes[j]}` : `${(m.sizeremaining / (1024 ** j)).toFixed(2)} ${sizes[j]}`);
|
||||
x += addDetailItem("Capacity Remaining", EscapeHtml(fsize), s);
|
||||
}
|
||||
if (m.type) { x += addDetailItem("File System", (m.removable == true ? ("Removable" + ' / ') : '') + (m.type == 'Unknown' ? "Unknown" : EscapeHtml(m.type)), s); }
|
||||
|
||||
if (m.protectionStatus || m.volumeStatus) {
|
||||
|
@ -12134,6 +12134,12 @@
|
||||
var fsize = (j === 0 ? `${m.size} ${sizes[j]}` : `${(m.size / (1024 ** j)).toFixed(2)} ${sizes[j]}`);
|
||||
x += addDetailItem("Capacity", EscapeHtml(fsize), s);
|
||||
}
|
||||
if (m.sizeremaining) {
|
||||
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
||||
var j = parseInt(Math.floor(Math.log(Math.abs(m.sizeremaining)) / Math.log(1024)), 10);
|
||||
var fsize = (j === 0 ? `${m.sizeremaining} ${sizes[j]}` : `${(m.sizeremaining / (1024 ** j)).toFixed(2)} ${sizes[j]}`);
|
||||
x += addDetailItem("Capacity Remaining", EscapeHtml(fsize), s);
|
||||
}
|
||||
if (m.type) { x += addDetailItem("File System", (m.removable == true ? ("Removable" + ' / ') : '') + (m.type == 'Unknown' ? "Unknown" : EscapeHtml(m.type)), s); }
|
||||
|
||||
if (m.protectionStatus || m.volumeStatus) {
|
||||
|
Loading…
Reference in New Issue
Block a user