diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e4c0e9..d2ca0f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,47 +72,48 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | -| 5.3.5 | 2020-02-23 | `dockerContainerStats()` fixed parameter * | -| 5.3.4 | 2020-02-20 | `sanitizeShellString()` optimized strict sanitation | -| 5.3.3 | 2020-02-15 | `dockerContainerStats()` fixed ID splitting | -| 5.3.2 | 2020-02-15 | `inetLatency()` `ineChecksite()` fixed possible security issue (file://) | -| 5.3.1 | 2020-02-14 | `inetLatency()` `ineChecksite()` `servcices()` `processes()` fixed possible security issue (arrays) | -| 5.3.0 | 2020-02-12 | `osInfo()` added remoteSession (windows) | -| 5.2.7 | 2020-02-12 | `fsStats()`, `blockDevices()` improved linux | -| 5.2.6 | 2020-02-12 | `inetLatency()` fixed possible DOS intrusion | -| 5.2.5 | 2020-02-11 | `processes()` fixed truncated params (linux) | -| 5.2.4 | 2020-02-11 | `currentLoad()` fixed issue | -| 5.2.3 | 2020-02-11 | `diskLayout()` added USB drives (mac OS) | -| 5.2.2 | 2020-02-11 | code cleanup, updated docs | -| 5.2.1 | 2020-02-10 | `system()` fixed issue virtual detect (linux) | -| 5.2.0 | 2020-02-10 | `wifiInterfces()` and `wifiConnections()` added | -| 5.1.2 | 2020-02-08 | fixed node 4 compatibility issue | -| 5.1.1 | 2020-02-08 | `baseboard()` added memMax, memSlots, smaller improvements Raspberry | -| 5.1.0 | 2020-02-08 | `memLayout()` added ECC flag, `bios()` added language, features (linux) | -| 5.0.11 | 2020-02-07 | `fsSize()` fixed windows WSL issue | -| 5.0.10 | 2020-02-06 | `getDynamicData()` fixed windows WSL issue | -| 5.0.9 | 2020-02-02 | `fsSize()` fixed parsing edge case issue mac OS | -| 5.0.8 | 2020-01-30 | typescript typings fix cpuCurrentSpeed | -| 5.0.7 | 2020-01-29 | `fsSize()` available fixed windows and typescript typings | -| 5.0.6 | 2020-01-28 | `osinfo()` added hypervisor (win only) | -| 5.0.5 | 2020-01-27 | `networkInterfaces()` type detection improved (win) | -| 5.0.4 | 2020-01-27 | `cpu()` improved manufacturer decoding (linux) | -| 5.0.3 | 2020-01-27 | `cpu()` fix virtualization, `wifi()` fix raspberry | -| 5.0.2 | 2020-01-26 | updated typescript typings | -| 5.0.1 | 2020-01-26 | code cleanup | -| 5.0.0 | 2020-01-26 | new major version 5 release | -| 4.34.9 | 2020-01-25 | `graphics()` virtual controller vram value fix (win) | -| 4.34.8 | 2020-01-25 | `graphics()` controller subDeviceId fix (win) | -| 4.34.7 | 2020-01-13 | `services()` improved service discovery (linux) | -| 4.34.6 | 2020-01-12 | `networkInterfaces()` catch errors | -| 4.34.5 | 2020-01-07 | `networkInterfaceDefault()` fixed CMD popup (windows) | -| 4.34.4 | 2020-01-06 | `system()` fixed vitrual catch error | -| 4.34.3 | 2020-01-06 | `graphics()` fixed non nvidia-smi controllers (win) | -| 4.34.2 | 2020-01-05 | `system()` uuid lowercase as in uuid() | -| 4.34.1 | 2020-01-05 | `graphics()` nvidia-smi detection improved | -| 4.34.0 | 2020-01-05 | `system()` added flag virtual | -| 4.33.8 | 2020-01-04 | `virtualBox()` fix issue windows host | -| 4.33.7 | 2020-01-04 | `graphics()` nvidia-smi detection improved | +| 5.4.0 | 2021-02-24 | `dockerImages()` added | +| 5.3.5 | 2021-02-23 | `dockerContainerStats()` fixed parameter * | +| 5.3.4 | 2021-02-20 | `sanitizeShellString()` optimized strict sanitation | +| 5.3.3 | 2021-02-15 | `dockerContainerStats()` fixed ID splitting | +| 5.3.2 | 2021-02-15 | `inetLatency()` `ineChecksite()` fixed possible security issue (file://) | +| 5.3.1 | 2021-02-14 | `inetLatency()` `ineChecksite()` `servcices()` `processes()` fixed possible security issue (arrays) | +| 5.3.0 | 2021-02-12 | `osInfo()` added remoteSession (windows) | +| 5.2.7 | 2021-02-12 | `fsStats()`, `blockDevices()` improved linux | +| 5.2.6 | 2021-02-12 | `inetLatency()` fixed possible DOS intrusion | +| 5.2.5 | 2021-02-11 | `processes()` fixed truncated params (linux) | +| 5.2.4 | 2021-02-11 | `currentLoad()` fixed issue | +| 5.2.3 | 2021-02-11 | `diskLayout()` added USB drives (mac OS) | +| 5.2.2 | 2021-02-11 | code cleanup, updated docs | +| 5.2.1 | 2021-02-10 | `system()` fixed issue virtual detect (linux) | +| 5.2.0 | 2021-02-10 | `wifiInterfces()` and `wifiConnections()` added | +| 5.1.2 | 2021-02-08 | fixed node 4 compatibility issue | +| 5.1.1 | 2021-02-08 | `baseboard()` added memMax, memSlots, smaller improvements Raspberry | +| 5.1.0 | 2021-02-08 | `memLayout()` added ECC flag, `bios()` added language, features (linux) | +| 5.0.11 | 2021-02-07 | `fsSize()` fixed windows WSL issue | +| 5.0.10 | 2021-02-06 | `getDynamicData()` fixed windows WSL issue | +| 5.0.9 | 2021-02-02 | `fsSize()` fixed parsing edge case issue mac OS | +| 5.0.8 | 2021-01-30 | typescript typings fix cpuCurrentSpeed | +| 5.0.7 | 2021-01-29 | `fsSize()` available fixed windows and typescript typings | +| 5.0.6 | 2021-01-28 | `osinfo()` added hypervisor (win only) | +| 5.0.5 | 2021-01-27 | `networkInterfaces()` type detection improved (win) | +| 5.0.4 | 2021-01-27 | `cpu()` improved manufacturer decoding (linux) | +| 5.0.3 | 2021-01-27 | `cpu()` fix virtualization, `wifi()` fix raspberry | +| 5.0.2 | 2021-01-26 | updated typescript typings | +| 5.0.1 | 2021-01-26 | code cleanup | +| 5.0.0 | 2021-01-26 | new major version 5 release | +| 4.34.9 | 2021-01-25 | `graphics()` virtual controller vram value fix (win) | +| 4.34.8 | 2021-01-25 | `graphics()` controller subDeviceId fix (win) | +| 4.34.7 | 2021-01-13 | `services()` improved service discovery (linux) | +| 4.34.6 | 2021-01-12 | `networkInterfaces()` catch errors | +| 4.34.5 | 2021-01-07 | `networkInterfaceDefault()` fixed CMD popup (windows) | +| 4.34.4 | 2021-01-06 | `system()` fixed vitrual catch error | +| 4.34.3 | 2021-01-06 | `graphics()` fixed non nvidia-smi controllers (win) | +| 4.34.2 | 2021-01-05 | `system()` uuid lowercase as in uuid() | +| 4.34.1 | 2021-01-05 | `graphics()` nvidia-smi detection improved | +| 4.34.0 | 2021-01-05 | `system()` added flag virtual | +| 4.33.8 | 2021-01-04 | `virtualBox()` fix issue windows host | +| 4.33.7 | 2021-01-04 | `graphics()` nvidia-smi detection improved | | 4.33.6 | 2021-01-02 | `dockerContainerStats()` fix `tx` changed to `wx` as documented | | 4.33.5 | 2020-12-30 | `graphics()` vram (nvidia-smi) | | 4.33.4 | 2020-12-28 | `typescript` typings fix | diff --git a/README.md b/README.md index f1f5956..633ab4b 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ This next major version release 5.0 comes with new functionality and several imp - added audio: get detailed audio device information - added bluetooth: get detailed bluetooth device information +- added dockerImages: get detailed information about docker images - added printer: get information from detected printers - added usb: get detailed usb controller and device information - added wifi interfaces ans connections: extended wifi information @@ -102,6 +103,7 @@ si.cpu() (last 7 major and minor version releases) +- Version 5.4.0: `dockerImages()` added - Version 5.3.0: `osInfo()` added remoteSession (win only) - Version 5.2.0: `wifiInterfaces()` and `wifiConnections()` added - Version 5.1.0: `memLayout()` added ECC flag, `bios()` added language, features (linux) @@ -668,6 +670,25 @@ Full function reference with examples can be found at [https://systeminformation | | isolation | X | X | X | X | X | isolation | | | initBinary | X | X | X | X | X | init binary | | | productLicense | X | X | X | X | X | product license | +| si.dockerImages(all, cb) | [{...}] | X | X | X | X | X | returns array of top level/all docker images | +| | [0].id | X | X | X | X | X | image ID | +| | [0].container | X | X | X | X | X | container ID | +| | [0].comment | X | X | X | X | X | comment | +| | [0].os | X | X | X | X | X | OS | +| | [0].architecture | X | X | X | X | X | architecture | +| | [0].parent | X | X | X | X | X | parent ID | +| | [0].dockerVersion | X | X | X | X | X | docker version | +| | [0].size | X | X | X | X | X | image size | +| | [0].sharedSize | X | X | X | X | X | shared size | +| | [0].virtualSize | X | X | X | X | X | virtual size | +| | [0].author | X | X | X | X | X | author | +| | [0].created | X | X | X | X | X | created date / time | +| | [0].containerConfig | X | X | X | X | X | container config object | +| | [0].graphDriver | X | X | X | X | X | graph driver object | +| | [0].repoDigests | X | X | X | X | X | repo digests array | +| | [0].repoTags | X | X | X | X | X | repo tags array | +| | [0].config | X | X | X | X | X | config object | +| | [0].rootFS | X | X | X | X | X | root fs object | | si.dockerContainers(all, cb) | [{...}] | X | X | X | X | X | returns array of active/all docker containers | | | [0].id | X | X | X | X | X | ID of container | | | [0].name | X | X | X | X | X | name of container | diff --git a/docs/docker.html b/docs/docker.html index 3c6dabd..cd1a616 100644 --- a/docs/docker.html +++ b/docs/docker.html @@ -47,7 +47,7 @@
Docker
-

In this section you will learn how to get information about docker containers, stats and processes inside a docker container:

+

In this section you will learn how to get information about docker, images, containers, container stats and processes inside a docker container:

For function reference and examples we assume, that we imported systeminformation as follows:

const si = require('systeminformation');

Container, Stats, Processes

@@ -536,6 +536,196 @@ X product license + + si.dockerImages(all, cb) + [{...}] + X + X + X + X + X + returns array of top level/all docker images + + + + [0].id + X + X + X + X + X + image ID + + + + [0].container + X + X + X + X + X + container ID + + + + [0].comment + X + X + X + X + X + comment + + + + [0].os + X + X + X + X + X + OS + + + + [0].architecture + X + X + X + X + X + architecture + + + + [0].parent + X + X + X + X + X + parent ID + + + + [0].dockerVersion + X + X + X + X + X + docker version + + + + [0].size + X + X + X + X + X + image size + + + + [0].sharedSize + X + X + X + X + X + shared size + + + + [0].virtualSize + X + X + X + X + X + virtual size + + + + [0].author + X + X + X + X + X + author + + + + [0].created + X + X + X + X + X + created date / time + + + + [0].containerConfig + X + X + X + X + X + container config object + + + + [0].graphDriver + X + X + X + X + X + graph driver object + + + + [0].repoDigests + X + X + X + X + X + repo digests array + + + + [0].repoTags + X + X + X + X + X + repo tags array + + + + [0].config + X + X + X + X + X + config object + + + + [0].rootFS + X + X + X + X + X + root fs object + si.dockerContainers(all, cb) [{...}] diff --git a/docs/history.html b/docs/history.html index 8840d75..7837c16 100644 --- a/docs/history.html +++ b/docs/history.html @@ -56,209 +56,214 @@ + + 5.4.0 + 2021-02-24 + dockerImages() added + 5.3.5 - 2020-02-23 + 2021-02-23 dockerContainerStats() fixed issue parameter * 5.3.4 - 2020-02-20 + 2021-02-20 sanitizeShellString() optimized strict sanitation 5.3.3 - 2020-02-15 + 2021-02-15 dockerContainerStats() fix correct ID splitting 5.3.2 - 2020-02-15 + 2021-02-15 inetLatency() inetChecksite() fix possible security issue (file://) 5.3.1 - 2020-02-14 + 2021-02-14 inetLatency() inetChecksite() services() processLoad() fix possible security issue 5.3.0 - 2020-02-12 + 2021-02-12 osInfo() added remoteSession (windows) 5.2.7 - 2020-02-12 + 2021-02-12 fsStats() and blockdevices() improvements (linux) 5.2.6 - 2020-02-12 + 2021-02-12 inetLatency() fix DOS vulnerability 5.2.5 - 2020-02-11 + 2021-02-11 processes() fix truncated params (linux) 5.2.4 - 2020-02-11 + 2021-02-11 currentLoad() fix issue 5.2.3 - 2020-02-11 + 2021-02-11 diskLayout() added USB drives (mac OS) 5.2.2 - 2020-02-11 + 2021-02-11 code cleanup, updated docs 5.2.1 - 2020-02-10 + 2021-02-10 system() fixed issue virtual detect (linux) 5.2.0 - 2020-02-10 + 2021-02-10 wifiInterfces() and wifiConnections() added 5.1.2 - 2020-02-08 + 2021-02-08 fixed node 4 compatibility issue 5.1.1 - 2020-02-08 + 2021-02-08 baseboard() added memMax, memSlots 5.1.0 - 2020-02-08 + 2021-02-08 memLayout() added ECC flag, bios() added language, features (linux) 5.0.11 - 2020-02-07 + 2021-02-07 fsSize() windows WSL fix 5.0.10 - 2020-02-06 + 2021-02-06 getDynamicData() windows WSL fix 5.0.9 - 2020-02-02 + 2021-02-02 fsSize() fixed parsing edge case issue mac OS 5.0.8 - 2020-01-30 + 2021-01-30 typescript typings fix cpuCurrentSpeed 5.0.7 - 2020-01-29 + 2021-01-29 fsSize() available fixed windows and typescript typings 5.0.6 - 2020-01-28 + 2021-01-28 osInfo() added hypervisor (win only) 5.0.5 - 2020-01-27 + 2021-01-27 networkInterfaces() type detection improved (win) 5.0.4 - 2020-01-27 + 2021-01-27 memoryLayout() improved manufacturer decoding (linux) 5.0.3 - 2020-01-27 + 2021-01-27 cpu() fix virtualization, wifi() fix raspberry 5.0.2 - 2020-01-26 + 2021-01-26 updated typescript typings 5.0.1 - 2020-01-26 + 2021-01-26 code cleanup 5.0.0 - 2020-01-26 + 2021-01-26 new major version 5 release 4.34.9 - 2020-01-25 + 2021-01-25 graphics() virtual controller vram value fix (win) 4.34.8 - 2020-01-25 + 2021-01-25 graphics() controller subDeviceId fix (win) 4.34.7 - 2020-01-13 + 2021-01-13 services() improved service discovery linux 4.34.6 - 2020-01-12 + 2021-01-12 networkInterfaces() catch errors 4.34.5 - 2020-01-07 + 2021-01-07 networkInterfaceDefault() fixed CMD popup (windows) 4.34.4 - 2020-01-06 + 2021-01-06 system() fixed vitrual catch error 4.34.3 - 2020-01-06 + 2021-01-06 graphics() issue non nvidia-smi controllers fixed (win) 4.34.2 - 2020-01-05 + 2021-01-05 system() uuid now lowercase - as in uuid() 4.34.1 - 2020-01-05 + 2021-01-05 graphics() nvidia-smi detection improved 4.34.0 - 2020-01-05 + 2021-01-05 system() added flag virtual 4.33.8 - 2020-01-04 + 2021-01-04 virtualBox() fix issue windows host 4.33.7 - 2020-01-04 + 2021-01-04 graphics() nvidia-smi detection improved diff --git a/docs/index.html b/docs/index.html index fdf6984..6297938 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.3.5
+
New Version: 5.4.0
@@ -201,7 +201,7 @@
-
13,833
+
14,053
Lines of code
diff --git a/lib/docker.js b/lib/docker.js index 68f235a..e4d3678 100644 --- a/lib/docker.js +++ b/lib/docker.js @@ -91,6 +91,115 @@ function dockerInfo(callback) { exports.dockerInfo = dockerInfo; +function dockerImages(all, callback) { + + // fallback - if only callback is given + if (util.isFunction(all) && !callback) { + callback = all; + all = false; + } + if (typeof all !== 'boolean' && all !== undefined) { + all = false; + } + + all = all || false; + let result = []; + return new Promise((resolve) => { + process.nextTick(() => { + if (!_docker_socket) { + _docker_socket = new DockerSocket(); + } + const workload = []; + + _docker_socket.listImages(all, data => { + let dockerImages = {}; + try { + dockerImages = data; + if (dockerImages && Object.prototype.toString.call(dockerImages) === '[object Array]' && dockerImages.length > 0) { + + dockerImages.forEach(function (element) { + + if (element.Names && Object.prototype.toString.call(element.Names) === '[object Array]' && element.Names.length > 0) { + element.Name = element.Names[0].replace(/^\/|\/$/g, ''); + } + workload.push(dockerImagesInspect(element.Id.trim(), element)); + }); + if (workload.length) { + Promise.all( + workload + ).then(data => { + if (callback) { callback(data); } + resolve(data); + }); + } else { + if (callback) { callback(result); } + resolve(result); + } + } else { + if (callback) { callback(result); } + resolve(result); + } + } catch (err) { + if (callback) { callback(result); } + resolve(result); + } + }); + }); + }); +} + +// -------------------------- +// container inspect (for one container) + +function dockerImagesInspect(imageID, payload) { + return new Promise((resolve) => { + process.nextTick(() => { + imageID = imageID || ''; + if (typeof imageID !== 'string') { + resolve(); + } + const imageIDSanitized = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(imageID, true)).trim(); + if (imageIDSanitized) { + + if (!_docker_socket) { + _docker_socket = new DockerSocket(); + } + + _docker_socket.inspectImage(imageIDSanitized.trim(), data => { + try { + resolve({ + id: payload.Id, + container: data.Container, + comment: data.Comment, + os: data.Os, + architecture: data.Architecture, + parent: data.Parent, + dockerVersion: data.DockerVersion, + size: data.Size, + sharedSize: payload.SharedSize, + virtualSize: data.VirtualSize, + author: data.Author, + created: data.Created ? Math.round(new Date(data.Created).getTime() / 1000) : 0, + containerConfig: data.ContainerConfig ? data.ContainerConfig : {}, + graphDriver: data.GraphDriver ? data.GraphDriver : {}, + repoDigests: data.RepoDigests ? data.RepoDigests : {}, + repoTags: data.RepoTags ? data.RepoTags : {}, + config: data.Config ? data.Config : {}, + rootFS: data.RootFS ? data.RootFS : {}, + }); + } catch (err) { + resolve(); + } + }); + } else { + resolve(); + } + }); + }); +} + +exports.dockerImages = dockerImages; + function dockerContainers(all, callback) { function inContainers(containers, id) { diff --git a/lib/dockerSocket.js b/lib/dockerSocket.js index 86c68d4..a9d5ea6 100644 --- a/lib/dockerSocket.js +++ b/lib/dockerSocket.js @@ -55,6 +55,82 @@ class DockerSocket { } } + listImages(all, callback) { + try { + + let socket = net.createConnection({ path: socketPath }); + let alldata = ''; + let data; + + socket.on('connect', () => { + socket.write('GET http:/images/json' + (all ? '?all=1' : '') + ' HTTP/1.0\r\n\r\n'); + }); + + socket.on('data', data => { + alldata = alldata + data.toString(); + }); + + socket.on('error', () => { + socket = false; + callback({}); + }); + + socket.on('end', () => { + let startbody = alldata.indexOf('\r\n\r\n'); + alldata = alldata.substring(startbody + 4); + socket = false; + try { + data = JSON.parse(alldata); + callback(data); + } catch (err) { + callback({}); + } + }); + } catch (err) { + callback({}); + } + } + + inspectImage(id, callback) { + id = id || ''; + if (id) { + try { + let socket = net.createConnection({ path: socketPath }); + let alldata = ''; + let data; + + socket.on('connect', () => { + socket.write('GET http:/images/' + id + '/json?stream=0 HTTP/1.0\r\n\r\n'); + }); + + socket.on('data', data => { + alldata = alldata + data.toString(); + }); + + socket.on('error', () => { + socket = false; + callback({}); + }); + + socket.on('end', () => { + let startbody = alldata.indexOf('\r\n\r\n'); + alldata = alldata.substring(startbody + 4); + socket = false; + try { + data = JSON.parse(alldata); + callback(data); + } catch (err) { + callback({}); + } + }); + } catch (err) { + callback({}); + } + } else { + callback({}); + } + } + listContainers(all, callback) { try { @@ -91,6 +167,57 @@ class DockerSocket { } } + listVolumes(filter, callback) { + try { + + let socket = net.createConnection({ path: socketPath }); + let alldata = ''; + let data; + + filter = filter || {}; + let filterString = ''; + if (filter.dangling && typeof filter.dangling === 'boolean') { + filterString += (filterString ? '&' : '') + 'dangling=true'; + } + if (filter.driver && typeof filter.driver === 'string') { + filterString += (filterString ? '&' : '') + `driver=${filter.driver}`; + } + if (filter.label && typeof filter.label === 'string') { + filterString += (filterString ? '&' : '') + `label=${filter.label}`; + } + if (filter.name && typeof filter.name === 'string') { + filterString += (filterString ? '&' : '') + `name=${filter.name}`; + } + + socket.on('connect', () => { + socket.write('GET http:/volumes/' + (filterString ? `?${filterString}` : '') + ' HTTP/1.0\r\n\r\n'); + }); + + socket.on('data', data => { + alldata = alldata + data.toString(); + }); + + socket.on('error', () => { + socket = false; + callback({}); + }); + + socket.on('end', () => { + let startbody = alldata.indexOf('\r\n\r\n'); + alldata = alldata.substring(startbody + 4); + socket = false; + try { + data = JSON.parse(alldata); + callback(data); + } catch (err) { + callback({}); + } + }); + } catch (err) { + callback({}); + } + } + getStats(id, callback) { id = id || ''; if (id) { diff --git a/lib/index.d.ts b/lib/index.d.ts index 2b7d134..889d33b 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -641,6 +641,27 @@ export namespace Systeminformation { productLicense: string; } + interface DockerImageData { + id: string; + container: string; + comment: string; + os: string; + architecture: string; + parent: string; + dockerVersion: string; + size: number; + sharedSize: number; + virtualSize: number; + author: string; + created: number; + containerConfig: any; + graphDriver: any; + repoDigests: any; + repoTags: any; + config: any; + rootFS: any; + } + interface DockerContainerData { id: string; name: string; @@ -851,6 +872,7 @@ export function processLoad(processName: string, cb?: (data: Systeminformation.P export function services(serviceName: string, cb?: (data: Systeminformation.ServicesData[]) => any): Promise; export function dockerInfo(cb?: (data: Systeminformation.DockerInfoData) => any): Promise; +export function dockerImages(all?: boolean, cb?: (data: dockerstats.DockerImageData[]) => any): Promise; export function dockerContainers(all?: boolean, cb?: (data: Systeminformation.DockerContainerData[]) => any): Promise; export function dockerContainerStats(id?: string, cb?: (data: Systeminformation.DockerContainerStatsData[]) => any): Promise; export function dockerContainerProcesses(id?: string, cb?: (data: any) => any): Promise; diff --git a/lib/index.js b/lib/index.js index dc2a67b..cd365ac 100755 --- a/lib/index.js +++ b/lib/index.js @@ -482,6 +482,7 @@ exports.inetChecksite = internet.inetChecksite; exports.inetLatency = internet.inetLatency; exports.dockerInfo = docker.dockerInfo; +exports.dockerImages = docker.dockerImages; exports.dockerContainers = docker.dockerContainers; exports.dockerContainerStats = docker.dockerContainerStats; exports.dockerContainerProcesses = docker.dockerContainerProcesses; diff --git a/test/si.js b/test/si.js index e8f8375..513d122 100644 --- a/test/si.js +++ b/test/si.js @@ -49,10 +49,10 @@ function test(f) { else if (f === '4') { si.networkStats().then(data => { if (data !== null) { resolve({ data, title: 'NET Stats' }); } else { resolve('not_supported'); } }); } else if (f === '5') { si.networkConnections().then(data => { if (data !== null) { resolve({ data, title: 'NET Connections' }); } else { resolve('not_supported'); } }); } else if (f === '6') { si.dockerInfo().then(data => { if (data !== null) { resolve({ data, title: 'Docker Info' }); } else { resolve('not_supported'); } }); } - else if (f === '7') { si.dockerContainers(true).then(data => { if (data !== null) { resolve({ data, title: 'Docker Containers' }); } else { resolve('not_supported'); } }); } - else if (f === '8') { si.dockerContainerStats('*').then(data => { if (data !== null) { resolve({ data, title: 'Docker Cont Stats' }); } else { resolve('not_supported'); } }); } - else if (f === '9') { si.dockerContainerProcesses('*').then(data => { if (data !== null) { resolve({ data, title: 'Docker Cont Processes' }); } else { resolve('not_supported'); } }); } - else if (f === '0') { si.dockerAll().then(data => { if (data !== null) { resolve({ data, title: 'Docker All' }); } else { resolve('not_supported'); } }); } + else if (f === '7') { si.dockerImages().then(data => { if (data !== null) { resolve({ data, title: 'Docker Images' }); } else { resolve('not_supported'); } }); } + else if (f === '8') { si.dockerContainers(true).then(data => { if (data !== null) { resolve({ data, title: 'Docker Containers' }); } else { resolve('not_supported'); } }); } + else if (f === '9') { si.dockerContainerStats('*').then(data => { if (data !== null) { resolve({ data, title: 'Docker Cont Stats' }); } else { resolve('not_supported'); } }); } + else if (f === '0') { si.dockerContainerProcesses('*').then(data => { if (data !== null) { resolve({ data, title: 'Docker Cont Processes' }); } else { resolve('not_supported'); } }); } else if (f === ',') { si.getStaticData().then(data => { if (data !== null) { resolve({ data, title: 'All Static Data' }); } else { resolve('not_supported'); } }); } else if (f === '.') { si.getDynamicData('apache2, postgres, wsearch').then(data => { if (data !== null) { resolve({ data, title: 'All Dynamic Data' }); } else { resolve('not_supported'); } }); } else if (f === '/') { si.getAllData('apache2, postgres, wsearch').then(data => { if (data !== null) { resolve({ data, title: 'All Data' }); } else { resolve('not_supported'); } }); } diff --git a/test/test.js b/test/test.js index 98775db..ce8ea65 100644 --- a/test/test.js +++ b/test/test.js @@ -16,18 +16,19 @@ function printHeader() { function printMenu() { console.log(''); console.log('┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐'); - console.log('│ a ... Audio h ... Bluetooth s ... Services Y ... Battery ? ... Get Object │'); - console.log('│ b ... BIOS i ... INET Latency S ... Shell z ... Users , ... All Static │'); - console.log('│ B ... Baseboard I ... INET Check Site t ... time 1 ... NET Iface Default . ... All Dynamic │'); - console.log('│ C ... Chassis j ... CPU Current Speed T ... CPU Temperature 2 ... NET Gateway Default / ... All │'); - console.log('│ c ... CPU l ... CPU Current Load u ... USB 3 ... NET Interfaces │'); - console.log('│ d ... DiskLayout L ... Full Load U ... UUID 4 ... NET Stats │'); - console.log('│ D ... DiskIO m ... Memory v ... Versions 5 ... NET Connections │'); - console.log('│ e ... Block Devices M ... MEM Layout V ... Virtual Box 6 ... Docker Info │'); - console.log('│ E ... Open Files o ... OS Info w ... WIFI networks 7 ... Docker Container │'); - console.log('│ f ... FS Size p ... Processes W ... WIFI interfaces 8 ... Docker Cont Stats │'); - console.log('│ F ... FS Stats P ... Process Load x ... WIFI connections 9 ... Docker Cont Proc │'); - console.log('│ g ... Graphics r ... Printer y ... System 0 ... Docker All q >>> QUIT │'); + console.log('│ a ... Audio i ... INET Latency t ... time 1 ... NET Iface Default ? ... Get Object │'); + console.log('│ b ... BIOS I ... INET Check Site T ... CPU Temperature 2 ... NET Gateway Default , ... All Static │'); + console.log('│ B ... Baseboard j ... CPU Current Speed u ... USB 3 ... NET Interfaces . ... All Dynamic │'); + console.log('│ C ... Chassis l ... CPU Current Load U ... UUID 4 ... NET Stats / ... All │'); + console.log('│ c ... CPU L ... Full Load v ... Versions 5 ... NET Connections │'); + console.log('│ d ... DiskLayout m ... Memory V ... Virtual Box │'); + console.log('│ D ... DiskIO M ... MEM Layout w ... WIFI networks │'); + console.log('│ e ... Block Devices o ... OS Info W ... WIFI interfaces │'); + console.log('│ E ... Open Files p ... Processes x ... WIFI connections 6 ... Docker Info │'); + console.log('│ f ... FS Size P ... Process Load y ... System 7 ... Docker Images │'); + console.log('│ F ... FS Stats r ... Printer Y ... Battery 8 ... Docker Container │'); + console.log('│ g ... Graphics s ... Services z ... Users 9 ... Docker Cont Stats │'); + console.log('│ h ... Bluetooth S ... Shell 0 ... Docker Cont Proc q >>> QUIT │'); console.log('└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘'); }