systeminformation 5.33.3 → 6.0.0-beta.0
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/README.md +873 -957
- package/dist/audio.d.ts +1 -0
- package/dist/audio.js +18 -0
- package/dist/baseboard.d.ts +1 -0
- package/dist/baseboard.js +17 -0
- package/dist/battery.d.ts +1 -0
- package/dist/battery.js +19 -0
- package/dist/bios.d.ts +1 -0
- package/dist/bios.js +17 -0
- package/dist/block-devices.d.ts +1 -0
- package/dist/block-devices.js +17 -0
- package/dist/bluetooth.d.ts +1 -0
- package/dist/bluetooth.js +17 -0
- package/dist/bsd/battery.d.ts +2 -0
- package/dist/bsd/battery.js +27 -0
- package/dist/bsd/cpu-cache.d.ts +1 -0
- package/dist/bsd/cpu-cache.js +37 -0
- package/dist/bsd/cpu-flags.d.ts +1 -0
- package/dist/bsd/cpu-flags.js +28 -0
- package/dist/bsd/cpu-temperature.d.ts +1 -0
- package/dist/bsd/cpu-temperature.js +29 -0
- package/dist/bsd/cpu.d.ts +1 -0
- package/dist/bsd/cpu.js +98 -0
- package/dist/bsd/index.d.ts +38 -0
- package/dist/bsd/index.js +85 -0
- package/dist/bsd/mem.d.ts +1 -0
- package/dist/bsd/mem.js +37 -0
- package/dist/bsd/network-stats.d.ts +2 -0
- package/dist/bsd/network-stats.js +92 -0
- package/dist/bsd/os-info.d.ts +21 -0
- package/dist/bsd/os-info.js +38 -0
- package/dist/bsd/uuid.d.ts +2 -0
- package/dist/bsd/uuid.js +30 -0
- package/dist/camera.d.ts +1 -0
- package/dist/camera.js +17 -0
- package/dist/chassis.d.ts +1 -0
- package/dist/chassis.js +17 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +107 -0
- package/dist/common/codepage.d.ts +1 -0
- package/dist/common/codepage.js +43 -0
- package/dist/common/const.d.ts +25 -0
- package/dist/common/const.js +26 -0
- package/dist/common/cpu.d.ts +2 -0
- package/dist/common/cpu.js +12 -0
- package/dist/common/darwin.d.ts +6 -0
- package/dist/common/darwin.js +266 -0
- package/dist/common/datetime.d.ts +9 -0
- package/dist/common/datetime.js +161 -0
- package/dist/common/defaults.d.ts +25 -0
- package/dist/common/defaults.js +299 -0
- package/dist/common/exec.d.ts +10 -0
- package/dist/common/exec.js +69 -0
- package/dist/common/files.d.ts +2 -0
- package/dist/common/files.js +39 -0
- package/dist/common/filesys.d.ts +11 -0
- package/dist/common/filesys.js +282 -0
- package/dist/common/host.d.ts +2 -0
- package/dist/common/host.js +67 -0
- package/dist/common/index.d.ts +12 -0
- package/dist/common/index.js +146 -0
- package/dist/common/internet.d.ts +1 -0
- package/dist/common/internet.js +47 -0
- package/dist/common/mappings.d.ts +55 -0
- package/dist/common/mappings.js +4133 -0
- package/dist/common/network.d.ts +8 -0
- package/dist/common/network.js +162 -0
- package/dist/common/nvidia.d.ts +22 -0
- package/dist/common/nvidia.js +159 -0
- package/dist/common/parse.d.ts +13 -0
- package/dist/common/parse.js +157 -0
- package/dist/common/raspberry.d.ts +5 -0
- package/dist/common/raspberry.js +277 -0
- package/dist/common/security.d.ts +31 -0
- package/dist/common/security.js +241 -0
- package/dist/common/types.d.ts +992 -0
- package/dist/common/types.js +2 -0
- package/dist/common/windows.d.ts +58 -0
- package/dist/common/windows.js +292 -0
- package/dist/cpu-cache.d.ts +1 -0
- package/dist/cpu-cache.js +19 -0
- package/dist/cpu-current-load.d.ts +2 -0
- package/dist/cpu-current-load.js +249 -0
- package/dist/cpu-current-speed.d.ts +3 -0
- package/dist/cpu-current-speed.js +84 -0
- package/dist/cpu-flags.d.ts +1 -0
- package/dist/cpu-flags.js +19 -0
- package/dist/cpu-full-load.d.ts +1 -0
- package/dist/cpu-full-load.js +30 -0
- package/dist/cpu-temperature.d.ts +1 -0
- package/dist/cpu-temperature.js +19 -0
- package/dist/cpu.d.ts +1 -0
- package/dist/cpu.js +19 -0
- package/dist/darwin/audio.d.ts +2 -0
- package/dist/darwin/audio.js +46 -0
- package/dist/darwin/baseboard.d.ts +1 -0
- package/dist/darwin/baseboard.js +48 -0
- package/dist/darwin/battery.d.ts +2 -0
- package/dist/darwin/battery.js +65 -0
- package/dist/darwin/bios.d.ts +1 -0
- package/dist/darwin/bios.js +45 -0
- package/dist/darwin/block-devices.d.ts +2 -0
- package/dist/darwin/block-devices.js +101 -0
- package/dist/darwin/bluetooth.d.ts +3 -0
- package/dist/darwin/bluetooth.js +84 -0
- package/dist/darwin/camera.d.ts +2 -0
- package/dist/darwin/camera.js +55 -0
- package/dist/darwin/chassis.d.ts +2 -0
- package/dist/darwin/chassis.js +32 -0
- package/dist/darwin/cpu-cache.d.ts +2 -0
- package/dist/darwin/cpu-cache.js +29 -0
- package/dist/darwin/cpu-flags.d.ts +1 -0
- package/dist/darwin/cpu-flags.js +16 -0
- package/dist/darwin/cpu-temperature.d.ts +1 -0
- package/dist/darwin/cpu-temperature.js +44 -0
- package/dist/darwin/cpu.d.ts +1 -0
- package/dist/darwin/cpu.js +69 -0
- package/dist/darwin/disk-layout.d.ts +2 -0
- package/dist/darwin/disk-layout.js +231 -0
- package/dist/darwin/disks-io.d.ts +2 -0
- package/dist/darwin/disks-io.js +56 -0
- package/dist/darwin/displays.d.ts +2 -0
- package/dist/darwin/displays.js +98 -0
- package/dist/darwin/fs-open-files.d.ts +2 -0
- package/dist/darwin/fs-open-files.js +27 -0
- package/dist/darwin/fs-stats.d.ts +2 -0
- package/dist/darwin/fs-stats.js +47 -0
- package/dist/darwin/gpu.d.ts +2 -0
- package/dist/darwin/gpu.js +55 -0
- package/dist/darwin/index.d.ts +56 -0
- package/dist/darwin/index.js +122 -0
- package/dist/darwin/keyboard.d.ts +2 -0
- package/dist/darwin/keyboard.js +73 -0
- package/dist/darwin/mem-layout.d.ts +2 -0
- package/dist/darwin/mem-layout.js +60 -0
- package/dist/darwin/mem.d.ts +2 -0
- package/dist/darwin/mem.js +50 -0
- package/dist/darwin/mouse.d.ts +2 -0
- package/dist/darwin/mouse.js +78 -0
- package/dist/darwin/network-connections.d.ts +2 -0
- package/dist/darwin/network-connections.js +98 -0
- package/dist/darwin/network-gateway-default.d.ts +1 -0
- package/dist/darwin/network-gateway-default.js +26 -0
- package/dist/darwin/network-interface-default.d.ts +2 -0
- package/dist/darwin/network-interface-default.js +41 -0
- package/dist/darwin/network-interfaces.d.ts +2 -0
- package/dist/darwin/network-interfaces.js +205 -0
- package/dist/darwin/network-stats.d.ts +2 -0
- package/dist/darwin/network-stats.js +86 -0
- package/dist/darwin/npm.d.ts +1 -0
- package/dist/darwin/npm.js +5 -0
- package/dist/darwin/npu.d.ts +2 -0
- package/dist/darwin/npu.js +41 -0
- package/dist/darwin/os-info.d.ts +1 -0
- package/dist/darwin/os-info.js +110 -0
- package/dist/darwin/pci.d.ts +2 -0
- package/dist/darwin/pci.js +37 -0
- package/dist/darwin/printer.d.ts +2 -0
- package/dist/darwin/printer.js +45 -0
- package/dist/darwin/software.d.ts +2 -0
- package/dist/darwin/software.js +39 -0
- package/dist/darwin/system.d.ts +1 -0
- package/dist/darwin/system.js +29 -0
- package/dist/darwin/thunderbolt.d.ts +1 -0
- package/dist/darwin/thunderbolt.js +53 -0
- package/dist/darwin/usb.d.ts +3 -0
- package/dist/darwin/usb.js +69 -0
- package/dist/darwin/users.d.ts +2 -0
- package/dist/darwin/users.js +13 -0
- package/dist/darwin/uuid.d.ts +2 -0
- package/dist/darwin/uuid.js +39 -0
- package/dist/darwin/wifi-connections.d.ts +2 -0
- package/dist/darwin/wifi-connections.js +60 -0
- package/dist/darwin/wifi-interfaces.d.ts +2 -0
- package/dist/darwin/wifi-interfaces.js +27 -0
- package/dist/darwin/wifi-networks.d.ts +2 -0
- package/dist/darwin/wifi-networks.js +61 -0
- package/dist/disk-layout.d.ts +1 -0
- package/dist/disk-layout.js +17 -0
- package/dist/disks-io.d.ts +1 -0
- package/dist/disks-io.js +17 -0
- package/dist/displays.d.ts +1 -0
- package/dist/displays.js +17 -0
- package/dist/docker-socket.d.ts +11 -0
- package/dist/docker-socket.js +113 -0
- package/dist/docker.d.ts +102 -0
- package/dist/docker.js +532 -0
- package/dist/fs-open-files.d.ts +1 -0
- package/dist/fs-open-files.js +17 -0
- package/dist/fs-size.d.ts +1 -0
- package/dist/fs-size.js +23 -0
- package/dist/fs-stats.d.ts +1 -0
- package/dist/fs-stats.js +17 -0
- package/dist/get-data.d.ts +110 -0
- package/dist/get-data.js +151 -0
- package/dist/get.d.ts +5 -0
- package/dist/get.js +117 -0
- package/dist/gpu.d.ts +1 -0
- package/dist/gpu.js +17 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +130 -0
- package/dist/inet-checksite.d.ts +1 -0
- package/dist/inet-checksite.js +11 -0
- package/dist/inet-latency.d.ts +1 -0
- package/dist/inet-latency.js +17 -0
- package/dist/keyboard.d.ts +1 -0
- package/dist/keyboard.js +17 -0
- package/dist/linux/audio.d.ts +2 -0
- package/dist/linux/audio.js +67 -0
- package/dist/linux/baseboard.d.ts +1 -0
- package/dist/linux/baseboard.js +81 -0
- package/dist/linux/battery.d.ts +2 -0
- package/dist/linux/battery.js +88 -0
- package/dist/linux/bios.d.ts +2 -0
- package/dist/linux/bios.js +55 -0
- package/dist/linux/block-devices.d.ts +2 -0
- package/dist/linux/block-devices.js +30 -0
- package/dist/linux/bluetooth.d.ts +2 -0
- package/dist/linux/bluetooth.js +86 -0
- package/dist/linux/camera.d.ts +2 -0
- package/dist/linux/camera.js +63 -0
- package/dist/linux/chassis.d.ts +1 -0
- package/dist/linux/chassis.js +41 -0
- package/dist/linux/cpu-cache.d.ts +1 -0
- package/dist/linux/cpu-cache.js +35 -0
- package/dist/linux/cpu-flags.d.ts +1 -0
- package/dist/linux/cpu-flags.js +33 -0
- package/dist/linux/cpu-temperature.d.ts +1 -0
- package/dist/linux/cpu-temperature.js +179 -0
- package/dist/linux/cpu.d.ts +1 -0
- package/dist/linux/cpu.js +135 -0
- package/dist/linux/disk-layout.d.ts +2 -0
- package/dist/linux/disk-layout.js +151 -0
- package/dist/linux/disks-io.d.ts +2 -0
- package/dist/linux/disks-io.js +58 -0
- package/dist/linux/displays.d.ts +2 -0
- package/dist/linux/displays.js +193 -0
- package/dist/linux/fs-open-files.d.ts +2 -0
- package/dist/linux/fs-open-files.js +44 -0
- package/dist/linux/fs-size.d.ts +2 -0
- package/dist/linux/fs-size.js +157 -0
- package/dist/linux/fs-stats.d.ts +2 -0
- package/dist/linux/fs-stats.js +65 -0
- package/dist/linux/gpu.d.ts +2 -0
- package/dist/linux/gpu.js +273 -0
- package/dist/linux/index.d.ts +56 -0
- package/dist/linux/index.js +122 -0
- package/dist/linux/inet-latency.d.ts +1 -0
- package/dist/linux/inet-latency.js +39 -0
- package/dist/linux/keyboard.d.ts +2 -0
- package/dist/linux/keyboard.js +61 -0
- package/dist/linux/mem-layout.d.ts +2 -0
- package/dist/linux/mem-layout.js +112 -0
- package/dist/linux/mem.d.ts +2 -0
- package/dist/linux/mem.js +61 -0
- package/dist/linux/mouse.d.ts +2 -0
- package/dist/linux/mouse.js +73 -0
- package/dist/linux/network-connections.d.ts +2 -0
- package/dist/linux/network-connections.js +114 -0
- package/dist/linux/network-gateway-default.d.ts +1 -0
- package/dist/linux/network-gateway-default.js +22 -0
- package/dist/linux/network-interface-default.d.ts +2 -0
- package/dist/linux/network-interface-default.js +46 -0
- package/dist/linux/network-interfaces.d.ts +3 -0
- package/dist/linux/network-interfaces.js +353 -0
- package/dist/linux/network-stats.d.ts +2 -0
- package/dist/linux/network-stats.js +99 -0
- package/dist/linux/npm.d.ts +1 -0
- package/dist/linux/npm.js +5 -0
- package/dist/linux/npu.d.ts +2 -0
- package/dist/linux/npu.js +77 -0
- package/dist/linux/os-info.d.ts +1 -0
- package/dist/linux/os-info.js +104 -0
- package/dist/linux/pci.d.ts +2 -0
- package/dist/linux/pci.js +56 -0
- package/dist/linux/printer.d.ts +2 -0
- package/dist/linux/printer.js +80 -0
- package/dist/linux/process-load.d.ts +2 -0
- package/dist/linux/process-load.js +164 -0
- package/dist/linux/processes.d.ts +2 -0
- package/dist/linux/processes.js +358 -0
- package/dist/linux/services.d.ts +2 -0
- package/dist/linux/services.js +222 -0
- package/dist/linux/software.d.ts +2 -0
- package/dist/linux/software.js +110 -0
- package/dist/linux/system.d.ts +1 -0
- package/dist/linux/system.js +186 -0
- package/dist/linux/thunderbolt.d.ts +2 -0
- package/dist/linux/thunderbolt.js +51 -0
- package/dist/linux/time.d.ts +6 -0
- package/dist/linux/time.js +28 -0
- package/dist/linux/usb.d.ts +2 -0
- package/dist/linux/usb.js +62 -0
- package/dist/linux/users.d.ts +2 -0
- package/dist/linux/users.js +102 -0
- package/dist/linux/uuid.d.ts +2 -0
- package/dist/linux/uuid.js +44 -0
- package/dist/linux/wifi-connections.d.ts +2 -0
- package/dist/linux/wifi-connections.js +196 -0
- package/dist/linux/wifi-interfaces.d.ts +2 -0
- package/dist/linux/wifi-interfaces.js +96 -0
- package/dist/linux/wifi-networks.d.ts +2 -0
- package/dist/linux/wifi-networks.js +176 -0
- package/dist/mem-layout.d.ts +1 -0
- package/dist/mem-layout.js +17 -0
- package/dist/mem.d.ts +1 -0
- package/dist/mem.js +19 -0
- package/dist/mouse.d.ts +1 -0
- package/dist/mouse.js +17 -0
- package/dist/network-connections.d.ts +1 -0
- package/dist/network-connections.js +17 -0
- package/dist/network-gateway-default.d.ts +1 -0
- package/dist/network-gateway-default.js +17 -0
- package/dist/network-interface-default.d.ts +1 -0
- package/dist/network-interface-default.js +17 -0
- package/dist/network-interfaces.d.ts +1 -0
- package/dist/network-interfaces.js +18 -0
- package/dist/network-stats.d.ts +1 -0
- package/dist/network-stats.js +19 -0
- package/dist/npm.d.ts +2 -0
- package/dist/npm.js +22 -0
- package/dist/npu.d.ts +1 -0
- package/dist/npu.js +17 -0
- package/dist/observe.d.ts +5 -0
- package/dist/observe.js +16 -0
- package/dist/os-info.d.ts +1 -0
- package/dist/os-info.js +21 -0
- package/dist/pci.d.ts +1 -0
- package/dist/pci.js +17 -0
- package/dist/printer.d.ts +1 -0
- package/dist/printer.js +17 -0
- package/dist/process-load.d.ts +1 -0
- package/dist/process-load.js +15 -0
- package/dist/processes.d.ts +1 -0
- package/dist/processes.js +15 -0
- package/dist/services.d.ts +1 -0
- package/dist/services.js +15 -0
- package/dist/shell.d.ts +1 -0
- package/dist/shell.js +16 -0
- package/dist/software.d.ts +1 -0
- package/dist/software.js +17 -0
- package/dist/sun/index.d.ts +17 -0
- package/dist/sun/index.js +43 -0
- package/dist/sun/inet-latency.d.ts +1 -0
- package/dist/sun/inet-latency.js +30 -0
- package/dist/sun/os-info.d.ts +1 -0
- package/dist/sun/os-info.js +26 -0
- package/dist/sun/users.d.ts +2 -0
- package/dist/sun/users.js +13 -0
- package/dist/system.d.ts +1 -0
- package/dist/system.js +17 -0
- package/dist/thunderbolt.d.ts +1 -0
- package/dist/thunderbolt.js +17 -0
- package/dist/time.d.ts +6 -0
- package/dist/time.js +28 -0
- package/dist/usb.d.ts +1 -0
- package/dist/usb.js +17 -0
- package/dist/users.d.ts +1 -0
- package/dist/users.js +21 -0
- package/dist/uuid.d.ts +1 -0
- package/dist/uuid.js +19 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +16 -0
- package/dist/versions.d.ts +2 -0
- package/dist/versions.js +1122 -0
- package/dist/virtualbox.d.ts +2 -0
- package/dist/virtualbox.js +89 -0
- package/dist/wifi-connections.d.ts +1 -0
- package/dist/wifi-connections.js +17 -0
- package/dist/wifi-interfaces.d.ts +1 -0
- package/dist/wifi-interfaces.js +17 -0
- package/dist/wifi-networks.d.ts +1 -0
- package/dist/wifi-networks.js +17 -0
- package/dist/windows/audio.d.ts +2 -0
- package/dist/windows/audio.js +23 -0
- package/dist/windows/baseboard.d.ts +1 -0
- package/dist/windows/baseboard.js +35 -0
- package/dist/windows/battery.d.ts +1 -0
- package/dist/windows/battery.js +81 -0
- package/dist/windows/bios.d.ts +1 -0
- package/dist/windows/bios.js +37 -0
- package/dist/windows/block-devices.d.ts +2 -0
- package/dist/windows/block-devices.js +48 -0
- package/dist/windows/bluetooth.d.ts +2 -0
- package/dist/windows/bluetooth.js +31 -0
- package/dist/windows/camera.d.ts +2 -0
- package/dist/windows/camera.js +47 -0
- package/dist/windows/chassis.d.ts +1 -0
- package/dist/windows/chassis.js +29 -0
- package/dist/windows/cpu-cache.d.ts +2 -0
- package/dist/windows/cpu-cache.js +59 -0
- package/dist/windows/cpu-flags.d.ts +1 -0
- package/dist/windows/cpu-flags.js +61 -0
- package/dist/windows/cpu-temperature.d.ts +1 -0
- package/dist/windows/cpu-temperature.js +32 -0
- package/dist/windows/cpu.d.ts +1 -0
- package/dist/windows/cpu.js +96 -0
- package/dist/windows/disk-layout.d.ts +2 -0
- package/dist/windows/disk-layout.js +112 -0
- package/dist/windows/disks-io.d.ts +2 -0
- package/dist/windows/disks-io.js +43 -0
- package/dist/windows/displays.d.ts +2 -0
- package/dist/windows/displays.js +213 -0
- package/dist/windows/fs-open-files.d.ts +2 -0
- package/dist/windows/fs-open-files.js +22 -0
- package/dist/windows/fs-size.d.ts +2 -0
- package/dist/windows/fs-size.js +47 -0
- package/dist/windows/fs-stats.d.ts +2 -0
- package/dist/windows/fs-stats.js +37 -0
- package/dist/windows/gpu.d.ts +2 -0
- package/dist/windows/gpu.js +128 -0
- package/dist/windows/index.d.ts +56 -0
- package/dist/windows/index.js +122 -0
- package/dist/windows/inet-latency.d.ts +1 -0
- package/dist/windows/inet-latency.js +34 -0
- package/dist/windows/keyboard.d.ts +2 -0
- package/dist/windows/keyboard.js +47 -0
- package/dist/windows/mem-layout.d.ts +2 -0
- package/dist/windows/mem-layout.js +39 -0
- package/dist/windows/mem.d.ts +2 -0
- package/dist/windows/mem.js +33 -0
- package/dist/windows/mouse.d.ts +2 -0
- package/dist/windows/mouse.js +64 -0
- package/dist/windows/network-connections.d.ts +2 -0
- package/dist/windows/network-connections.js +93 -0
- package/dist/windows/network-gateway-default.d.ts +1 -0
- package/dist/windows/network-gateway-default.js +36 -0
- package/dist/windows/network-interface-default.d.ts +2 -0
- package/dist/windows/network-interface-default.js +56 -0
- package/dist/windows/network-interfaces.d.ts +2 -0
- package/dist/windows/network-interfaces.js +346 -0
- package/dist/windows/network-stats.d.ts +2 -0
- package/dist/windows/network-stats.js +135 -0
- package/dist/windows/npm.d.ts +1 -0
- package/dist/windows/npm.js +5 -0
- package/dist/windows/npu.d.ts +2 -0
- package/dist/windows/npu.js +29 -0
- package/dist/windows/os-info.d.ts +1 -0
- package/dist/windows/os-info.js +65 -0
- package/dist/windows/pci.d.ts +2 -0
- package/dist/windows/pci.js +33 -0
- package/dist/windows/printer.d.ts +2 -0
- package/dist/windows/printer.js +36 -0
- package/dist/windows/process-load.d.ts +2 -0
- package/dist/windows/process-load.js +121 -0
- package/dist/windows/processes.d.ts +9 -0
- package/dist/windows/processes.js +139 -0
- package/dist/windows/services.d.ts +2 -0
- package/dist/windows/services.js +83 -0
- package/dist/windows/shell.d.ts +1 -0
- package/dist/windows/shell.js +19 -0
- package/dist/windows/software.d.ts +2 -0
- package/dist/windows/software.js +53 -0
- package/dist/windows/system.d.ts +1 -0
- package/dist/windows/system.js +98 -0
- package/dist/windows/thunderbolt.d.ts +2 -0
- package/dist/windows/thunderbolt.js +34 -0
- package/dist/windows/usb.d.ts +2 -0
- package/dist/windows/usb.js +37 -0
- package/dist/windows/users.d.ts +2 -0
- package/dist/windows/users.js +151 -0
- package/dist/windows/uuid.d.ts +2 -0
- package/dist/windows/uuid.js +28 -0
- package/dist/windows/wifi-connections.d.ts +2 -0
- package/dist/windows/wifi-connections.js +56 -0
- package/dist/windows/wifi-interfaces.d.ts +2 -0
- package/dist/windows/wifi-interfaces.js +45 -0
- package/dist/windows/wifi-networks.d.ts +2 -0
- package/dist/windows/wifi-networks.js +50 -0
- package/package.json +78 -12
- package/lib/audio.js +0 -277
- package/lib/battery.js +0 -334
- package/lib/bluetooth.js +0 -315
- package/lib/bluetoothVendors.js +0 -1138
- package/lib/cli.js +0 -100
- package/lib/cpu.js +0 -2285
- package/lib/docker.js +0 -791
- package/lib/dockerSocket.js +0 -117
- package/lib/filesystem.js +0 -1832
- package/lib/graphics.js +0 -1321
- package/lib/index.d.ts +0 -1051
- package/lib/index.js +0 -520
- package/lib/internet.js +0 -259
- package/lib/memory.js +0 -622
- package/lib/network.js +0 -2008
- package/lib/osinfo.js +0 -1321
- package/lib/printer.js +0 -209
- package/lib/processes.js +0 -1459
- package/lib/system.js +0 -855
- package/lib/usb.js +0 -309
- package/lib/users.js +0 -412
- package/lib/util.js +0 -2824
- package/lib/virtualbox.js +0 -116
- package/lib/wifi.js +0 -839
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.displays = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const const_1 = require("../common/const");
|
|
6
|
+
const defaults_1 = require("../common/defaults");
|
|
7
|
+
const exec_1 = require("../common/exec");
|
|
8
|
+
const index_1 = require("../common/index");
|
|
9
|
+
const raspberry_1 = require("../common/raspberry");
|
|
10
|
+
const parseLinesLinuxEdid = (edid) => {
|
|
11
|
+
const result = (0, index_1.cloneObj)(defaults_1.initDisplay);
|
|
12
|
+
let start = 108;
|
|
13
|
+
if (edid.substring(start, start + 6) === '000000') {
|
|
14
|
+
start += 36;
|
|
15
|
+
}
|
|
16
|
+
if (edid.substring(start, start + 6) === '000000') {
|
|
17
|
+
start += 36;
|
|
18
|
+
}
|
|
19
|
+
if (edid.substring(start, start + 6) === '000000') {
|
|
20
|
+
start += 36;
|
|
21
|
+
}
|
|
22
|
+
if (edid.substring(start, start + 6) === '000000') {
|
|
23
|
+
start += 36;
|
|
24
|
+
}
|
|
25
|
+
result.resolutionX = parseInt('0x0' + edid.substring(start + 8, start + 9) + edid.substring(start + 4, start + 6));
|
|
26
|
+
result.resolutionY = parseInt('0x0' + edid.substring(start + 14, start + 15) + edid.substring(start + 10, start + 12));
|
|
27
|
+
result.sizeX = parseInt('0x0' + edid.substring(start + 28, start + 29) + edid.substring(start + 24, start + 26));
|
|
28
|
+
result.sizeY = parseInt('0x0' + edid.substring(start + 29, start + 30) + edid.substring(start + 26, start + 28));
|
|
29
|
+
start = edid.indexOf('000000fc00');
|
|
30
|
+
if (start >= 0) {
|
|
31
|
+
let model_raw = edid.substring(start + 10, start + 36);
|
|
32
|
+
if (model_raw.indexOf('0a') !== -1) {
|
|
33
|
+
model_raw = model_raw.substring(0, model_raw.indexOf('0a'));
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
if (model_raw.length > 2) {
|
|
37
|
+
result.model = (model_raw.match(/.{1,2}/g) || [])
|
|
38
|
+
.map((v) => {
|
|
39
|
+
return String.fromCharCode(parseInt(v, 16));
|
|
40
|
+
})
|
|
41
|
+
.join('');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
catch { }
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
result.model = '';
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
const parseLinesLinuxDisplays = (lines, depth) => {
|
|
52
|
+
const displays = [];
|
|
53
|
+
let currentDisplay = (0, index_1.cloneObj)(defaults_1.initDisplay);
|
|
54
|
+
let is_edid = false;
|
|
55
|
+
let is_current = false;
|
|
56
|
+
let edid_raw = '';
|
|
57
|
+
let start = 0;
|
|
58
|
+
const applyEdid = () => {
|
|
59
|
+
const edid_decoded = parseLinesLinuxEdid(edid_raw);
|
|
60
|
+
currentDisplay.vendor = edid_decoded.vendor;
|
|
61
|
+
currentDisplay.model = edid_decoded.model;
|
|
62
|
+
currentDisplay.resolutionX = edid_decoded.resolutionX;
|
|
63
|
+
currentDisplay.resolutionY = edid_decoded.resolutionY;
|
|
64
|
+
currentDisplay.sizeX = edid_decoded.sizeX;
|
|
65
|
+
currentDisplay.sizeY = edid_decoded.sizeY;
|
|
66
|
+
currentDisplay.pixelDepth = depth;
|
|
67
|
+
is_edid = false;
|
|
68
|
+
};
|
|
69
|
+
for (let i = 1; i < lines.length; i++) {
|
|
70
|
+
if ('' !== lines[i].trim()) {
|
|
71
|
+
if (' ' !== lines[i][0] && '\t' !== lines[i][0] && lines[i].toLowerCase().indexOf(' connected ') !== -1) {
|
|
72
|
+
if (is_edid && edid_raw) {
|
|
73
|
+
applyEdid();
|
|
74
|
+
}
|
|
75
|
+
if (currentDisplay.model ||
|
|
76
|
+
currentDisplay.main ||
|
|
77
|
+
currentDisplay.builtin ||
|
|
78
|
+
currentDisplay.connection ||
|
|
79
|
+
currentDisplay.sizeX !== null ||
|
|
80
|
+
currentDisplay.pixelDepth !== null ||
|
|
81
|
+
currentDisplay.resolutionX !== null) {
|
|
82
|
+
displays.push(currentDisplay);
|
|
83
|
+
currentDisplay = (0, index_1.cloneObj)(defaults_1.initDisplay);
|
|
84
|
+
}
|
|
85
|
+
const parts = lines[i].split(' ');
|
|
86
|
+
currentDisplay.connection = parts[0];
|
|
87
|
+
currentDisplay.main = lines[i].toLowerCase().indexOf(' primary ') >= 0;
|
|
88
|
+
currentDisplay.builtin = parts[0].toLowerCase().indexOf('edp') >= 0;
|
|
89
|
+
const geometry = lines[i].match(/\d+x\d+\+(-?\d+)\+(-?\d+)/);
|
|
90
|
+
if (geometry) {
|
|
91
|
+
currentDisplay.positionX = (0, common_1.toInt)(geometry[1]);
|
|
92
|
+
currentDisplay.positionY = (0, common_1.toInt)(geometry[2]);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (is_edid) {
|
|
96
|
+
if (lines[i].search(/\S|$/) > start) {
|
|
97
|
+
edid_raw += lines[i].toLowerCase().trim();
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
applyEdid();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (lines[i].toLowerCase().indexOf('edid:') >= 0) {
|
|
104
|
+
is_edid = true;
|
|
105
|
+
edid_raw = '';
|
|
106
|
+
start = lines[i].search(/\S|$/);
|
|
107
|
+
}
|
|
108
|
+
if (lines[i].toLowerCase().indexOf('*current') >= 0) {
|
|
109
|
+
const parts1 = lines[i].split('(');
|
|
110
|
+
if (parts1 && parts1.length > 1 && parts1[0].indexOf('x') >= 0) {
|
|
111
|
+
const resParts = parts1[0].trim().split('x');
|
|
112
|
+
currentDisplay.currentResX = (0, common_1.toInt)(resParts[0]);
|
|
113
|
+
currentDisplay.currentResY = (0, common_1.toInt)(resParts[1]);
|
|
114
|
+
}
|
|
115
|
+
is_current = true;
|
|
116
|
+
}
|
|
117
|
+
if (is_current && lines[i].toLowerCase().indexOf('clock') >= 0 && lines[i].toLowerCase().indexOf('hz') >= 0 && lines[i].toLowerCase().indexOf('v: height') >= 0) {
|
|
118
|
+
const parts1 = lines[i].split('clock');
|
|
119
|
+
if (parts1 && parts1.length > 1 && parts1[1].toLowerCase().indexOf('hz') >= 0) {
|
|
120
|
+
currentDisplay.currentRefreshRate = (0, common_1.toInt)(parts1[1]);
|
|
121
|
+
}
|
|
122
|
+
is_current = false;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (is_edid && edid_raw) {
|
|
127
|
+
applyEdid();
|
|
128
|
+
}
|
|
129
|
+
if (currentDisplay.model ||
|
|
130
|
+
currentDisplay.main ||
|
|
131
|
+
currentDisplay.builtin ||
|
|
132
|
+
currentDisplay.connection ||
|
|
133
|
+
currentDisplay.sizeX !== null ||
|
|
134
|
+
currentDisplay.pixelDepth !== null ||
|
|
135
|
+
currentDisplay.resolutionX !== null) {
|
|
136
|
+
displays.push(currentDisplay);
|
|
137
|
+
}
|
|
138
|
+
return displays;
|
|
139
|
+
};
|
|
140
|
+
const displays = async () => {
|
|
141
|
+
await (0, common_1.nextTick)();
|
|
142
|
+
const result = [];
|
|
143
|
+
try {
|
|
144
|
+
if (await (0, raspberry_1.isRaspberry)()) {
|
|
145
|
+
const { stdout } = await (0, exec_1.exec)("fbset -s 2> /dev/null | grep 'mode \"' ; tvservice -s 2> /dev/null; tvservice -n 2> /dev/null;", const_1.execOptsLinux);
|
|
146
|
+
const lines = stdout.split('\n');
|
|
147
|
+
if (lines.length > 2 && lines[0].indexOf('mode "') >= 0 && lines[1].indexOf('0x12000a') > -1) {
|
|
148
|
+
const parts = lines[0].replace('mode', '').replace(/"/g, '').trim().split('x');
|
|
149
|
+
if (parts.length === 2) {
|
|
150
|
+
result.push({
|
|
151
|
+
vendor: '',
|
|
152
|
+
vendorId: null,
|
|
153
|
+
model: (0, common_1.getValue)(lines, 'device_name', '='),
|
|
154
|
+
productionYear: null,
|
|
155
|
+
serial: null,
|
|
156
|
+
deviceName: '',
|
|
157
|
+
displayId: null,
|
|
158
|
+
main: true,
|
|
159
|
+
builtin: false,
|
|
160
|
+
connection: 'HDMI',
|
|
161
|
+
sizeX: null,
|
|
162
|
+
sizeY: null,
|
|
163
|
+
pixelDepth: null,
|
|
164
|
+
resolutionX: (0, common_1.toInt)(parts[0]),
|
|
165
|
+
resolutionY: (0, common_1.toInt)(parts[1]),
|
|
166
|
+
currentResX: null,
|
|
167
|
+
currentResY: null,
|
|
168
|
+
positionX: 0,
|
|
169
|
+
positionY: 0,
|
|
170
|
+
currentRefreshRate: null
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
let stdout = '';
|
|
176
|
+
try {
|
|
177
|
+
({ stdout } = await (0, exec_1.execSave)("xdpyinfo 2>/dev/null | grep 'depth of root window' | awk '{ print $5 }'"));
|
|
178
|
+
let depth = 0;
|
|
179
|
+
const lines = stdout.split('\n');
|
|
180
|
+
depth = parseInt(lines[0]) || 0;
|
|
181
|
+
try {
|
|
182
|
+
({ stdout } = await (0, exec_1.exec)('xrandr --verbose 2>/dev/null', const_1.execOptsLinux));
|
|
183
|
+
const lines = stdout.toString().split('\n');
|
|
184
|
+
return parseLinesLinuxDisplays(lines, depth);
|
|
185
|
+
}
|
|
186
|
+
catch { }
|
|
187
|
+
}
|
|
188
|
+
catch { }
|
|
189
|
+
}
|
|
190
|
+
catch { }
|
|
191
|
+
return result;
|
|
192
|
+
};
|
|
193
|
+
exports.displays = displays;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fsOpenFiles = void 0;
|
|
4
|
+
const promises_1 = require("fs/promises");
|
|
5
|
+
const defaults_1 = require("../common/defaults");
|
|
6
|
+
const index_1 = require("../common/index");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const fsOpenFiles = async () => {
|
|
9
|
+
await (0, common_1.nextTick)();
|
|
10
|
+
const defaults = (0, index_1.cloneObj)(defaults_1.initFsOpenFiles);
|
|
11
|
+
let allocated = defaults.allocated;
|
|
12
|
+
let available = defaults.available;
|
|
13
|
+
let max = defaults.max;
|
|
14
|
+
try {
|
|
15
|
+
const lines = (await (0, promises_1.readFile)('/proc/sys/fs/file-nr')).toString().split('\n');
|
|
16
|
+
if (lines[0]) {
|
|
17
|
+
const parts = lines[0].replace(/\s+/g, ' ').split(' ');
|
|
18
|
+
if (parts.length === 3) {
|
|
19
|
+
allocated = (0, common_1.toInt)(parts[0]);
|
|
20
|
+
available = (0, common_1.toInt)(parts[1]);
|
|
21
|
+
max = (0, common_1.toInt)(parts[2]);
|
|
22
|
+
if (!available) {
|
|
23
|
+
available = max - allocated;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
try {
|
|
30
|
+
const lines = (await (0, promises_1.readFile)('/proc/sys/fs/file-max')).toString().split('\n');
|
|
31
|
+
if (lines[0]) {
|
|
32
|
+
max = (0, common_1.toInt)(lines[0]);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
catch { }
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
...defaults,
|
|
39
|
+
allocated,
|
|
40
|
+
available,
|
|
41
|
+
max
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
exports.fsOpenFiles = fsOpenFiles;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fsSize = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const const_1 = require("../common/const");
|
|
6
|
+
const exec_1 = require("../common/exec");
|
|
7
|
+
let macOsDisks = [];
|
|
8
|
+
let osMounts = {};
|
|
9
|
+
const getmacOsFsType = (fs) => {
|
|
10
|
+
if (!fs.startsWith('/')) {
|
|
11
|
+
return 'NFS';
|
|
12
|
+
}
|
|
13
|
+
const parts = fs.split('/');
|
|
14
|
+
const fsShort = parts[parts.length - 1];
|
|
15
|
+
const macOsDisksSingle = macOsDisks.filter((item) => item.indexOf(fsShort) >= 0);
|
|
16
|
+
if (macOsDisksSingle.length === 1 && macOsDisksSingle[0].indexOf('APFS') >= 0) {
|
|
17
|
+
return 'APFS';
|
|
18
|
+
}
|
|
19
|
+
return 'HFS';
|
|
20
|
+
};
|
|
21
|
+
const isLinuxTmpFs = (fs) => {
|
|
22
|
+
const linuxTmpFileSystems = ['rootfs', 'unionfs', 'squashfs', 'cramfs', 'initrd', 'initramfs', 'devtmpfs', 'tmpfs', 'udev', 'devfs', 'specfs', 'type', 'appimaged'];
|
|
23
|
+
let result = false;
|
|
24
|
+
linuxTmpFileSystems.forEach((linuxFs) => {
|
|
25
|
+
if (fs.toLowerCase().indexOf(linuxFs) >= 0) {
|
|
26
|
+
result = true;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
const filterFsLines = (stdout) => {
|
|
32
|
+
const lines = stdout.toString().split('\n');
|
|
33
|
+
lines.shift();
|
|
34
|
+
if (stdout.toString().toLowerCase().indexOf('filesystem') >= 0) {
|
|
35
|
+
let removeLines = 0;
|
|
36
|
+
for (let i = 0; i < lines.length; i++) {
|
|
37
|
+
if (lines[i]?.toLowerCase().startsWith('filesystem')) {
|
|
38
|
+
removeLines = i;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
for (let i = 0; i < removeLines; i++) {
|
|
42
|
+
lines.shift();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return lines;
|
|
46
|
+
};
|
|
47
|
+
const dfLineWithType = /^(.+?)\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(?:\d+%|-)\s+(.+)$/;
|
|
48
|
+
const dfLineNoType = /^(.+?)\s+(\d+)\s+(\d+)\s+(\d+)\s+(?:\d+%|-)\s+(.+)$/;
|
|
49
|
+
const parseNixFsSize = (lines) => {
|
|
50
|
+
const data = [];
|
|
51
|
+
const withType = const_1.LINUX || const_1.FREEBSD || const_1.NETBSD || const_1.OPENBSD;
|
|
52
|
+
lines.forEach((line) => {
|
|
53
|
+
const match = line.trim().match(withType ? dfLineWithType : dfLineNoType);
|
|
54
|
+
if (match) {
|
|
55
|
+
const fs = match[1].trim();
|
|
56
|
+
const fsType = withType ? match[2] : getmacOsFsType(fs);
|
|
57
|
+
const mount = (withType ? match[6] : match[5]).trim();
|
|
58
|
+
if (fs.startsWith('/') || mount === '/' || fs.indexOf('/') > 0 || fs.indexOf(':') === 1 || (!const_1.DARWIN && !isLinuxTmpFs(fsType))) {
|
|
59
|
+
const size = (0, common_1.toInt)(match[withType ? 3 : 2]) * 1024;
|
|
60
|
+
const used = (0, common_1.toInt)(match[withType ? 4 : 3]) * 1024;
|
|
61
|
+
const available = (0, common_1.toInt)(match[withType ? 5 : 4]) * 1024;
|
|
62
|
+
const use = parseFloat((100.0 * (used / (used + available))).toFixed(2));
|
|
63
|
+
const rw = osMounts && Object.keys(osMounts).length > 0 ? osMounts[fs] || false : null;
|
|
64
|
+
if (!data.find((el) => el.fs === fs && el.type === fsType && el.mount === mount)) {
|
|
65
|
+
data.push({
|
|
66
|
+
fs,
|
|
67
|
+
type: fsType,
|
|
68
|
+
size,
|
|
69
|
+
used,
|
|
70
|
+
available,
|
|
71
|
+
use,
|
|
72
|
+
mount,
|
|
73
|
+
rw
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return data;
|
|
80
|
+
};
|
|
81
|
+
const fsSize = async (drives) => {
|
|
82
|
+
await (0, common_1.nextTick)();
|
|
83
|
+
let data = [];
|
|
84
|
+
let cmd = '';
|
|
85
|
+
let stdout = '';
|
|
86
|
+
let stderr = '';
|
|
87
|
+
let lines = [];
|
|
88
|
+
macOsDisks = [];
|
|
89
|
+
osMounts = {};
|
|
90
|
+
if (const_1.DARWIN) {
|
|
91
|
+
cmd = 'df -kP';
|
|
92
|
+
try {
|
|
93
|
+
({ stdout } = await (0, exec_1.exec)('diskutil list', const_1.execOptsLinux));
|
|
94
|
+
macOsDisks = stdout.split('\n').filter((line) => {
|
|
95
|
+
return !line.startsWith('/') && line.indexOf(':') > 0;
|
|
96
|
+
});
|
|
97
|
+
({ stdout } = await (0, exec_1.exec)('mount', const_1.execOptsLinux));
|
|
98
|
+
stdout
|
|
99
|
+
.split('\n')
|
|
100
|
+
.filter((line) => {
|
|
101
|
+
return line.startsWith('/');
|
|
102
|
+
})
|
|
103
|
+
.forEach((line) => {
|
|
104
|
+
osMounts[line.split(' on ')[0]] = line.toLowerCase().indexOf('read-only') === -1;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
catch { }
|
|
108
|
+
}
|
|
109
|
+
if (const_1.LINUX) {
|
|
110
|
+
try {
|
|
111
|
+
cmd = 'export LC_ALL=C; df -kPTx squashfs; unset LC_ALL';
|
|
112
|
+
({ stdout } = await (0, exec_1.exec)('cat /proc/mounts 2>/dev/null', const_1.execOptsLinux));
|
|
113
|
+
stdout
|
|
114
|
+
.split('\n')
|
|
115
|
+
.filter((line) => {
|
|
116
|
+
return line.startsWith('/');
|
|
117
|
+
})
|
|
118
|
+
.forEach((line) => {
|
|
119
|
+
const fs = line.split(' ')[0].replace(/\\(\d{3})/g, (_, octal) => String.fromCharCode(parseInt(octal, 8)));
|
|
120
|
+
osMounts[fs] = osMounts[fs] || false;
|
|
121
|
+
if (line.indexOf('/snap/') === -1) {
|
|
122
|
+
osMounts[fs] = line.toLowerCase().indexOf('rw,') >= 0 || line.toLowerCase().indexOf(' rw ') >= 0;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
catch { }
|
|
127
|
+
}
|
|
128
|
+
if (const_1.FREEBSD || const_1.NETBSD || const_1.OPENBSD) {
|
|
129
|
+
try {
|
|
130
|
+
cmd = 'df -kPT';
|
|
131
|
+
({ stdout } = await (0, exec_1.exec)('mount', const_1.execOptsLinux));
|
|
132
|
+
stdout.split('\n').forEach((line) => {
|
|
133
|
+
osMounts[line.split(' on ')[0]] = line.toLowerCase().indexOf('read-only') === -1;
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
catch { }
|
|
137
|
+
}
|
|
138
|
+
({ stdout, stderr } = await (0, exec_1.exec)(cmd, const_1.execOptsLinux));
|
|
139
|
+
if (!stderr) {
|
|
140
|
+
lines = filterFsLines(stdout);
|
|
141
|
+
data = parseNixFsSize(lines);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
({ stdout } = await (0, exec_1.exec)('df -kPT 2>/dev/null', const_1.execOptsLinux));
|
|
145
|
+
lines = filterFsLines(stdout);
|
|
146
|
+
data = parseNixFsSize(lines);
|
|
147
|
+
}
|
|
148
|
+
if (drives.length) {
|
|
149
|
+
data = data.filter((item) => {
|
|
150
|
+
return drives.some((drive) => {
|
|
151
|
+
return item.fs.toLowerCase().indexOf(drive.toLowerCase()) >= 0 || item.mount.toLowerCase().indexOf(drive.toLowerCase()) >= 0;
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
return data;
|
|
156
|
+
};
|
|
157
|
+
exports.fsSize = fsSize;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fsStats = void 0;
|
|
4
|
+
const defaults_1 = require("../common/defaults");
|
|
5
|
+
const index_1 = require("../common/index");
|
|
6
|
+
const exec_1 = require("../common/exec");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const filesys_1 = require("../common/filesys");
|
|
9
|
+
const security_1 = require("../common/security");
|
|
10
|
+
const const_1 = require("../common/const");
|
|
11
|
+
const fsStats = async () => {
|
|
12
|
+
await (0, common_1.nextTick)();
|
|
13
|
+
if ((filesys_1._fs_speed && !filesys_1._fs_speed.ms) || (filesys_1._fs_speed?.ms && Date.now() - filesys_1._fs_speed.ms >= 500)) {
|
|
14
|
+
const defaults = (0, index_1.cloneObj)(defaults_1.initFsStats);
|
|
15
|
+
let stdout = '';
|
|
16
|
+
let rx = 0;
|
|
17
|
+
let wx = 0;
|
|
18
|
+
try {
|
|
19
|
+
({ stdout } = await (0, exec_1.exec)('lsblk -r 2>/dev/null | grep /', const_1.execOptsLinux));
|
|
20
|
+
const lines = stdout.toString().split('\n');
|
|
21
|
+
const fs_filter = [];
|
|
22
|
+
lines.forEach((line) => {
|
|
23
|
+
if (line !== '') {
|
|
24
|
+
const lineParts = line.trim().split(' ');
|
|
25
|
+
const dev = (0, security_1.sanitizeShellString)(lineParts[0] || '', true);
|
|
26
|
+
if (dev && fs_filter.indexOf(dev) === -1) {
|
|
27
|
+
fs_filter.push(dev);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const output = fs_filter.join('|');
|
|
32
|
+
try {
|
|
33
|
+
({ stdout } = await (0, exec_1.exec)('cat /proc/diskstats | egrep "' + output + '"', const_1.execOptsLinux));
|
|
34
|
+
const lines = stdout.toString().split('\n');
|
|
35
|
+
lines.forEach((line) => {
|
|
36
|
+
line = line.trim();
|
|
37
|
+
if (line !== '') {
|
|
38
|
+
const lineParts = line.replace(/ +/g, ' ').split(' ');
|
|
39
|
+
rx += (0, common_1.toInt)(lineParts[5]) * 512;
|
|
40
|
+
wx += (0, common_1.toInt)(lineParts[9]) * 512;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return (0, filesys_1.calcFsSpeed)(rx, wx);
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return defaults;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return defaults;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return {
|
|
55
|
+
ms: filesys_1._fs_speed.last_ms,
|
|
56
|
+
rx: filesys_1._fs_speed.bytes_read,
|
|
57
|
+
wx: filesys_1._fs_speed.bytes_write,
|
|
58
|
+
tx: filesys_1._fs_speed.bytes_read + filesys_1._fs_speed.bytes_write,
|
|
59
|
+
rx_sec: filesys_1._fs_speed.rx_sec,
|
|
60
|
+
wx_sec: filesys_1._fs_speed.wx_sec,
|
|
61
|
+
tx_sec: filesys_1._fs_speed.tx_sec
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
exports.fsStats = fsStats;
|