systeminformation 5.18.2 → 5.18.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/docker.js CHANGED
@@ -484,7 +484,7 @@ function dockerContainerStats(containerIDs, callback) {
484
484
  containerArray = [];
485
485
  dockerContainers().then(allContainers => {
486
486
  for (let container of allContainers) {
487
- containerArray.push(container.id);
487
+ containerArray.push(container.id.substring(0, 12));
488
488
  }
489
489
  if (containerArray.length) {
490
490
  dockerContainerStats(containerArray.join(',')).then(result => {
@@ -555,8 +555,8 @@ function dockerContainerStatsSingle(containerID) {
555
555
  _docker_socket.getStats(containerID, data => {
556
556
  try {
557
557
  let stats = data;
558
-
559
558
  if (!stats.message) {
559
+ if (data.id) { result.id = data.id; }
560
560
  result.memUsage = (stats.memory_stats && stats.memory_stats.usage ? stats.memory_stats.usage : 0);
561
561
  result.memLimit = (stats.memory_stats && stats.memory_stats.limit ? stats.memory_stats.limit : 0);
562
562
  result.memPercent = (stats.memory_stats && stats.memory_stats.usage && stats.memory_stats.limit ? stats.memory_stats.usage / stats.memory_stats.limit * 100.0 : 0);
package/lib/graphics.js CHANGED
@@ -669,17 +669,17 @@ function graphics(callback) {
669
669
  } catch (e) {
670
670
  util.noop();
671
671
  }
672
- stdout = execSync('defaults read /Library/Preferences/com.apple.windowserver.plist 2>/dev/null;defaults read /Library/Preferences/com.apple.windowserver.displays.plist 2>/dev/null; echo ""');
672
+ stdout = execSync('defaults read /Library/Preferences/com.apple.windowserver.plist 2>/dev/null;defaults read /Library/Preferences/com.apple.windowserver.displays.plist 2>/dev/null; echo ""', { maxBuffer: 1024 * 20000 });
673
673
  const output = (stdout || '').toString();
674
674
  const obj = util.plistReader(output);
675
675
  if (obj['DisplayAnyUserSets'] && obj['DisplayAnyUserSets']['Configs'] && obj['DisplayAnyUserSets']['Configs'][0] && obj['DisplayAnyUserSets']['Configs'][0]['DisplayConfig']) {
676
676
  const current = obj['DisplayAnyUserSets']['Configs'][0]['DisplayConfig'];
677
677
  let i = 0;
678
678
  current.forEach((o) => {
679
- if (o['CurrentInfo'] && 'OriginX' in o['CurrentInfo'] && result.displays && result.displays[i]) {
679
+ if (o['CurrentInfo'] && o['CurrentInfo']['OriginX'] !== undefined && result.displays && result.displays[i]) {
680
680
  result.displays[i].positionX = o['CurrentInfo']['OriginX'];
681
681
  }
682
- if (o['CurrentInfo'] && 'OriginY' in o['CurrentInfo'] && result.displays && result.displays[i]) {
682
+ if (o['CurrentInfo'] && o['CurrentInfo']['OriginY'] !== undefined && result.displays && result.displays[i]) {
683
683
  result.displays[i].positionY = o['CurrentInfo']['OriginY'];
684
684
  }
685
685
  i++;
@@ -695,7 +695,7 @@ function graphics(callback) {
695
695
  if ('OriginY' in o && result.displays && result.displays[i]) {
696
696
  result.displays[i].positionY = o['OriginY'];
697
697
  }
698
- if (o['Mode'] && 'BitsPerPixel' in o['Mode'] && result.displays && result.displays[i]) {
698
+ if (o['Mode'] && o['Mode']['BitsPerPixel'] !== undefined && result.displays && result.displays[i]) {
699
699
  result.displays[i].pixelDepth = o['Mode']['BitsPerPixel'];
700
700
  }
701
701
  i++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.18.2",
3
+ "version": "5.18.4",
4
4
  "description": "Advanced, lightweight system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",