chore: updated copyright year
This commit is contained in:
parent
74b91ed4ad
commit
95ed380879
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2014-2025 Sebastian Hildebrandt
|
Copyright (c) 2014-2026 Sebastian Hildebrandt
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|||||||
@ -1177,7 +1177,7 @@ All other trademarks are the property of their respective owners.
|
|||||||
|
|
||||||
> The [`MIT`][license-url] License (MIT)
|
> The [`MIT`][license-url] License (MIT)
|
||||||
>
|
>
|
||||||
> Copyright © 2014-2025 Sebastian Hildebrandt,
|
> Copyright © 2014-2026 Sebastian Hildebrandt,
|
||||||
> [+innovations](http://www.plus-innovations.com).
|
> [+innovations](http://www.plus-innovations.com).
|
||||||
>
|
>
|
||||||
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
|||||||
@ -262,7 +262,7 @@ si.audio().then(data => console.log(data));</code></pre>
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -308,7 +308,7 @@ si.battery().then(data => console.log(data));</code></pre>
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -226,7 +226,7 @@ si.bluetoothDevices().then(data => console.log(data));</code></pre>
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -271,7 +271,7 @@
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -110,7 +110,7 @@
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -122,7 +122,7 @@
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -646,7 +646,7 @@ si.cpuTemperature().then(data => console.log(data));</code></pre>
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1346,7 +1346,7 @@
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1001,7 +1001,7 @@ setInterval(function() {
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -401,7 +401,7 @@ si.get(valueObject).then(data => console.log(data));</code></pre>
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -168,7 +168,7 @@ async function cpuData() {
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -647,7 +647,7 @@ si.graphics().then(data => console.log(data));</code></pre>
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -3677,7 +3677,7 @@
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -384,7 +384,7 @@
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -126,7 +126,7 @@
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -461,7 +461,7 @@ si.memLayout().then(data => console.log(data));</code></pre>
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -848,7 +848,7 @@ setInterval(function() {
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -853,7 +853,7 @@ si.users().then(data => console.log(data));</code></pre>
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -239,7 +239,7 @@ si.printer().then(data => console.log(data));</code></pre>
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -781,7 +781,7 @@ si.services('mysql, postgres').then(data => console.log(data));</code></pre>
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -289,7 +289,7 @@
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -157,7 +157,7 @@ setTimeout(() => {
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -587,7 +587,7 @@ si.chassis().then(data => console.log(data));</code></pre>
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -142,7 +142,7 @@
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -119,7 +119,7 @@
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -274,7 +274,7 @@ si.usb().then(data => console.log(data));</code></pre>
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -291,7 +291,7 @@ si.battery().then(data => console.log(data));</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -100,7 +100,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -94,7 +94,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -588,7 +588,7 @@ si.cpuTemperature().then(data => console.log(data));</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -1068,7 +1068,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -881,7 +881,7 @@ setInterval(function() {
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -340,7 +340,7 @@ si.get(valueObject).then(data => console.log(data));</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -161,7 +161,7 @@ async function cpuData() {
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -537,7 +537,7 @@ si.graphics().then(data => console.log(data));</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -2133,7 +2133,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -348,7 +348,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -114,7 +114,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -410,7 +410,7 @@ si.memLayout().then(data => console.log(data));</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -802,7 +802,7 @@ setInterval(function() {
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -740,7 +740,7 @@ si.users().then(data => console.log(data));</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -737,7 +737,7 @@ si.services('mysql, postgres').then(data => console.log(data));</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -230,7 +230,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -149,7 +149,7 @@ setTimeout(() => {
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -446,7 +446,7 @@ si.chassis().then(data => console.log(data));</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -100,7 +100,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -468,7 +468,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -245,7 +245,7 @@ si.wifiNetworks().then(data => console.log(data));</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 col-12">
|
<div class="col-lg-4 col-12">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt, +innovations</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt, +innovations</a></li>
|
||||||
<li><a href="copyright.html">Copyright & License</a></li>
|
<li><a href="copyright.html">Copyright & License</a></li>
|
||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
|
|||||||
@ -475,7 +475,7 @@
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -524,7 +524,7 @@ si.wifiConnections().then(data => console.log(data));</code></pre>
|
|||||||
<li><a href="trademarks.html">Trademarks</a></li>
|
<li><a href="trademarks.html">Trademarks</a></li>
|
||||||
<li> </li>
|
<li> </li>
|
||||||
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
<li><a href="copyright.html">Copyright & License <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">© 2025 Sebastian Hildebrandt</a></li>
|
<li><a href="https://www.plus-innovations.com">© 2026 Sebastian Hildebrandt</a></li>
|
||||||
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
<li><a href="https://www.plus-innovations.com">+innovations GmbH</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|||||||
239
lib/docker.js
239
lib/docker.js
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
@ -17,13 +17,12 @@ const util = require('./util');
|
|||||||
const DockerSocket = require('./dockerSocket');
|
const DockerSocket = require('./dockerSocket');
|
||||||
|
|
||||||
let _platform = process.platform;
|
let _platform = process.platform;
|
||||||
const _windows = (_platform === 'win32');
|
const _windows = _platform === 'win32';
|
||||||
|
|
||||||
let _docker_container_stats = {};
|
let _docker_container_stats = {};
|
||||||
let _docker_socket;
|
let _docker_socket;
|
||||||
let _docker_last_read = 0;
|
let _docker_last_read = 0;
|
||||||
|
|
||||||
|
|
||||||
// --------------------------
|
// --------------------------
|
||||||
// get containers (parameter all: get also inactive/exited containers)
|
// get containers (parameter all: get also inactive/exited containers)
|
||||||
|
|
||||||
@ -82,7 +81,9 @@ function dockerInfo(callback) {
|
|||||||
result.isolation = data.Isolation;
|
result.isolation = data.Isolation;
|
||||||
result.initBinary = data.InitBinary;
|
result.initBinary = data.InitBinary;
|
||||||
result.productLicense = data.ProductLicense;
|
result.productLicense = data.ProductLicense;
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -92,7 +93,6 @@ function dockerInfo(callback) {
|
|||||||
exports.dockerInfo = dockerInfo;
|
exports.dockerInfo = dockerInfo;
|
||||||
|
|
||||||
function dockerImages(all, callback) {
|
function dockerImages(all, callback) {
|
||||||
|
|
||||||
// fallback - if only callback is given
|
// fallback - if only callback is given
|
||||||
if (util.isFunction(all) && !callback) {
|
if (util.isFunction(all) && !callback) {
|
||||||
callback = all;
|
callback = all;
|
||||||
@ -114,36 +114,40 @@ function dockerImages(all, callback) {
|
|||||||
}
|
}
|
||||||
const workload = [];
|
const workload = [];
|
||||||
|
|
||||||
_docker_socket.listImages(all, data => {
|
_docker_socket.listImages(all, (data) => {
|
||||||
let dockerImages = {};
|
let dockerImages = {};
|
||||||
try {
|
try {
|
||||||
dockerImages = data;
|
dockerImages = data;
|
||||||
if (dockerImages && Object.prototype.toString.call(dockerImages) === '[object Array]' && dockerImages.length > 0) {
|
if (dockerImages && Object.prototype.toString.call(dockerImages) === '[object Array]' && dockerImages.length > 0) {
|
||||||
|
|
||||||
dockerImages.forEach(function (element) {
|
dockerImages.forEach(function (element) {
|
||||||
|
|
||||||
if (element.Names && Object.prototype.toString.call(element.Names) === '[object Array]' && element.Names.length > 0) {
|
if (element.Names && Object.prototype.toString.call(element.Names) === '[object Array]' && element.Names.length > 0) {
|
||||||
element.Name = element.Names[0].replace(/^\/|\/$/g, '');
|
element.Name = element.Names[0].replace(/^\/|\/$/g, '');
|
||||||
}
|
}
|
||||||
workload.push(dockerImagesInspect(element.Id.trim(), element));
|
workload.push(dockerImagesInspect(element.Id.trim(), element));
|
||||||
});
|
});
|
||||||
if (workload.length) {
|
if (workload.length) {
|
||||||
Promise.all(
|
Promise.all(workload).then((data) => {
|
||||||
workload
|
if (callback) {
|
||||||
).then((data) => {
|
callback(data);
|
||||||
if (callback) { callback(data); }
|
}
|
||||||
resolve(data);
|
resolve(data);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -163,12 +167,11 @@ function dockerImagesInspect(imageID, payload) {
|
|||||||
}
|
}
|
||||||
const imageIDSanitized = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(imageID, true)).trim();
|
const imageIDSanitized = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(imageID, true)).trim();
|
||||||
if (imageIDSanitized) {
|
if (imageIDSanitized) {
|
||||||
|
|
||||||
if (!_docker_socket) {
|
if (!_docker_socket) {
|
||||||
_docker_socket = new DockerSocket();
|
_docker_socket = new DockerSocket();
|
||||||
}
|
}
|
||||||
|
|
||||||
_docker_socket.inspectImage(imageIDSanitized.trim(), data => {
|
_docker_socket.inspectImage(imageIDSanitized.trim(), (data) => {
|
||||||
try {
|
try {
|
||||||
resolve({
|
resolve({
|
||||||
id: payload.Id,
|
id: payload.Id,
|
||||||
@ -188,7 +191,7 @@ function dockerImagesInspect(imageID, payload) {
|
|||||||
repoDigests: data.RepoDigests ? data.RepoDigests : {},
|
repoDigests: data.RepoDigests ? data.RepoDigests : {},
|
||||||
repoTags: data.RepoTags ? data.RepoTags : {},
|
repoTags: data.RepoTags ? data.RepoTags : {},
|
||||||
config: data.Config ? data.Config : {},
|
config: data.Config ? data.Config : {},
|
||||||
rootFS: data.RootFS ? data.RootFS : {},
|
rootFS: data.RootFS ? data.RootFS : {}
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
resolve();
|
resolve();
|
||||||
@ -204,16 +207,15 @@ function dockerImagesInspect(imageID, payload) {
|
|||||||
exports.dockerImages = dockerImages;
|
exports.dockerImages = dockerImages;
|
||||||
|
|
||||||
function dockerContainers(all, callback) {
|
function dockerContainers(all, callback) {
|
||||||
|
|
||||||
function inContainers(containers, id) {
|
function inContainers(containers, id) {
|
||||||
let filtered = containers.filter(obj => {
|
let filtered = containers.filter((obj) => {
|
||||||
/**
|
/**
|
||||||
* @namespace
|
* @namespace
|
||||||
* @property {string} Id
|
* @property {string} Id
|
||||||
*/
|
*/
|
||||||
return (obj.Id && (obj.Id === id));
|
return obj.Id && obj.Id === id;
|
||||||
});
|
});
|
||||||
return (filtered.length > 0);
|
return filtered.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// fallback - if only callback is given
|
// fallback - if only callback is given
|
||||||
@ -237,7 +239,7 @@ function dockerContainers(all, callback) {
|
|||||||
}
|
}
|
||||||
const workload = [];
|
const workload = [];
|
||||||
|
|
||||||
_docker_socket.listContainers(all, data => {
|
_docker_socket.listContainers(all, (data) => {
|
||||||
let docker_containers = {};
|
let docker_containers = {};
|
||||||
try {
|
try {
|
||||||
docker_containers = data;
|
docker_containers = data;
|
||||||
@ -245,40 +247,49 @@ function dockerContainers(all, callback) {
|
|||||||
// GC in _docker_container_stats
|
// GC in _docker_container_stats
|
||||||
for (let key in _docker_container_stats) {
|
for (let key in _docker_container_stats) {
|
||||||
if ({}.hasOwnProperty.call(_docker_container_stats, key)) {
|
if ({}.hasOwnProperty.call(_docker_container_stats, key)) {
|
||||||
if (!inContainers(docker_containers, key)) { delete _docker_container_stats[key]; }
|
if (!inContainers(docker_containers, key)) {
|
||||||
|
delete _docker_container_stats[key];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
docker_containers.forEach(function (element) {
|
docker_containers.forEach(function (element) {
|
||||||
|
|
||||||
if (element.Names && Object.prototype.toString.call(element.Names) === '[object Array]' && element.Names.length > 0) {
|
if (element.Names && Object.prototype.toString.call(element.Names) === '[object Array]' && element.Names.length > 0) {
|
||||||
element.Name = element.Names[0].replace(/^\/|\/$/g, '');
|
element.Name = element.Names[0].replace(/^\/|\/$/g, '');
|
||||||
}
|
}
|
||||||
workload.push(dockerContainerInspect(element.Id.trim(), element));
|
workload.push(dockerContainerInspect(element.Id.trim(), element));
|
||||||
});
|
});
|
||||||
if (workload.length) {
|
if (workload.length) {
|
||||||
Promise.all(
|
Promise.all(workload).then((data) => {
|
||||||
workload
|
if (callback) {
|
||||||
).then((data) => {
|
callback(data);
|
||||||
if (callback) { callback(data); }
|
}
|
||||||
resolve(data);
|
resolve(data);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// GC in _docker_container_stats
|
// GC in _docker_container_stats
|
||||||
for (let key in _docker_container_stats) {
|
for (let key in _docker_container_stats) {
|
||||||
if ({}.hasOwnProperty.call(_docker_container_stats, key)) {
|
if ({}.hasOwnProperty.call(_docker_container_stats, key)) {
|
||||||
if (!inContainers(docker_containers, key)) { delete _docker_container_stats[key]; }
|
if (!inContainers(docker_containers, key)) {
|
||||||
|
delete _docker_container_stats[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
}
|
||||||
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -298,12 +309,11 @@ function dockerContainerInspect(containerID, payload) {
|
|||||||
}
|
}
|
||||||
const containerIdSanitized = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerID, true)).trim();
|
const containerIdSanitized = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerID, true)).trim();
|
||||||
if (containerIdSanitized) {
|
if (containerIdSanitized) {
|
||||||
|
|
||||||
if (!_docker_socket) {
|
if (!_docker_socket) {
|
||||||
_docker_socket = new DockerSocket();
|
_docker_socket = new DockerSocket();
|
||||||
}
|
}
|
||||||
|
|
||||||
_docker_socket.getInspect(containerIdSanitized.trim(), data => {
|
_docker_socket.getInspect(containerIdSanitized.trim(), (data) => {
|
||||||
try {
|
try {
|
||||||
resolve({
|
resolve({
|
||||||
id: payload.Id,
|
id: payload.Id,
|
||||||
@ -322,7 +332,7 @@ function dockerContainerInspect(containerID, payload) {
|
|||||||
platform: data.Platform || '',
|
platform: data.Platform || '',
|
||||||
driver: data.Driver || '',
|
driver: data.Driver || '',
|
||||||
ports: payload.Ports,
|
ports: payload.Ports,
|
||||||
mounts: payload.Mounts,
|
mounts: payload.Mounts
|
||||||
// hostconfig: payload.HostConfig,
|
// hostconfig: payload.HostConfig,
|
||||||
// network: payload.NetworkSettings
|
// network: payload.NetworkSettings
|
||||||
});
|
});
|
||||||
@ -363,8 +373,7 @@ function docker_calcCPUPercent(cpu_stats, precpu_stats) {
|
|||||||
// calculate the change for the cpu usage of the container in between readings
|
// calculate the change for the cpu usage of the container in between readings
|
||||||
if (precpu_stats.online_cpus) {
|
if (precpu_stats.online_cpus) {
|
||||||
cpuPercent = (cpuDelta / systemDelta) * precpu_stats.online_cpus * 100.0;
|
cpuPercent = (cpuDelta / systemDelta) * precpu_stats.online_cpus * 100.0;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
cpuPercent = (cpuDelta / systemDelta) * cpu_stats.cpu_usage.percpu_usage.length * 100.0;
|
cpuPercent = (cpuDelta / systemDelta) * cpu_stats.cpu_usage.percpu_usage.length * 100.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -374,10 +383,10 @@ function docker_calcCPUPercent(cpu_stats, precpu_stats) {
|
|||||||
let nanoSecNow = util.nanoSeconds();
|
let nanoSecNow = util.nanoSeconds();
|
||||||
let cpuPercent = 0.0;
|
let cpuPercent = 0.0;
|
||||||
if (_docker_last_read > 0) {
|
if (_docker_last_read > 0) {
|
||||||
let possIntervals = (nanoSecNow - _docker_last_read); // / 100 * os.cpus().length;
|
let possIntervals = nanoSecNow - _docker_last_read; // / 100 * os.cpus().length;
|
||||||
let intervalsUsed = cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage;
|
let intervalsUsed = cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage;
|
||||||
if (possIntervals > 0) {
|
if (possIntervals > 0) {
|
||||||
cpuPercent = 100.0 * intervalsUsed / possIntervals;
|
cpuPercent = (100.0 * intervalsUsed) / possIntervals;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_docker_last_read = nanoSecNow;
|
_docker_last_read = nanoSecNow;
|
||||||
@ -390,7 +399,9 @@ function docker_calcNetworkIO(networks) {
|
|||||||
let wx;
|
let wx;
|
||||||
for (let key in networks) {
|
for (let key in networks) {
|
||||||
// skip loop if the property is from prototype
|
// skip loop if the property is from prototype
|
||||||
if (!{}.hasOwnProperty.call(networks, key)) { continue; }
|
if (!{}.hasOwnProperty.call(networks, key)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @namespace
|
* @namespace
|
||||||
@ -417,7 +428,12 @@ function docker_calcBlockIO(blkio_stats) {
|
|||||||
* @namespace
|
* @namespace
|
||||||
* @property {Array} io_service_bytes_recursive
|
* @property {Array} io_service_bytes_recursive
|
||||||
*/
|
*/
|
||||||
if (blkio_stats && blkio_stats.io_service_bytes_recursive && Object.prototype.toString.call(blkio_stats.io_service_bytes_recursive) === '[object Array]' && blkio_stats.io_service_bytes_recursive.length > 0) {
|
if (
|
||||||
|
blkio_stats &&
|
||||||
|
blkio_stats.io_service_bytes_recursive &&
|
||||||
|
Object.prototype.toString.call(blkio_stats.io_service_bytes_recursive) === '[object Array]' &&
|
||||||
|
blkio_stats.io_service_bytes_recursive.length > 0
|
||||||
|
) {
|
||||||
blkio_stats.io_service_bytes_recursive.forEach(function (element) {
|
blkio_stats.io_service_bytes_recursive.forEach(function (element) {
|
||||||
/**
|
/**
|
||||||
* @namespace
|
* @namespace
|
||||||
@ -437,11 +453,9 @@ function docker_calcBlockIO(blkio_stats) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function dockerContainerStats(containerIDs, callback) {
|
function dockerContainerStats(containerIDs, callback) {
|
||||||
|
|
||||||
let containerArray = [];
|
let containerArray = [];
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
|
|
||||||
// fallback - if only callback is given
|
// fallback - if only callback is given
|
||||||
if (util.isFunction(containerIDs) && !callback) {
|
if (util.isFunction(containerIDs) && !callback) {
|
||||||
callback = containerIDs;
|
callback = containerIDs;
|
||||||
@ -449,7 +463,9 @@ function dockerContainerStats(containerIDs, callback) {
|
|||||||
} else {
|
} else {
|
||||||
containerIDs = containerIDs || '*';
|
containerIDs = containerIDs || '*';
|
||||||
if (typeof containerIDs !== 'string') {
|
if (typeof containerIDs !== 'string') {
|
||||||
if (callback) { callback([]); }
|
if (callback) {
|
||||||
|
callback([]);
|
||||||
|
}
|
||||||
return resolve([]);
|
return resolve([]);
|
||||||
}
|
}
|
||||||
let containerIDsSanitized = '';
|
let containerIDsSanitized = '';
|
||||||
@ -491,17 +507,21 @@ function dockerContainerStats(containerIDs, callback) {
|
|||||||
const workload = [];
|
const workload = [];
|
||||||
if (containerArray.length && containerArray[0].trim() === '*') {
|
if (containerArray.length && containerArray[0].trim() === '*') {
|
||||||
containerArray = [];
|
containerArray = [];
|
||||||
dockerContainers().then(allContainers => {
|
dockerContainers().then((allContainers) => {
|
||||||
for (let container of allContainers) {
|
for (let container of allContainers) {
|
||||||
containerArray.push(container.id.substring(0, 12));
|
containerArray.push(container.id.substring(0, 12));
|
||||||
}
|
}
|
||||||
if (containerArray.length) {
|
if (containerArray.length) {
|
||||||
dockerContainerStats(containerArray.join(',')).then(result => {
|
dockerContainerStats(containerArray.join(',')).then((result) => {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -510,14 +530,16 @@ function dockerContainerStats(containerIDs, callback) {
|
|||||||
workload.push(dockerContainerStatsSingle(containerID.trim()));
|
workload.push(dockerContainerStatsSingle(containerID.trim()));
|
||||||
}
|
}
|
||||||
if (workload.length) {
|
if (workload.length) {
|
||||||
Promise.all(
|
Promise.all(workload).then((data) => {
|
||||||
workload
|
if (callback) {
|
||||||
).then((data) => {
|
callback(data);
|
||||||
if (callback) { callback(data); }
|
}
|
||||||
resolve(data);
|
resolve(data);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -549,35 +571,40 @@ function dockerContainerStatsSingle(containerID) {
|
|||||||
cpuStats: {},
|
cpuStats: {},
|
||||||
precpuStats: {},
|
precpuStats: {},
|
||||||
memoryStats: {},
|
memoryStats: {},
|
||||||
networks: {},
|
networks: {}
|
||||||
};
|
};
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
if (containerID) {
|
if (containerID) {
|
||||||
|
|
||||||
if (!_docker_socket) {
|
if (!_docker_socket) {
|
||||||
_docker_socket = new DockerSocket();
|
_docker_socket = new DockerSocket();
|
||||||
}
|
}
|
||||||
|
|
||||||
_docker_socket.getInspect(containerID, dataInspect => {
|
_docker_socket.getInspect(containerID, (dataInspect) => {
|
||||||
try {
|
try {
|
||||||
_docker_socket.getStats(containerID, data => {
|
_docker_socket.getStats(containerID, (data) => {
|
||||||
try {
|
try {
|
||||||
let stats = data;
|
let stats = data;
|
||||||
if (!stats.message) {
|
if (!stats.message) {
|
||||||
if (data.id) { result.id = data.id; }
|
if (data.id) {
|
||||||
result.memUsage = (stats.memory_stats && stats.memory_stats.usage ? stats.memory_stats.usage : 0);
|
result.id = data.id;
|
||||||
result.memLimit = (stats.memory_stats && stats.memory_stats.limit ? stats.memory_stats.limit : 0);
|
}
|
||||||
result.memPercent = (stats.memory_stats && stats.memory_stats.usage && stats.memory_stats.limit ? stats.memory_stats.usage / stats.memory_stats.limit * 100.0 : 0);
|
result.memUsage = stats.memory_stats && stats.memory_stats.usage ? stats.memory_stats.usage : 0;
|
||||||
result.cpuPercent = (stats.cpu_stats && stats.precpu_stats ? docker_calcCPUPercent(stats.cpu_stats, stats.precpu_stats) : 0);
|
result.memLimit = stats.memory_stats && stats.memory_stats.limit ? stats.memory_stats.limit : 0;
|
||||||
result.pids = (stats.pids_stats && stats.pids_stats.current ? stats.pids_stats.current : 0);
|
result.memPercent = stats.memory_stats && stats.memory_stats.usage && stats.memory_stats.limit ? (stats.memory_stats.usage / stats.memory_stats.limit) * 100.0 : 0;
|
||||||
result.restartCount = (dataInspect.RestartCount ? dataInspect.RestartCount : 0);
|
result.cpuPercent = stats.cpu_stats && stats.precpu_stats ? docker_calcCPUPercent(stats.cpu_stats, stats.precpu_stats) : 0;
|
||||||
if (stats.networks) { result.netIO = docker_calcNetworkIO(stats.networks); }
|
result.pids = stats.pids_stats && stats.pids_stats.current ? stats.pids_stats.current : 0;
|
||||||
if (stats.blkio_stats) { result.blockIO = docker_calcBlockIO(stats.blkio_stats); }
|
result.restartCount = dataInspect.RestartCount ? dataInspect.RestartCount : 0;
|
||||||
result.cpuStats = (stats.cpu_stats ? stats.cpu_stats : {});
|
if (stats.networks) {
|
||||||
result.precpuStats = (stats.precpu_stats ? stats.precpu_stats : {});
|
result.netIO = docker_calcNetworkIO(stats.networks);
|
||||||
result.memoryStats = (stats.memory_stats ? stats.memory_stats : {});
|
}
|
||||||
result.networks = (stats.networks ? stats.networks : {});
|
if (stats.blkio_stats) {
|
||||||
|
result.blockIO = docker_calcBlockIO(stats.blkio_stats);
|
||||||
|
}
|
||||||
|
result.cpuStats = stats.cpu_stats ? stats.cpu_stats : {};
|
||||||
|
result.precpuStats = stats.precpu_stats ? stats.precpu_stats : {};
|
||||||
|
result.memoryStats = stats.memory_stats ? stats.memory_stats : {};
|
||||||
|
result.networks = stats.networks ? stats.networks : {};
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
util.noop();
|
util.noop();
|
||||||
@ -612,12 +639,11 @@ function dockerContainerProcesses(containerID, callback) {
|
|||||||
const containerIdSanitized = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerID, true)).trim();
|
const containerIdSanitized = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerID, true)).trim();
|
||||||
|
|
||||||
if (containerIdSanitized) {
|
if (containerIdSanitized) {
|
||||||
|
|
||||||
if (!_docker_socket) {
|
if (!_docker_socket) {
|
||||||
_docker_socket = new DockerSocket();
|
_docker_socket = new DockerSocket();
|
||||||
}
|
}
|
||||||
|
|
||||||
_docker_socket.getProcesses(containerIdSanitized, data => {
|
_docker_socket.getProcesses(containerIdSanitized, (data) => {
|
||||||
/**
|
/**
|
||||||
* @namespace
|
* @namespace
|
||||||
* @property {Array} Titles
|
* @property {Array} Titles
|
||||||
@ -643,33 +669,37 @@ function dockerContainerProcesses(containerID, callback) {
|
|||||||
let pos_rss = titles.indexOf('RSS');
|
let pos_rss = titles.indexOf('RSS');
|
||||||
let pos_command = titles.indexOf('COMMAND');
|
let pos_command = titles.indexOf('COMMAND');
|
||||||
|
|
||||||
data.Processes.forEach(process => {
|
data.Processes.forEach((process) => {
|
||||||
result.push({
|
result.push({
|
||||||
pidHost: (pos_pid >= 0 ? process[pos_pid] : ''),
|
pidHost: pos_pid >= 0 ? process[pos_pid] : '',
|
||||||
ppid: (pos_ppid >= 0 ? process[pos_ppid] : ''),
|
ppid: pos_ppid >= 0 ? process[pos_ppid] : '',
|
||||||
pgid: (pos_pgid >= 0 ? process[pos_pgid] : ''),
|
pgid: pos_pgid >= 0 ? process[pos_pgid] : '',
|
||||||
user: (pos_user >= 0 ? process[pos_user] : ''),
|
user: pos_user >= 0 ? process[pos_user] : '',
|
||||||
ruser: (pos_ruser >= 0 ? process[pos_ruser] : ''),
|
ruser: pos_ruser >= 0 ? process[pos_ruser] : '',
|
||||||
group: (pos_group >= 0 ? process[pos_group] : ''),
|
group: pos_group >= 0 ? process[pos_group] : '',
|
||||||
rgroup: (pos_rgroup >= 0 ? process[pos_rgroup] : ''),
|
rgroup: pos_rgroup >= 0 ? process[pos_rgroup] : '',
|
||||||
stat: (pos_stat >= 0 ? process[pos_stat] : ''),
|
stat: pos_stat >= 0 ? process[pos_stat] : '',
|
||||||
time: (pos_time >= 0 ? process[pos_time] : ''),
|
time: pos_time >= 0 ? process[pos_time] : '',
|
||||||
elapsed: (pos_elapsed >= 0 ? process[pos_elapsed] : ''),
|
elapsed: pos_elapsed >= 0 ? process[pos_elapsed] : '',
|
||||||
nice: (pos_ni >= 0 ? process[pos_ni] : ''),
|
nice: pos_ni >= 0 ? process[pos_ni] : '',
|
||||||
rss: (pos_rss >= 0 ? process[pos_rss] : ''),
|
rss: pos_rss >= 0 ? process[pos_rss] : '',
|
||||||
vsz: (pos_vsz >= 0 ? process[pos_vsz] : ''),
|
vsz: pos_vsz >= 0 ? process[pos_vsz] : '',
|
||||||
command: (pos_command >= 0 ? process[pos_command] : '')
|
command: pos_command >= 0 ? process[pos_command] : ''
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
util.noop();
|
util.noop();
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -679,7 +709,6 @@ function dockerContainerProcesses(containerID, callback) {
|
|||||||
exports.dockerContainerProcesses = dockerContainerProcesses;
|
exports.dockerContainerProcesses = dockerContainerProcesses;
|
||||||
|
|
||||||
function dockerVolumes(callback) {
|
function dockerVolumes(callback) {
|
||||||
|
|
||||||
let result = [];
|
let result = [];
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
@ -691,9 +720,7 @@ function dockerVolumes(callback) {
|
|||||||
try {
|
try {
|
||||||
dockerVolumes = data;
|
dockerVolumes = data;
|
||||||
if (dockerVolumes && dockerVolumes.Volumes && Object.prototype.toString.call(dockerVolumes.Volumes) === '[object Array]' && dockerVolumes.Volumes.length > 0) {
|
if (dockerVolumes && dockerVolumes.Volumes && Object.prototype.toString.call(dockerVolumes.Volumes) === '[object Array]' && dockerVolumes.Volumes.length > 0) {
|
||||||
|
|
||||||
dockerVolumes.Volumes.forEach(function (element) {
|
dockerVolumes.Volumes.forEach(function (element) {
|
||||||
|
|
||||||
result.push({
|
result.push({
|
||||||
name: element.Name,
|
name: element.Name,
|
||||||
driver: element.Driver,
|
driver: element.Driver,
|
||||||
@ -701,17 +728,23 @@ function dockerVolumes(callback) {
|
|||||||
mountpoint: element.Mountpoint,
|
mountpoint: element.Mountpoint,
|
||||||
options: element.Options,
|
options: element.Options,
|
||||||
scope: element.Scope,
|
scope: element.Scope,
|
||||||
created: element.CreatedAt ? Math.round(new Date(element.CreatedAt).getTime() / 1000) : 0,
|
created: element.CreatedAt ? Math.round(new Date(element.CreatedAt).getTime() / 1000) : 0
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
} else {
|
} else {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -724,7 +757,7 @@ exports.dockerVolumes = dockerVolumes;
|
|||||||
function dockerAll(callback) {
|
function dockerAll(callback) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
dockerContainers(true).then(result => {
|
dockerContainers(true).then((result) => {
|
||||||
if (result && Object.prototype.toString.call(result) === '[object Array]' && result.length > 0) {
|
if (result && Object.prototype.toString.call(result) === '[object Array]' && result.length > 0) {
|
||||||
let l = result.length;
|
let l = result.length;
|
||||||
result.forEach(function (element) {
|
result.forEach(function (element) {
|
||||||
@ -742,12 +775,14 @@ function dockerAll(callback) {
|
|||||||
element.memoryStats = res[0].memoryStats;
|
element.memoryStats = res[0].memoryStats;
|
||||||
element.networks = res[0].networks;
|
element.networks = res[0].networks;
|
||||||
|
|
||||||
dockerContainerProcesses(element.id).then(processes => {
|
dockerContainerProcesses(element.id).then((processes) => {
|
||||||
element.processes = processes;
|
element.processes = processes;
|
||||||
|
|
||||||
l -= 1;
|
l -= 1;
|
||||||
if (l === 0) {
|
if (l === 0) {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -755,7 +790,9 @@ function dockerAll(callback) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
@ -18,10 +18,8 @@ const isWin = require('os').type() === 'Windows_NT';
|
|||||||
const socketPath = isWin ? '//./pipe/docker_engine' : '/var/run/docker.sock';
|
const socketPath = isWin ? '//./pipe/docker_engine' : '/var/run/docker.sock';
|
||||||
|
|
||||||
class DockerSocket {
|
class DockerSocket {
|
||||||
|
|
||||||
getInfo(callback) {
|
getInfo(callback) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
let socket = net.createConnection({ path: socketPath });
|
let socket = net.createConnection({ path: socketPath });
|
||||||
let alldata = '';
|
let alldata = '';
|
||||||
let data;
|
let data;
|
||||||
@ -30,7 +28,7 @@ class DockerSocket {
|
|||||||
socket.write('GET http:/info HTTP/1.0\r\n\r\n');
|
socket.write('GET http:/info HTTP/1.0\r\n\r\n');
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('data', data => {
|
socket.on('data', (data) => {
|
||||||
alldata = alldata + data.toString();
|
alldata = alldata + data.toString();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -57,7 +55,6 @@ class DockerSocket {
|
|||||||
|
|
||||||
listImages(all, callback) {
|
listImages(all, callback) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
let socket = net.createConnection({ path: socketPath });
|
let socket = net.createConnection({ path: socketPath });
|
||||||
let alldata = '';
|
let alldata = '';
|
||||||
let data;
|
let data;
|
||||||
@ -66,7 +63,7 @@ class DockerSocket {
|
|||||||
socket.write('GET http:/images/json' + (all ? '?all=1' : '') + ' HTTP/1.0\r\n\r\n');
|
socket.write('GET http:/images/json' + (all ? '?all=1' : '') + ' HTTP/1.0\r\n\r\n');
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('data', data => {
|
socket.on('data', (data) => {
|
||||||
alldata = alldata + data.toString();
|
alldata = alldata + data.toString();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -103,7 +100,7 @@ class DockerSocket {
|
|||||||
socket.write('GET http:/images/' + id + '/json?stream=0 HTTP/1.0\r\n\r\n');
|
socket.write('GET http:/images/' + id + '/json?stream=0 HTTP/1.0\r\n\r\n');
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('data', data => {
|
socket.on('data', (data) => {
|
||||||
alldata = alldata + data.toString();
|
alldata = alldata + data.toString();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -133,7 +130,6 @@ class DockerSocket {
|
|||||||
|
|
||||||
listContainers(all, callback) {
|
listContainers(all, callback) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
let socket = net.createConnection({ path: socketPath });
|
let socket = net.createConnection({ path: socketPath });
|
||||||
let alldata = '';
|
let alldata = '';
|
||||||
let data;
|
let data;
|
||||||
@ -142,7 +138,7 @@ class DockerSocket {
|
|||||||
socket.write('GET http:/containers/json' + (all ? '?all=1' : '') + ' HTTP/1.0\r\n\r\n');
|
socket.write('GET http:/containers/json' + (all ? '?all=1' : '') + ' HTTP/1.0\r\n\r\n');
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('data', data => {
|
socket.on('data', (data) => {
|
||||||
alldata = alldata + data.toString();
|
alldata = alldata + data.toString();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -179,7 +175,7 @@ class DockerSocket {
|
|||||||
socket.write('GET http:/containers/' + id + '/stats?stream=0 HTTP/1.0\r\n\r\n');
|
socket.write('GET http:/containers/' + id + '/stats?stream=0 HTTP/1.0\r\n\r\n');
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('data', data => {
|
socket.on('data', (data) => {
|
||||||
alldata = alldata + data.toString();
|
alldata = alldata + data.toString();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -219,7 +215,7 @@ class DockerSocket {
|
|||||||
socket.write('GET http:/containers/' + id + '/json?stream=0 HTTP/1.0\r\n\r\n');
|
socket.write('GET http:/containers/' + id + '/json?stream=0 HTTP/1.0\r\n\r\n');
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('data', data => {
|
socket.on('data', (data) => {
|
||||||
alldata = alldata + data.toString();
|
alldata = alldata + data.toString();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -259,7 +255,7 @@ class DockerSocket {
|
|||||||
socket.write('GET http:/containers/' + id + '/top?ps_args=-opid,ppid,pgid,vsz,time,etime,nice,ruser,user,rgroup,group,stat,rss,args HTTP/1.0\r\n\r\n');
|
socket.write('GET http:/containers/' + id + '/top?ps_args=-opid,ppid,pgid,vsz,time,etime,nice,ruser,user,rgroup,group,stat,rss,args HTTP/1.0\r\n\r\n');
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('data', data => {
|
socket.on('data', (data) => {
|
||||||
alldata = alldata + data.toString();
|
alldata = alldata + data.toString();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -289,7 +285,6 @@ class DockerSocket {
|
|||||||
|
|
||||||
listVolumes(callback) {
|
listVolumes(callback) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
let socket = net.createConnection({ path: socketPath });
|
let socket = net.createConnection({ path: socketPath });
|
||||||
let alldata = '';
|
let alldata = '';
|
||||||
let data;
|
let data;
|
||||||
@ -298,7 +293,7 @@ class DockerSocket {
|
|||||||
socket.write('GET http:/volumes HTTP/1.0\r\n\r\n');
|
socket.write('GET http:/volumes HTTP/1.0\r\n\r\n');
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('data', data => {
|
socket.on('data', (data) => {
|
||||||
alldata = alldata + data.toString();
|
alldata = alldata + data.toString();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Contributors: Guillaume Legrain (https://github.com/glegrain)
|
// Contributors: Guillaume Legrain (https://github.com/glegrain)
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
@ -17,19 +17,18 @@ const util = require('./util');
|
|||||||
|
|
||||||
let _platform = process.platform;
|
let _platform = process.platform;
|
||||||
|
|
||||||
const _linux = (_platform === 'linux' || _platform === 'android');
|
const _linux = _platform === 'linux' || _platform === 'android';
|
||||||
const _darwin = (_platform === 'darwin');
|
const _darwin = _platform === 'darwin';
|
||||||
const _windows = (_platform === 'win32');
|
const _windows = _platform === 'win32';
|
||||||
const _freebsd = (_platform === 'freebsd');
|
const _freebsd = _platform === 'freebsd';
|
||||||
const _openbsd = (_platform === 'openbsd');
|
const _openbsd = _platform === 'openbsd';
|
||||||
const _netbsd = (_platform === 'netbsd');
|
const _netbsd = _platform === 'netbsd';
|
||||||
const _sunos = (_platform === 'sunos');
|
const _sunos = _platform === 'sunos';
|
||||||
|
|
||||||
// --------------------------
|
// --------------------------
|
||||||
// check if external site is available
|
// check if external site is available
|
||||||
|
|
||||||
function inetChecksite(url, callback) {
|
function inetChecksite(url, callback) {
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
let result = {
|
let result = {
|
||||||
@ -39,7 +38,9 @@ function inetChecksite(url, callback) {
|
|||||||
ms: null
|
ms: null
|
||||||
};
|
};
|
||||||
if (typeof url !== 'string') {
|
if (typeof url !== 'string') {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
return resolve(result);
|
return resolve(result);
|
||||||
}
|
}
|
||||||
let urlSanitized = '';
|
let urlSanitized = '';
|
||||||
@ -68,24 +69,39 @@ function inetChecksite(url, callback) {
|
|||||||
Object.setPrototypeOf(urlSanitized, util.stringObj);
|
Object.setPrototypeOf(urlSanitized, util.stringObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (urlSanitized.startsWith('file:') || urlSanitized.startsWith('gopher:') || urlSanitized.startsWith('telnet:') || urlSanitized.startsWith('mailto:') || urlSanitized.startsWith('news:') || urlSanitized.startsWith('nntp:')) {
|
if (
|
||||||
if (callback) { callback(result); }
|
urlSanitized.startsWith('file:') ||
|
||||||
|
urlSanitized.startsWith('gopher:') ||
|
||||||
|
urlSanitized.startsWith('telnet:') ||
|
||||||
|
urlSanitized.startsWith('mailto:') ||
|
||||||
|
urlSanitized.startsWith('news:') ||
|
||||||
|
urlSanitized.startsWith('nntp:')
|
||||||
|
) {
|
||||||
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
return resolve(result);
|
return resolve(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
util.checkWebsite(urlSanitized).then((res) => {
|
util.checkWebsite(urlSanitized).then((res) => {
|
||||||
result.status = res.statusCode;
|
result.status = res.statusCode;
|
||||||
result.ok = res.statusCode >= 200 && res.statusCode <= 399;;
|
result.ok = res.statusCode >= 200 && res.statusCode <= 399;
|
||||||
result.ms = (result.ok ? res.time : null);
|
result.ms = result.ok ? res.time : null;
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -98,7 +114,6 @@ exports.inetChecksite = inetChecksite;
|
|||||||
// check inet latency
|
// check inet latency
|
||||||
|
|
||||||
function inetLatency(host, callback) {
|
function inetLatency(host, callback) {
|
||||||
|
|
||||||
// fallback - if only callback is given
|
// fallback - if only callback is given
|
||||||
if (util.isFunction(host) && !callback) {
|
if (util.isFunction(host) && !callback) {
|
||||||
callback = host;
|
callback = host;
|
||||||
@ -110,7 +125,9 @@ function inetLatency(host, callback) {
|
|||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
if (typeof host !== 'string') {
|
if (typeof host !== 'string') {
|
||||||
if (callback) { callback(null); }
|
if (callback) {
|
||||||
|
callback(null);
|
||||||
|
}
|
||||||
return resolve(null);
|
return resolve(null);
|
||||||
}
|
}
|
||||||
let hostSanitized = '';
|
let hostSanitized = '';
|
||||||
@ -136,8 +153,17 @@ function inetLatency(host, callback) {
|
|||||||
Object.setPrototypeOf(hostSanitized, util.stringObj);
|
Object.setPrototypeOf(hostSanitized, util.stringObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hostSanitized.startsWith('file:') || hostSanitized.startsWith('gopher:') || hostSanitized.startsWith('telnet:') || hostSanitized.startsWith('mailto:') || hostSanitized.startsWith('news:') || hostSanitized.startsWith('nntp:')) {
|
if (
|
||||||
if (callback) { callback(null); }
|
hostSanitized.startsWith('file:') ||
|
||||||
|
hostSanitized.startsWith('gopher:') ||
|
||||||
|
hostSanitized.startsWith('telnet:') ||
|
||||||
|
hostSanitized.startsWith('mailto:') ||
|
||||||
|
hostSanitized.startsWith('news:') ||
|
||||||
|
hostSanitized.startsWith('nntp:')
|
||||||
|
) {
|
||||||
|
if (callback) {
|
||||||
|
callback(null);
|
||||||
|
}
|
||||||
return resolve(null);
|
return resolve(null);
|
||||||
}
|
}
|
||||||
let params;
|
let params;
|
||||||
@ -154,7 +180,10 @@ function inetLatency(host, callback) {
|
|||||||
util.execSafe('ping', params).then((stdout) => {
|
util.execSafe('ping', params).then((stdout) => {
|
||||||
let result = null;
|
let result = null;
|
||||||
if (stdout) {
|
if (stdout) {
|
||||||
const lines = stdout.split('\n').filter((line) => (line.indexOf('rtt') >= 0 || line.indexOf('round-trip') >= 0 || line.indexOf('avg') >= 0)).join('\n');
|
const lines = stdout
|
||||||
|
.split('\n')
|
||||||
|
.filter((line) => line.indexOf('rtt') >= 0 || line.indexOf('round-trip') >= 0 || line.indexOf('avg') >= 0)
|
||||||
|
.join('\n');
|
||||||
|
|
||||||
const line = lines.split('=');
|
const line = lines.split('=');
|
||||||
if (line.length > 1) {
|
if (line.length > 1) {
|
||||||
@ -164,7 +193,9 @@ function inetLatency(host, callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -174,7 +205,10 @@ function inetLatency(host, callback) {
|
|||||||
util.execSafe('ping', params, { timeout: 3000 }).then((stdout) => {
|
util.execSafe('ping', params, { timeout: 3000 }).then((stdout) => {
|
||||||
let result = null;
|
let result = null;
|
||||||
if (stdout) {
|
if (stdout) {
|
||||||
const lines = stdout.split('\n').filter(line => line.indexOf(filt) >= 0).join('\n');
|
const lines = stdout
|
||||||
|
.split('\n')
|
||||||
|
.filter((line) => line.indexOf(filt) >= 0)
|
||||||
|
.join('\n');
|
||||||
const line = lines.split('=');
|
const line = lines.split('=');
|
||||||
if (line.length > 1) {
|
if (line.length > 1) {
|
||||||
const parts = line[1].split('/');
|
const parts = line[1].split('/');
|
||||||
@ -183,7 +217,9 @@ function inetLatency(host, callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -204,11 +240,15 @@ function inetLatency(host, callback) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
189
lib/memory.js
189
lib/memory.js
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
@ -21,13 +21,13 @@ const fs = require('fs');
|
|||||||
|
|
||||||
let _platform = process.platform;
|
let _platform = process.platform;
|
||||||
|
|
||||||
const _linux = (_platform === 'linux' || _platform === 'android');
|
const _linux = _platform === 'linux' || _platform === 'android';
|
||||||
const _darwin = (_platform === 'darwin');
|
const _darwin = _platform === 'darwin';
|
||||||
const _windows = (_platform === 'win32');
|
const _windows = _platform === 'win32';
|
||||||
const _freebsd = (_platform === 'freebsd');
|
const _freebsd = _platform === 'freebsd';
|
||||||
const _openbsd = (_platform === 'openbsd');
|
const _openbsd = _platform === 'openbsd';
|
||||||
const _netbsd = (_platform === 'netbsd');
|
const _netbsd = _platform === 'netbsd';
|
||||||
const _sunos = (_platform === 'sunos');
|
const _sunos = _platform === 'sunos';
|
||||||
|
|
||||||
const RAM_manufacturers = {
|
const RAM_manufacturers = {
|
||||||
'00CE': 'Samsung Electronics Inc',
|
'00CE': 'Samsung Electronics Inc',
|
||||||
@ -39,24 +39,24 @@ const RAM_manufacturers = {
|
|||||||
'04CB': 'A-DATA',
|
'04CB': 'A-DATA',
|
||||||
'04CD': 'G.Skill International Enterprise',
|
'04CD': 'G.Skill International Enterprise',
|
||||||
'059B': 'Crucial',
|
'059B': 'Crucial',
|
||||||
'1315': 'Crucial',
|
1315: 'Crucial',
|
||||||
'2C00': 'Micron Technology Inc.',
|
'2C00': 'Micron Technology Inc.',
|
||||||
'5105': 'Qimonda AG i. In.',
|
5105: 'Qimonda AG i. In.',
|
||||||
'802C': 'Micron Technology Inc.',
|
'802C': 'Micron Technology Inc.',
|
||||||
'80AD': 'Hynix Semiconductor Inc.',
|
'80AD': 'Hynix Semiconductor Inc.',
|
||||||
'80CE': 'Samsung Electronics Inc.',
|
'80CE': 'Samsung Electronics Inc.',
|
||||||
'8551': 'Qimonda AG i. In.',
|
8551: 'Qimonda AG i. In.',
|
||||||
'859B': 'Crucial',
|
'859B': 'Crucial',
|
||||||
'AD00': 'Hynix Semiconductor Inc.',
|
AD00: 'Hynix Semiconductor Inc.',
|
||||||
'CE00': 'Samsung Electronics Inc.',
|
CE00: 'Samsung Electronics Inc.',
|
||||||
'SAMSUNG': 'Samsung Electronics Inc.',
|
SAMSUNG: 'Samsung Electronics Inc.',
|
||||||
'HYNIX': 'Hynix Semiconductor Inc.',
|
HYNIX: 'Hynix Semiconductor Inc.',
|
||||||
'G-SKILL': 'G-Skill International Enterprise',
|
'G-SKILL': 'G-Skill International Enterprise',
|
||||||
'G.SKILL': 'G-Skill International Enterprise',
|
'G.SKILL': 'G-Skill International Enterprise',
|
||||||
'TRANSCEND': 'Transcend Information',
|
TRANSCEND: 'Transcend Information',
|
||||||
'APACER': 'Apacer Technology Inc',
|
APACER: 'Apacer Technology Inc',
|
||||||
'MICRON': 'Micron Technology Inc.',
|
MICRON: 'Micron Technology Inc.',
|
||||||
'QIMONDA': 'Qimonda AG i. In.',
|
QIMONDA: 'Qimonda AG i. In.'
|
||||||
};
|
};
|
||||||
|
|
||||||
// _______________________________________________________________________________________
|
// _______________________________________________________________________________________
|
||||||
@ -137,10 +137,8 @@ const RAM_manufacturers = {
|
|||||||
// SUnreclaim: 79352 kB
|
// SUnreclaim: 79352 kB
|
||||||
|
|
||||||
function mem(callback) {
|
function mem(callback) {
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
|
|
||||||
let result = {
|
let result = {
|
||||||
total: os.totalmem(),
|
total: os.totalmem(),
|
||||||
free: os.freemem(),
|
free: os.freemem(),
|
||||||
@ -196,17 +194,23 @@ function mem(callback) {
|
|||||||
result.reclaimable = parseInt(util.getValue(lines, 'sreclaimable'), 10);
|
result.reclaimable = parseInt(util.getValue(lines, 'sreclaimable'), 10);
|
||||||
result.reclaimable = result.reclaimable ? result.reclaimable * 1024 : 0;
|
result.reclaimable = result.reclaimable ? result.reclaimable * 1024 : 0;
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_freebsd || _openbsd || _netbsd) {
|
if (_freebsd || _openbsd || _netbsd) {
|
||||||
try {
|
try {
|
||||||
exec('/sbin/sysctl hw.realmem hw.physmem vm.stats.vm.v_page_count vm.stats.vm.v_wire_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_cache_count vm.stats.vm.v_free_count vm.stats.vm.v_page_size', function (error, stdout) {
|
exec(
|
||||||
|
'/sbin/sysctl hw.realmem hw.physmem vm.stats.vm.v_page_count vm.stats.vm.v_wire_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_cache_count vm.stats.vm.v_free_count vm.stats.vm.v_page_size',
|
||||||
|
function (error, stdout) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
const pagesize = parseInt(util.getValue(lines, 'vm.stats.vm.v_page_size'), 10);
|
const pagesize = parseInt(util.getValue(lines, 'vm.stats.vm.v_page_size'), 10);
|
||||||
@ -214,7 +218,9 @@ function mem(callback) {
|
|||||||
const cache = parseInt(util.getValue(lines, 'vm.stats.vm.v_cache_count'), 10) * pagesize;
|
const cache = parseInt(util.getValue(lines, 'vm.stats.vm.v_cache_count'), 10) * pagesize;
|
||||||
|
|
||||||
result.total = parseInt(util.getValue(lines, 'hw.realmem'), 10);
|
result.total = parseInt(util.getValue(lines, 'hw.realmem'), 10);
|
||||||
if (isNaN(result.total)) { result.total = parseInt(util.getValue(lines, 'hw.physmem'), 10); }
|
if (isNaN(result.total)) {
|
||||||
|
result.total = parseInt(util.getValue(lines, 'hw.physmem'), 10);
|
||||||
|
}
|
||||||
result.free = parseInt(util.getValue(lines, 'vm.stats.vm.v_free_count'), 10) * pagesize;
|
result.free = parseInt(util.getValue(lines, 'vm.stats.vm.v_free_count'), 10) * pagesize;
|
||||||
result.buffcache = inactive + cache;
|
result.buffcache = inactive + cache;
|
||||||
result.available = result.buffcache + result.free;
|
result.available = result.buffcache + result.free;
|
||||||
@ -223,18 +229,24 @@ function mem(callback) {
|
|||||||
result.swaptotal = 0;
|
result.swaptotal = 0;
|
||||||
result.swapfree = 0;
|
result.swapfree = 0;
|
||||||
result.swapused = 0;
|
result.swapused = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
}
|
||||||
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_sunos) {
|
if (_sunos) {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
if (_darwin) {
|
if (_darwin) {
|
||||||
@ -260,19 +272,29 @@ function mem(callback) {
|
|||||||
if (lines.length > 0) {
|
if (lines.length > 0) {
|
||||||
let firstline = lines[0].replace(/,/g, '.').replace(/M/g, '');
|
let firstline = lines[0].replace(/,/g, '.').replace(/M/g, '');
|
||||||
let lineArray = firstline.trim().split(' ');
|
let lineArray = firstline.trim().split(' ');
|
||||||
lineArray.forEach(line => {
|
lineArray.forEach((line) => {
|
||||||
if (line.toLowerCase().indexOf('total') !== -1) { result.swaptotal = parseFloat(line.split('=')[1].trim()) * 1024 * 1024; }
|
if (line.toLowerCase().indexOf('total') !== -1) {
|
||||||
if (line.toLowerCase().indexOf('used') !== -1) { result.swapused = parseFloat(line.split('=')[1].trim()) * 1024 * 1024; }
|
result.swaptotal = parseFloat(line.split('=')[1].trim()) * 1024 * 1024;
|
||||||
if (line.toLowerCase().indexOf('free') !== -1) { result.swapfree = parseFloat(line.split('=')[1].trim()) * 1024 * 1024; }
|
}
|
||||||
|
if (line.toLowerCase().indexOf('used') !== -1) {
|
||||||
|
result.swapused = parseFloat(line.split('=')[1].trim()) * 1024 * 1024;
|
||||||
|
}
|
||||||
|
if (line.toLowerCase().indexOf('free') !== -1) {
|
||||||
|
result.swapfree = parseFloat(line.split('=')[1].trim()) * 1024 * 1024;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -282,7 +304,10 @@ function mem(callback) {
|
|||||||
try {
|
try {
|
||||||
util.powerShell('Get-CimInstance Win32_PageFileUsage | Select AllocatedBaseSize, CurrentUsage').then((stdout, error) => {
|
util.powerShell('Get-CimInstance Win32_PageFileUsage | Select AllocatedBaseSize, CurrentUsage').then((stdout, error) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
let lines = stdout.split('\r\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0);
|
let lines = stdout
|
||||||
|
.split('\r\n')
|
||||||
|
.filter((line) => line.trim() !== '')
|
||||||
|
.filter((line, idx) => idx > 0);
|
||||||
lines.forEach(function (line) {
|
lines.forEach(function (line) {
|
||||||
if (line !== '') {
|
if (line !== '') {
|
||||||
line = line.trim().split(/\s\s+/);
|
line = line.trim().split(/\s\s+/);
|
||||||
@ -295,11 +320,15 @@ function mem(callback) {
|
|||||||
result.swapused = swapused * 1024 * 1024;
|
result.swapused = swapused * 1024 * 1024;
|
||||||
result.swapfree = result.swaptotal - result.swapused;
|
result.swapfree = result.swaptotal - result.swapused;
|
||||||
|
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -310,22 +339,22 @@ function mem(callback) {
|
|||||||
exports.mem = mem;
|
exports.mem = mem;
|
||||||
|
|
||||||
function memLayout(callback) {
|
function memLayout(callback) {
|
||||||
|
|
||||||
function getManufacturer(manId) {
|
function getManufacturer(manId) {
|
||||||
const manIdSearch = manId.replace('0x', '').toUpperCase();
|
const manIdSearch = manId.replace('0x', '').toUpperCase();
|
||||||
if (manIdSearch.length >= 4 && {}.hasOwnProperty.call(RAM_manufacturers, manIdSearch)) {
|
if (manIdSearch.length >= 4 && {}.hasOwnProperty.call(RAM_manufacturers, manIdSearch)) {
|
||||||
return (RAM_manufacturers[manIdSearch]);
|
return RAM_manufacturers[manIdSearch];
|
||||||
}
|
}
|
||||||
return manId;
|
return manId;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
|
|
||||||
let result = [];
|
let result = [];
|
||||||
|
|
||||||
if (_linux || _freebsd || _openbsd || _netbsd) {
|
if (_linux || _freebsd || _openbsd || _netbsd) {
|
||||||
exec('export LC_ALL=C; dmidecode -t memory 2>/dev/null | grep -iE "Size:|Type|Speed|Manufacturer|Form Factor|Locator|Memory Device|Serial Number|Voltage|Part Number"; unset LC_ALL', function (error, stdout) {
|
exec(
|
||||||
|
'export LC_ALL=C; dmidecode -t memory 2>/dev/null | grep -iE "Size:|Type|Speed|Manufacturer|Form Factor|Locator|Memory Device|Serial Number|Voltage|Part Number"; unset LC_ALL',
|
||||||
|
function (error, stdout) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
let devices = stdout.toString().split('Memory Device');
|
let devices = stdout.toString().split('Memory Device');
|
||||||
devices.shift();
|
devices.shift();
|
||||||
@ -345,14 +374,18 @@ function memLayout(callback) {
|
|||||||
bank,
|
bank,
|
||||||
type: util.getValue(lines, 'Type:'),
|
type: util.getValue(lines, 'Type:'),
|
||||||
ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,
|
ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,
|
||||||
clockSpeed: (util.getValue(lines, 'Configured Clock Speed:') ? parseInt(util.getValue(lines, 'Configured Clock Speed:'), 10) : (util.getValue(lines, 'Speed:') ? parseInt(util.getValue(lines, 'Speed:'), 10) : null)),
|
clockSpeed: util.getValue(lines, 'Configured Clock Speed:')
|
||||||
|
? parseInt(util.getValue(lines, 'Configured Clock Speed:'), 10)
|
||||||
|
: util.getValue(lines, 'Speed:')
|
||||||
|
? parseInt(util.getValue(lines, 'Speed:'), 10)
|
||||||
|
: null,
|
||||||
formFactor: util.getValue(lines, 'Form Factor:'),
|
formFactor: util.getValue(lines, 'Form Factor:'),
|
||||||
manufacturer: getManufacturer(util.getValue(lines, 'Manufacturer:')),
|
manufacturer: getManufacturer(util.getValue(lines, 'Manufacturer:')),
|
||||||
partNum: util.getValue(lines, 'Part Number:'),
|
partNum: util.getValue(lines, 'Part Number:'),
|
||||||
serialNum: util.getValue(lines, 'Serial Number:'),
|
serialNum: util.getValue(lines, 'Serial Number:'),
|
||||||
voltageConfigured: parseFloat(util.getValue(lines, 'Configured Voltage:')) || null,
|
voltageConfigured: parseFloat(util.getValue(lines, 'Configured Voltage:')) || null,
|
||||||
voltageMin: parseFloat(util.getValue(lines, 'Minimum Voltage:')) || null,
|
voltageMin: parseFloat(util.getValue(lines, 'Minimum Voltage:')) || null,
|
||||||
voltageMax: parseFloat(util.getValue(lines, 'Maximum Voltage:')) || null,
|
voltageMax: parseFloat(util.getValue(lines, 'Maximum Voltage:')) || null
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
result.push({
|
result.push({
|
||||||
@ -366,7 +399,7 @@ function memLayout(callback) {
|
|||||||
serialNum: '',
|
serialNum: '',
|
||||||
voltageConfigured: null,
|
voltageConfigured: null,
|
||||||
voltageMin: null,
|
voltageMin: null,
|
||||||
voltageMax: null,
|
voltageMax: null
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -383,7 +416,7 @@ function memLayout(callback) {
|
|||||||
serialNum: '',
|
serialNum: '',
|
||||||
voltageConfigured: null,
|
voltageConfigured: null,
|
||||||
voltageMin: null,
|
voltageMin: null,
|
||||||
voltageMax: null,
|
voltageMax: null
|
||||||
});
|
});
|
||||||
|
|
||||||
// Try Raspberry PI
|
// Try Raspberry PI
|
||||||
@ -393,19 +426,18 @@ function memLayout(callback) {
|
|||||||
let version = util.getValue(lines, 'revision', ':', true).toLowerCase();
|
let version = util.getValue(lines, 'revision', ':', true).toLowerCase();
|
||||||
|
|
||||||
if (util.isRaspberry(lines)) {
|
if (util.isRaspberry(lines)) {
|
||||||
|
|
||||||
const clockSpeed = {
|
const clockSpeed = {
|
||||||
'0': 400,
|
0: 400,
|
||||||
'1': 450,
|
1: 450,
|
||||||
'2': 450,
|
2: 450,
|
||||||
'3': 3200,
|
3: 3200,
|
||||||
'4': 4267
|
4: 4267
|
||||||
};
|
};
|
||||||
result[0].type = 'LPDDR2';
|
result[0].type = 'LPDDR2';
|
||||||
result[0].type = version && version[2] && (version[2] === '3') ? 'LPDDR4' : result[0].type;
|
result[0].type = version && version[2] && version[2] === '3' ? 'LPDDR4' : result[0].type;
|
||||||
result[0].type = version && version[2] && (version[2] === '4') ? 'LPDDR4X' : result[0].type;
|
result[0].type = version && version[2] && version[2] === '4' ? 'LPDDR4X' : result[0].type;
|
||||||
result[0].ecc = false;
|
result[0].ecc = false;
|
||||||
result[0].clockSpeed = version && version[2] && clockSpeed[version[2]] || 400;
|
result[0].clockSpeed = (version && version[2] && clockSpeed[version[2]]) || 400;
|
||||||
result[0].clockSpeed = version && version[4] && version[4] === 'd' ? 500 : result[0].clockSpeed;
|
result[0].clockSpeed = version && version[4] && version[4] === 'd' ? 500 : result[0].clockSpeed;
|
||||||
result[0].formFactor = 'SoC';
|
result[0].formFactor = 'SoC';
|
||||||
|
|
||||||
@ -428,11 +460,13 @@ function memLayout(callback) {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
util.noop();
|
util.noop();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_darwin) {
|
if (_darwin) {
|
||||||
@ -464,7 +498,7 @@ function memLayout(callback) {
|
|||||||
serialNum: util.getValue(lines, ' Serial Number:'),
|
serialNum: util.getValue(lines, ' Serial Number:'),
|
||||||
voltageConfigured: null,
|
voltageConfigured: null,
|
||||||
voltageMin: null,
|
voltageMin: null,
|
||||||
voltageMax: null,
|
voltageMax: null
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
result.push({
|
result.push({
|
||||||
@ -479,7 +513,7 @@ function memLayout(callback) {
|
|||||||
serialNum: '',
|
serialNum: '',
|
||||||
voltageConfigured: null,
|
voltageConfigured: null,
|
||||||
voltageMin: null,
|
voltageMin: null,
|
||||||
voltageMax: null,
|
voltageMax: null
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -502,26 +536,36 @@ function memLayout(callback) {
|
|||||||
serialNum: '',
|
serialNum: '',
|
||||||
voltageConfigured: null,
|
voltageConfigured: null,
|
||||||
voltageMin: null,
|
voltageMin: null,
|
||||||
voltageMax: null,
|
voltageMax: null
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (_sunos) {
|
if (_sunos) {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
if (_windows) {
|
if (_windows) {
|
||||||
// https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.4.0a.pdf
|
// https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.4.0a.pdf
|
||||||
const memoryTypes = 'Unknown|Other|DRAM|Synchronous DRAM|Cache DRAM|EDO|EDRAM|VRAM|SRAM|RAM|ROM|FLASH|EEPROM|FEPROM|EPROM|CDRAM|3DRAM|SDRAM|SGRAM|RDRAM|DDR|DDR2|DDR2 FB-DIMM|Reserved|DDR3|FBD2|DDR4|LPDDR|LPDDR2|LPDDR3|LPDDR4|Logical non-volatile device|HBM|HBM2|DDR5|LPDDR5'.split('|');
|
const memoryTypes =
|
||||||
|
'Unknown|Other|DRAM|Synchronous DRAM|Cache DRAM|EDO|EDRAM|VRAM|SRAM|RAM|ROM|FLASH|EEPROM|FEPROM|EPROM|CDRAM|3DRAM|SDRAM|SGRAM|RDRAM|DDR|DDR2|DDR2 FB-DIMM|Reserved|DDR3|FBD2|DDR4|LPDDR|LPDDR2|LPDDR3|LPDDR4|Logical non-volatile device|HBM|HBM2|DDR5|LPDDR5'.split(
|
||||||
|
'|'
|
||||||
|
);
|
||||||
const FormFactors = 'Unknown|Other|SIP|DIP|ZIP|SOJ|Proprietary|SIMM|DIMM|TSOP|PGA|RIMM|SODIMM|SRIMM|SMD|SSMP|QFP|TQFP|SOIC|LCC|PLCC|BGA|FPBGA|LGA'.split('|');
|
const FormFactors = 'Unknown|Other|SIP|DIP|ZIP|SOJ|Proprietary|SIMM|DIMM|TSOP|PGA|RIMM|SODIMM|SRIMM|SMD|SSMP|QFP|TQFP|SOIC|LCC|PLCC|BGA|FPBGA|LGA'.split('|');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
util.powerShell('Get-CimInstance Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,Speed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage,Tag | fl').then((stdout, error) => {
|
util
|
||||||
|
.powerShell(
|
||||||
|
'Get-CimInstance Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,Speed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage,Tag | fl'
|
||||||
|
)
|
||||||
|
.then((stdout, error) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
let devices = stdout.toString().split(/\n\s*\n/);
|
let devices = stdout.toString().split(/\n\s*\n/);
|
||||||
devices.shift();
|
devices.shift();
|
||||||
@ -545,16 +589,20 @@ function memLayout(callback) {
|
|||||||
serialNum: util.getValue(lines, 'SerialNumber', ':'),
|
serialNum: util.getValue(lines, 'SerialNumber', ':'),
|
||||||
voltageConfigured: (parseInt(util.getValue(lines, 'ConfiguredVoltage', ':'), 10) || 0) / 1000.0,
|
voltageConfigured: (parseInt(util.getValue(lines, 'ConfiguredVoltage', ':'), 10) || 0) / 1000.0,
|
||||||
voltageMin: (parseInt(util.getValue(lines, 'MinVoltage', ':'), 10) || 0) / 1000.0,
|
voltageMin: (parseInt(util.getValue(lines, 'MinVoltage', ':'), 10) || 0) / 1000.0,
|
||||||
voltageMax: (parseInt(util.getValue(lines, 'MaxVoltage', ':'), 10) || 0) / 1000.0,
|
voltageMax: (parseInt(util.getValue(lines, 'MaxVoltage', ':'), 10) || 0) / 1000.0
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -563,4 +611,3 @@ function memLayout(callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.memLayout = memLayout;
|
exports.memLayout = memLayout;
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
@ -18,13 +18,13 @@ const util = require('./util');
|
|||||||
|
|
||||||
let _platform = process.platform;
|
let _platform = process.platform;
|
||||||
|
|
||||||
const _linux = (_platform === 'linux' || _platform === 'android');
|
const _linux = _platform === 'linux' || _platform === 'android';
|
||||||
const _darwin = (_platform === 'darwin');
|
const _darwin = _platform === 'darwin';
|
||||||
const _windows = (_platform === 'win32');
|
const _windows = _platform === 'win32';
|
||||||
const _freebsd = (_platform === 'freebsd');
|
const _freebsd = _platform === 'freebsd';
|
||||||
const _openbsd = (_platform === 'openbsd');
|
const _openbsd = _platform === 'openbsd';
|
||||||
const _netbsd = (_platform === 'netbsd');
|
const _netbsd = _platform === 'netbsd';
|
||||||
const _sunos = (_platform === 'sunos');
|
const _sunos = _platform === 'sunos';
|
||||||
|
|
||||||
const winPrinterStatus = {
|
const winPrinterStatus = {
|
||||||
1: 'Other',
|
1: 'Other',
|
||||||
@ -33,7 +33,7 @@ const winPrinterStatus = {
|
|||||||
4: 'Printing',
|
4: 'Printing',
|
||||||
5: 'Warmup',
|
5: 'Warmup',
|
||||||
6: 'Stopped Printing',
|
6: 'Stopped Printing',
|
||||||
7: 'Offline',
|
7: 'Offline'
|
||||||
};
|
};
|
||||||
|
|
||||||
function parseLinuxCupsHeader(lines) {
|
function parseLinuxCupsHeader(lines) {
|
||||||
@ -70,7 +70,7 @@ function parseLinuxLpstatPrinter(lines, id) {
|
|||||||
result.model = lines.length > 0 && lines[0] ? lines[0].split(' ')[0] : '';
|
result.model = lines.length > 0 && lines[0] ? lines[0].split(' ')[0] : '';
|
||||||
result.uri = null;
|
result.uri = null;
|
||||||
result.uuid = null;
|
result.uuid = null;
|
||||||
result.status = lines.length > 0 && lines[0] ? (lines[0].indexOf(' idle') > 0 ? 'idle' : (lines[0].indexOf(' printing') > 0 ? 'printing' : 'unknown')) : null;
|
result.status = lines.length > 0 && lines[0] ? (lines[0].indexOf(' idle') > 0 ? 'idle' : lines[0].indexOf(' printing') > 0 ? 'printing' : 'unknown') : null;
|
||||||
result.local = util.getValue(lines, 'Location', ':', true).toLowerCase().startsWith('local');
|
result.local = util.getValue(lines, 'Location', ':', true).toLowerCase().startsWith('local');
|
||||||
result.default = null;
|
result.default = null;
|
||||||
result.shared = util.getValue(lines, 'Shared', ' ').toLowerCase().startsWith('yes');
|
result.shared = util.getValue(lines, 'Shared', ' ').toLowerCase().startsWith('yes');
|
||||||
@ -112,7 +112,6 @@ function parseWindowsPrinters(lines, id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function printer(callback) {
|
function printer(callback) {
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
let result = [];
|
let result = [];
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|||||||
124
lib/usb.js
124
lib/usb.js
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
@ -18,26 +18,36 @@ const util = require('./util');
|
|||||||
|
|
||||||
let _platform = process.platform;
|
let _platform = process.platform;
|
||||||
|
|
||||||
const _linux = (_platform === 'linux' || _platform === 'android');
|
const _linux = _platform === 'linux' || _platform === 'android';
|
||||||
const _darwin = (_platform === 'darwin');
|
const _darwin = _platform === 'darwin';
|
||||||
const _windows = (_platform === 'win32');
|
const _windows = _platform === 'win32';
|
||||||
const _freebsd = (_platform === 'freebsd');
|
const _freebsd = _platform === 'freebsd';
|
||||||
const _openbsd = (_platform === 'openbsd');
|
const _openbsd = _platform === 'openbsd';
|
||||||
const _netbsd = (_platform === 'netbsd');
|
const _netbsd = _platform === 'netbsd';
|
||||||
const _sunos = (_platform === 'sunos');
|
const _sunos = _platform === 'sunos';
|
||||||
|
|
||||||
function getLinuxUsbType(type, name) {
|
function getLinuxUsbType(type, name) {
|
||||||
let result = type;
|
let result = type;
|
||||||
const str = (name + ' ' + type).toLowerCase();
|
const str = (name + ' ' + type).toLowerCase();
|
||||||
if (str.indexOf('camera') >= 0) { result = 'Camera'; }
|
if (str.indexOf('camera') >= 0) {
|
||||||
else if (str.indexOf('hub') >= 0) { result = 'Hub'; }
|
result = 'Camera';
|
||||||
else if (str.indexOf('keybrd') >= 0) { result = 'Keyboard'; }
|
} else if (str.indexOf('hub') >= 0) {
|
||||||
else if (str.indexOf('keyboard') >= 0) { result = 'Keyboard'; }
|
result = 'Hub';
|
||||||
else if (str.indexOf('mouse') >= 0) { result = 'Mouse'; }
|
} else if (str.indexOf('keybrd') >= 0) {
|
||||||
else if (str.indexOf('stora') >= 0) { result = 'Storage'; }
|
result = 'Keyboard';
|
||||||
else if (str.indexOf('microp') >= 0) { result = 'Microphone'; }
|
} else if (str.indexOf('keyboard') >= 0) {
|
||||||
else if (str.indexOf('headset') >= 0) { result = 'Audio'; }
|
result = 'Keyboard';
|
||||||
else if (str.indexOf('audio') >= 0) { result = 'Audio'; }
|
} else if (str.indexOf('mouse') >= 0) {
|
||||||
|
result = 'Mouse';
|
||||||
|
} else if (str.indexOf('stora') >= 0) {
|
||||||
|
result = 'Storage';
|
||||||
|
} else if (str.indexOf('microp') >= 0) {
|
||||||
|
result = 'Microphone';
|
||||||
|
} else if (str.indexOf('headset') >= 0) {
|
||||||
|
result = 'Audio';
|
||||||
|
} else if (str.indexOf('audio') >= 0) {
|
||||||
|
result = 'Audio';
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -96,21 +106,37 @@ function parseLinuxUsb(usb) {
|
|||||||
|
|
||||||
function getDarwinUsbType(name) {
|
function getDarwinUsbType(name) {
|
||||||
let result = '';
|
let result = '';
|
||||||
if (name.indexOf('camera') >= 0) { result = 'Camera'; }
|
if (name.indexOf('camera') >= 0) {
|
||||||
else if (name.indexOf('touch bar') >= 0) { result = 'Touch Bar'; }
|
result = 'Camera';
|
||||||
else if (name.indexOf('controller') >= 0) { result = 'Controller'; }
|
} else if (name.indexOf('touch bar') >= 0) {
|
||||||
else if (name.indexOf('headset') >= 0) { result = 'Audio'; }
|
result = 'Touch Bar';
|
||||||
else if (name.indexOf('keyboard') >= 0) { result = 'Keyboard'; }
|
} else if (name.indexOf('controller') >= 0) {
|
||||||
else if (name.indexOf('trackpad') >= 0) { result = 'Trackpad'; }
|
result = 'Controller';
|
||||||
else if (name.indexOf('sensor') >= 0) { result = 'Sensor'; }
|
} else if (name.indexOf('headset') >= 0) {
|
||||||
else if (name.indexOf('bthusb') >= 0) { result = 'Bluetooth'; }
|
result = 'Audio';
|
||||||
else if (name.indexOf('bth') >= 0) { result = 'Bluetooth'; }
|
} else if (name.indexOf('keyboard') >= 0) {
|
||||||
else if (name.indexOf('rfcomm') >= 0) { result = 'Bluetooth'; }
|
result = 'Keyboard';
|
||||||
else if (name.indexOf('usbhub') >= 0) { result = 'Hub'; }
|
} else if (name.indexOf('trackpad') >= 0) {
|
||||||
else if (name.indexOf(' hub') >= 0) { result = 'Hub'; }
|
result = 'Trackpad';
|
||||||
else if (name.indexOf('mouse') >= 0) { result = 'Mouse'; }
|
} else if (name.indexOf('sensor') >= 0) {
|
||||||
else if (name.indexOf('microp') >= 0) { result = 'Microphone'; }
|
result = 'Sensor';
|
||||||
else if (name.indexOf('removable') >= 0) { result = 'Storage'; }
|
} else if (name.indexOf('bthusb') >= 0) {
|
||||||
|
result = 'Bluetooth';
|
||||||
|
} else if (name.indexOf('bth') >= 0) {
|
||||||
|
result = 'Bluetooth';
|
||||||
|
} else if (name.indexOf('rfcomm') >= 0) {
|
||||||
|
result = 'Bluetooth';
|
||||||
|
} else if (name.indexOf('usbhub') >= 0) {
|
||||||
|
result = 'Hub';
|
||||||
|
} else if (name.indexOf(' hub') >= 0) {
|
||||||
|
result = 'Hub';
|
||||||
|
} else if (name.indexOf('mouse') >= 0) {
|
||||||
|
result = 'Mouse';
|
||||||
|
} else if (name.indexOf('microp') >= 0) {
|
||||||
|
result = 'Microphone';
|
||||||
|
} else if (name.indexOf('removable') >= 0) {
|
||||||
|
result = 'Storage';
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,15 +200,25 @@ function parseDarwinUsb(usb, id) {
|
|||||||
|
|
||||||
function getWindowsUsbTypeCreation(creationclass, name) {
|
function getWindowsUsbTypeCreation(creationclass, name) {
|
||||||
let result = '';
|
let result = '';
|
||||||
if (name.indexOf('storage') >= 0) { result = 'Storage'; }
|
if (name.indexOf('storage') >= 0) {
|
||||||
else if (name.indexOf('speicher') >= 0) { result = 'Storage'; }
|
result = 'Storage';
|
||||||
else if (creationclass.indexOf('usbhub') >= 0) { result = 'Hub'; }
|
} else if (name.indexOf('speicher') >= 0) {
|
||||||
else if (creationclass.indexOf('storage') >= 0) { result = 'Storage'; }
|
result = 'Storage';
|
||||||
else if (creationclass.indexOf('usbcontroller') >= 0) { result = 'Controller'; }
|
} else if (creationclass.indexOf('usbhub') >= 0) {
|
||||||
else if (creationclass.indexOf('keyboard') >= 0) { result = 'Keyboard'; }
|
result = 'Hub';
|
||||||
else if (creationclass.indexOf('pointing') >= 0) { result = 'Mouse'; }
|
} else if (creationclass.indexOf('storage') >= 0) {
|
||||||
else if (creationclass.indexOf('microp') >= 0) { result = 'Microphone'; }
|
result = 'Storage';
|
||||||
else if (creationclass.indexOf('disk') >= 0) { result = 'Storage'; }
|
} else if (creationclass.indexOf('usbcontroller') >= 0) {
|
||||||
|
result = 'Controller';
|
||||||
|
} else if (creationclass.indexOf('keyboard') >= 0) {
|
||||||
|
result = 'Keyboard';
|
||||||
|
} else if (creationclass.indexOf('pointing') >= 0) {
|
||||||
|
result = 'Mouse';
|
||||||
|
} else if (creationclass.indexOf('microp') >= 0) {
|
||||||
|
result = 'Microphone';
|
||||||
|
} else if (creationclass.indexOf('disk') >= 0) {
|
||||||
|
result = 'Storage';
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,7 +245,6 @@ function parseWindowsUsb(lines, id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function usb(callback) {
|
function usb(callback) {
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
let result = [];
|
let result = [];
|
||||||
@ -233,7 +268,7 @@ function usb(callback) {
|
|||||||
let cmd = 'ioreg -p IOUSB -c AppleUSBRootHubDevice -w0 -l';
|
let cmd = 'ioreg -p IOUSB -c AppleUSBRootHubDevice -w0 -l';
|
||||||
exec(cmd, { maxBuffer: 1024 * 1024 * 128 }, function (error, stdout) {
|
exec(cmd, { maxBuffer: 1024 * 1024 * 128 }, function (error, stdout) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
const parts = (stdout.toString()).split(' +-o ');
|
const parts = stdout.toString().split(' +-o ');
|
||||||
for (let i = 1; i < parts.length; i++) {
|
for (let i = 1; i < parts.length; i++) {
|
||||||
const usb = parseDarwinUsb(parts[i]);
|
const usb = parseDarwinUsb(parts[i]);
|
||||||
if (usb) {
|
if (usb) {
|
||||||
@ -257,7 +292,7 @@ function usb(callback) {
|
|||||||
const parts = stdout.toString().split(/\n\s*\n/);
|
const parts = stdout.toString().split(/\n\s*\n/);
|
||||||
for (let i = 0; i < parts.length; i++) {
|
for (let i = 0; i < parts.length; i++) {
|
||||||
const usb = parseWindowsUsb(parts[i].split('\n'), i);
|
const usb = parseWindowsUsb(parts[i].split('\n'), i);
|
||||||
if (usb && result.filter(x => x.deviceId === usb.deviceId).length === 0) {
|
if (usb && result.filter((x) => x.deviceId === usb.deviceId).length === 0) {
|
||||||
result.push(usb);
|
result.push(usb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -276,4 +311,3 @@ function usb(callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.usb = usb;
|
exports.usb = usb;
|
||||||
|
|
||||||
|
|||||||
110
lib/users.js
110
lib/users.js
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
@ -18,13 +18,13 @@ const util = require('./util');
|
|||||||
|
|
||||||
let _platform = process.platform;
|
let _platform = process.platform;
|
||||||
|
|
||||||
const _linux = (_platform === 'linux' || _platform === 'android');
|
const _linux = _platform === 'linux' || _platform === 'android';
|
||||||
const _darwin = (_platform === 'darwin');
|
const _darwin = _platform === 'darwin';
|
||||||
const _windows = (_platform === 'win32');
|
const _windows = _platform === 'win32';
|
||||||
const _freebsd = (_platform === 'freebsd');
|
const _freebsd = _platform === 'freebsd';
|
||||||
const _openbsd = (_platform === 'openbsd');
|
const _openbsd = _platform === 'openbsd';
|
||||||
const _netbsd = (_platform === 'netbsd');
|
const _netbsd = _platform === 'netbsd';
|
||||||
const _sunos = (_platform === 'sunos');
|
const _sunos = _platform === 'sunos';
|
||||||
|
|
||||||
function parseUsersLinux(lines, phase) {
|
function parseUsersLinux(lines, phase) {
|
||||||
let result = [];
|
let result = [];
|
||||||
@ -49,11 +49,12 @@ function parseUsersLinux(lines, phase) {
|
|||||||
tty: l[1],
|
tty: l[1],
|
||||||
date: l[2],
|
date: l[2],
|
||||||
time: l[3],
|
time: l[3],
|
||||||
ip: (l && l.length > 4) ? l[4].replace(/\(/g, '').replace(/\)/g, '') : ''
|
ip: l && l.length > 4 ? l[4].replace(/\(/g, '').replace(/\)/g, '') : ''
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// w part
|
// w part
|
||||||
if (w_first) { // header
|
if (w_first) {
|
||||||
|
// header
|
||||||
w_header = l;
|
w_header = l;
|
||||||
w_header.forEach(function (item) {
|
w_header.forEach(function (item) {
|
||||||
w_pos.push(line.indexOf(item));
|
w_pos.push(line.indexOf(item));
|
||||||
@ -63,11 +64,15 @@ function parseUsersLinux(lines, phase) {
|
|||||||
// split by w_pos
|
// split by w_pos
|
||||||
result_w.user = line.substring(w_pos[0], w_pos[1] - 1).trim();
|
result_w.user = line.substring(w_pos[0], w_pos[1] - 1).trim();
|
||||||
result_w.tty = line.substring(w_pos[1], w_pos[2] - 1).trim();
|
result_w.tty = line.substring(w_pos[1], w_pos[2] - 1).trim();
|
||||||
result_w.ip = line.substring(w_pos[2], w_pos[3] - 1).replace(/\(/g, '').replace(/\)/g, '').trim();
|
result_w.ip = line
|
||||||
|
.substring(w_pos[2], w_pos[3] - 1)
|
||||||
|
.replace(/\(/g, '')
|
||||||
|
.replace(/\)/g, '')
|
||||||
|
.trim();
|
||||||
result_w.command = line.substring(w_pos[7], 1000).trim();
|
result_w.command = line.substring(w_pos[7], 1000).trim();
|
||||||
// find corresponding 'who' line
|
// find corresponding 'who' line
|
||||||
who_line = result_who.filter(function (obj) {
|
who_line = result_who.filter(function (obj) {
|
||||||
return (obj.user.substring(0, 8).trim() === result_w.user && obj.tty === result_w.tty);
|
return obj.user.substring(0, 8).trim() === result_w.user && obj.tty === result_w.tty;
|
||||||
});
|
});
|
||||||
if (who_line.length === 1) {
|
if (who_line.length === 1) {
|
||||||
result.push({
|
result.push({
|
||||||
@ -105,10 +110,10 @@ function parseUsersDarwin(lines) {
|
|||||||
|
|
||||||
// who part
|
// who part
|
||||||
if (is_whopart) {
|
if (is_whopart) {
|
||||||
let dt = ('' + new Date().getFullYear()) + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + l[3]).slice(-2);
|
let dt = '' + new Date().getFullYear() + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + l[3]).slice(-2);
|
||||||
try {
|
try {
|
||||||
if (new Date(dt) > new Date) {
|
if (new Date(dt) > new Date()) {
|
||||||
dt = ('' + (new Date().getFullYear() - 1)) + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + l[3]).slice(-2);
|
dt = '' + (new Date().getFullYear() - 1) + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + l[3]).slice(-2);
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
util.noop();
|
util.noop();
|
||||||
@ -117,18 +122,18 @@ function parseUsersDarwin(lines) {
|
|||||||
user: l[0],
|
user: l[0],
|
||||||
tty: l[1],
|
tty: l[1],
|
||||||
date: dt,
|
date: dt,
|
||||||
time: l[4],
|
time: l[4]
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// w part
|
// w part
|
||||||
// split by w_pos
|
// split by w_pos
|
||||||
result_w.user = l[0];
|
result_w.user = l[0];
|
||||||
result_w.tty = l[1];
|
result_w.tty = l[1];
|
||||||
result_w.ip = (l[2] !== '-') ? l[2] : '';
|
result_w.ip = l[2] !== '-' ? l[2] : '';
|
||||||
result_w.command = l.slice(5, 1000).join(' ');
|
result_w.command = l.slice(5, 1000).join(' ');
|
||||||
// find corresponding 'who' line
|
// find corresponding 'who' line
|
||||||
who_line = result_who.filter(function (obj) {
|
who_line = result_who.filter(function (obj) {
|
||||||
return (obj.user.substring(0, 10) === result_w.user.substring(0, 10) && (obj.tty.substring(3, 1000) === result_w.tty || obj.tty === result_w.tty));
|
return obj.user.substring(0, 10) === result_w.user.substring(0, 10) && (obj.tty.substring(3, 1000) === result_w.tty || obj.tty === result_w.tty);
|
||||||
});
|
});
|
||||||
if (who_line.length === 1) {
|
if (who_line.length === 1) {
|
||||||
result.push({
|
result.push({
|
||||||
@ -147,7 +152,6 @@ function parseUsersDarwin(lines) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function users(callback) {
|
function users(callback) {
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
let result = [];
|
let result = [];
|
||||||
@ -166,15 +170,21 @@ function users(callback) {
|
|||||||
lines = stdout.toString().split('\n');
|
lines = stdout.toString().split('\n');
|
||||||
result = parseUsersLinux(lines, 2);
|
result = parseUsersLinux(lines, 2);
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -186,7 +196,9 @@ function users(callback) {
|
|||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
result = parseUsersDarwin(lines);
|
result = parseUsersDarwin(lines);
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -197,7 +209,9 @@ function users(callback) {
|
|||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
result = parseUsersDarwin(lines);
|
result = parseUsersDarwin(lines);
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -209,15 +223,18 @@ function users(callback) {
|
|||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
result = parseUsersDarwin(lines);
|
result = parseUsersDarwin(lines);
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (_windows) {
|
if (_windows) {
|
||||||
try {
|
try {
|
||||||
let cmd = 'Get-CimInstance Win32_LogonSession | select LogonId,@{n="StartTime";e={$_.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}} | fl' + '; echo \'#-#-#-#\';';
|
let cmd = 'Get-CimInstance Win32_LogonSession | select LogonId,@{n="StartTime";e={$_.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}} | fl' + "; echo '#-#-#-#';";
|
||||||
cmd += 'Get-CimInstance Win32_LoggedOnUser | select antecedent,dependent | fl ' + '; echo \'#-#-#-#\';';
|
cmd += 'Get-CimInstance Win32_LoggedOnUser | select antecedent,dependent | fl ' + "; echo '#-#-#-#';";
|
||||||
cmd += '$process = (Get-CimInstance Win32_Process -Filter "name = \'explorer.exe\'"); Invoke-CimMethod -InputObject $process[0] -MethodName GetOwner | select user, domain | fl; get-process -name explorer | select-object sessionid | fl; echo \'#-#-#-#\';';
|
cmd +=
|
||||||
|
"$process = (Get-CimInstance Win32_Process -Filter \"name = 'explorer.exe'\"); Invoke-CimMethod -InputObject $process[0] -MethodName GetOwner | select user, domain | fl; get-process -name explorer | select-object sessionid | fl; echo '#-#-#-#';";
|
||||||
cmd += 'query user';
|
cmd += 'query user';
|
||||||
util.powerShell(cmd).then((data) => {
|
util.powerShell(cmd).then((data) => {
|
||||||
if (data) {
|
if (data) {
|
||||||
@ -231,7 +248,7 @@ function users(callback) {
|
|||||||
loggedons[id].dateTime = {}.hasOwnProperty.call(sessions, id) ? sessions[id] : '';
|
loggedons[id].dateTime = {}.hasOwnProperty.call(sessions, id) ? sessions[id] : '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
users.forEach(user => {
|
users.forEach((user) => {
|
||||||
let dateTime = '';
|
let dateTime = '';
|
||||||
for (let id in loggedons) {
|
for (let id in loggedons) {
|
||||||
if ({}.hasOwnProperty.call(loggedons, id)) {
|
if ({}.hasOwnProperty.call(loggedons, id)) {
|
||||||
@ -251,12 +268,15 @@ function users(callback) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
|
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -266,7 +286,7 @@ function users(callback) {
|
|||||||
|
|
||||||
function parseWinSessions(sessionParts) {
|
function parseWinSessions(sessionParts) {
|
||||||
const sessions = {};
|
const sessions = {};
|
||||||
sessionParts.forEach(session => {
|
sessionParts.forEach((session) => {
|
||||||
const lines = session.split('\r\n');
|
const lines = session.split('\r\n');
|
||||||
const id = util.getValue(lines, 'LogonId');
|
const id = util.getValue(lines, 'LogonId');
|
||||||
const starttime = util.getValue(lines, 'starttime');
|
const starttime = util.getValue(lines, 'starttime');
|
||||||
@ -282,19 +302,23 @@ function fuzzyMatch(name1, name2) {
|
|||||||
name2 = name2.toLowerCase();
|
name2 = name2.toLowerCase();
|
||||||
let eq = 0;
|
let eq = 0;
|
||||||
let len = name1.length;
|
let len = name1.length;
|
||||||
if (name2.length > len) { len = name2.length; }
|
if (name2.length > len) {
|
||||||
|
len = name2.length;
|
||||||
|
}
|
||||||
|
|
||||||
for (let i = 0; i < len; i++) {
|
for (let i = 0; i < len; i++) {
|
||||||
const c1 = name1[i] || '';
|
const c1 = name1[i] || '';
|
||||||
const c2 = name2[i] || '';
|
const c2 = name2[i] || '';
|
||||||
if (c1 === c2) { eq++; }
|
if (c1 === c2) {
|
||||||
|
eq++;
|
||||||
}
|
}
|
||||||
return (len > 10 ? eq / len > 0.9 : (len > 0 ? eq / len > 0.8 : false));
|
}
|
||||||
|
return len > 10 ? eq / len > 0.9 : len > 0 ? eq / len > 0.8 : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseWinUsers(userParts, userQuery) {
|
function parseWinUsers(userParts, userQuery) {
|
||||||
const users = [];
|
const users = [];
|
||||||
userParts.forEach(user => {
|
userParts.forEach((user) => {
|
||||||
const lines = user.split('\r\n');
|
const lines = user.split('\r\n');
|
||||||
|
|
||||||
const domain = util.getValue(lines, 'domain', ':', true);
|
const domain = util.getValue(lines, 'domain', ':', true);
|
||||||
@ -302,7 +326,7 @@ function parseWinUsers(userParts, userQuery) {
|
|||||||
const sessionid = util.getValue(lines, 'sessionid', ':', true);
|
const sessionid = util.getValue(lines, 'sessionid', ':', true);
|
||||||
|
|
||||||
if (username) {
|
if (username) {
|
||||||
const quser = userQuery.filter(item => fuzzyMatch(item.user, username));
|
const quser = userQuery.filter((item) => fuzzyMatch(item.user, username));
|
||||||
users.push({
|
users.push({
|
||||||
domain,
|
domain,
|
||||||
user: username,
|
user: username,
|
||||||
@ -315,7 +339,7 @@ function parseWinUsers(userParts, userQuery) {
|
|||||||
|
|
||||||
function parseWinLoggedOn(loggedonParts) {
|
function parseWinLoggedOn(loggedonParts) {
|
||||||
const loggedons = {};
|
const loggedons = {};
|
||||||
loggedonParts.forEach(loggedon => {
|
loggedonParts.forEach((loggedon) => {
|
||||||
const lines = loggedon.split('\r\n');
|
const lines = loggedon.split('\r\n');
|
||||||
|
|
||||||
const antecendent = util.getValue(lines, 'antecedent', ':', true);
|
const antecendent = util.getValue(lines, 'antecedent', ':', true);
|
||||||
@ -336,16 +360,16 @@ function parseWinLoggedOn(loggedonParts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function parseWinUsersQuery(lines) {
|
function parseWinUsersQuery(lines) {
|
||||||
lines = lines.filter(item => item);
|
lines = lines.filter((item) => item);
|
||||||
let result = [];
|
let result = [];
|
||||||
const header = lines[0];
|
const header = lines[0];
|
||||||
const headerDelimiter = [];
|
const headerDelimiter = [];
|
||||||
if (header) {
|
if (header) {
|
||||||
const start = (header[0] === ' ') ? 1 : 0;
|
const start = header[0] === ' ' ? 1 : 0;
|
||||||
headerDelimiter.push(start - 1);
|
headerDelimiter.push(start - 1);
|
||||||
let nextSpace = 0;
|
let nextSpace = 0;
|
||||||
for (let i = start + 1; i < header.length; i++) {
|
for (let i = start + 1; i < header.length; i++) {
|
||||||
if (header[i] === ' ' && ((header[i - 1] === ' ') || (header[i - 1] === '.'))) {
|
if (header[i] === ' ' && (header[i - 1] === ' ' || header[i - 1] === '.')) {
|
||||||
nextSpace = i;
|
nextSpace = i;
|
||||||
} else {
|
} else {
|
||||||
if (nextSpace) {
|
if (nextSpace) {
|
||||||
@ -360,7 +384,7 @@ function parseWinUsersQuery(lines) {
|
|||||||
const tty = lines[i].substring(headerDelimiter[1] + 1, headerDelimiter[2] - 2).trim() || '';
|
const tty = lines[i].substring(headerDelimiter[1] + 1, headerDelimiter[2] - 2).trim() || '';
|
||||||
result.push({
|
result.push({
|
||||||
user: user,
|
user: user,
|
||||||
tty: tty,
|
tty: tty
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
@ -18,7 +18,6 @@ const exec = require('child_process').exec;
|
|||||||
const util = require('./util');
|
const util = require('./util');
|
||||||
|
|
||||||
function vboxInfo(callback) {
|
function vboxInfo(callback) {
|
||||||
|
|
||||||
// fallback - if only callback is given
|
// fallback - if only callback is given
|
||||||
let result = [];
|
let result = [];
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
@ -27,7 +26,7 @@ function vboxInfo(callback) {
|
|||||||
exec(util.getVboxmanage() + ' list vms --long', function (error, stdout) {
|
exec(util.getVboxmanage() + ' list vms --long', function (error, stdout) {
|
||||||
let parts = (os.EOL + stdout.toString()).split(os.EOL + 'Name:');
|
let parts = (os.EOL + stdout.toString()).split(os.EOL + 'Name:');
|
||||||
parts.shift();
|
parts.shift();
|
||||||
parts.forEach(part => {
|
parts.forEach((part) => {
|
||||||
const lines = ('Name:' + part).split(os.EOL);
|
const lines = ('Name:' + part).split(os.EOL);
|
||||||
const state = util.getValue(lines, 'State');
|
const state = util.getValue(lines, 'State');
|
||||||
const running = state.startsWith('running');
|
const running = state.startsWith('running');
|
||||||
@ -89,15 +88,19 @@ function vboxInfo(callback) {
|
|||||||
bootDevice3: util.getValue(lines, 'Boot Device 3'),
|
bootDevice3: util.getValue(lines, 'Boot Device 3'),
|
||||||
bootDevice4: util.getValue(lines, 'Boot Device 4'),
|
bootDevice4: util.getValue(lines, 'Boot Device 4'),
|
||||||
timeOffset: util.getValue(lines, 'Time offset'),
|
timeOffset: util.getValue(lines, 'Time offset'),
|
||||||
rtc: util.getValue(lines, 'RTC'),
|
rtc: util.getValue(lines, 'RTC')
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (callback) { callback(result); }
|
if (callback) {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// Description: System Information - library
|
// Description: System Information - library
|
||||||
// for Node.js
|
// for Node.js
|
||||||
// Copyright: (c) 2014 - 2025
|
// Copyright: (c) 2014 - 2026
|
||||||
// Author: Sebastian Hildebrandt
|
// Author: Sebastian Hildebrandt
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// License: MIT
|
// License: MIT
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user