aboutsummaryrefslogtreecommitdiff
path: root/index.ts
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-06-21 10:19:39 +0200
committerMinteck <contact@minteck.org>2022-06-21 10:19:39 +0200
commit8f7138f6564acd4df73b88a2d4dc472c2c7800ae (patch)
treef7584741039ad9880a5b32ec9c8184510c43b612 /index.ts
parente0b4c4e963afe23525b146883f70b6cb879c2297 (diff)
downloadvaportrail-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.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/index.ts b/index.ts
index fcc6846..9649680 100644
--- a/index.ts
+++ b/index.ts
@@ -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
+})