mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-10-09 15:58:34 +00:00
101ff24a1f
* Add system overview dashboard * Fix system overview polling edge cases
61 lines
1.3 KiB
TypeScript
61 lines
1.3 KiB
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
|
|
import { buildSystemManagerTabs, shouldCollectServerStats } from "./systemTarget.ts";
|
|
|
|
test("system manager shows overview before detailed management tabs", () => {
|
|
assert.deepEqual(buildSystemManagerTabs(null, undefined, null), ["overview", "processes"]);
|
|
});
|
|
|
|
test("system overview stats skip network devices even when a Linux icon was selected", () => {
|
|
assert.equal(
|
|
shouldCollectServerStats(
|
|
{
|
|
id: "host-1",
|
|
label: "Router",
|
|
hostname: "router.local",
|
|
username: "admin",
|
|
tags: [],
|
|
os: "linux",
|
|
deviceType: "network",
|
|
},
|
|
undefined,
|
|
null,
|
|
),
|
|
false,
|
|
);
|
|
});
|
|
|
|
test("system overview stats run for Linux and macOS targets", () => {
|
|
assert.equal(
|
|
shouldCollectServerStats(
|
|
{
|
|
id: "host-1",
|
|
label: "Linux",
|
|
hostname: "linux.local",
|
|
username: "root",
|
|
tags: [],
|
|
os: "linux",
|
|
},
|
|
undefined,
|
|
null,
|
|
),
|
|
true,
|
|
);
|
|
assert.equal(
|
|
shouldCollectServerStats(
|
|
{
|
|
id: "host-2",
|
|
label: "Mac",
|
|
hostname: "mac.local",
|
|
username: "root",
|
|
tags: [],
|
|
os: "macos",
|
|
},
|
|
undefined,
|
|
null,
|
|
),
|
|
true,
|
|
);
|
|
});
|