diff options
author | Minteck <contact@minteck.org> | 2022-06-21 10:19:39 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-06-21 10:19:39 +0200 |
commit | 8f7138f6564acd4df73b88a2d4dc472c2c7800ae (patch) | |
tree | f7584741039ad9880a5b32ec9c8184510c43b612 /index.ts | |
parent | e0b4c4e963afe23525b146883f70b6cb879c2297 (diff) | |
download | vaportrail-statuspoller-8f7138f6564acd4df73b88a2d4dc472c2c7800ae.tar.gz vaportrail-statuspoller-8f7138f6564acd4df73b88a2d4dc472c2c7800ae.tar.bz2 vaportrail-statuspoller-8f7138f6564acd4df73b88a2d4dc472c2c7800ae.zip |
Fixes for BSD systems
Diffstat (limited to 'index.ts')
-rw-r--r-- | index.ts | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -32,7 +32,7 @@ app.get("/json", async (req, res) => { name: os.hostname, cpu: { processors: cpu.processors, - model: `${cpu.manufacturer} ${cpu.brand}`, + model: `${cpu.manufacturer} ${cpu.brand}`.trim(), cores: cpu.cores, speed: cpuSpeed.avg, temperature: temp.main, @@ -58,11 +58,11 @@ app.get("/json", async (req, res) => { os: { name: nodeOS.platform() === "win32" ? os.platform - : os.distro, - version: os.release + : (nodeOS.platform().endsWith("bsd") ? nodeOS.type() : os.distro), + version: os.release !== "unknown" ? os.release : os.kernel }, uptime: uptime, - version: "1.1.0" + version: "1.2.0" }); }); @@ -78,4 +78,4 @@ refresh().then(() => { : 3000 )) }); -})
\ No newline at end of file +}) |