feat: add system metrics dashboard with resource monitoring

- Add system metrics endpoint (CPU load, memory, swap, network traffic)
- Collect metrics from /proc and /sys (no subprocess required)
- Overhaul dashboard to pull from per-subsystem models
- Remove deprecated /status/all monolithic endpoint
- Improve networkd import to handle optional priority prefix
- Fix CSS duplicate .grid-4 rule and unused dashboard imports
This commit is contained in:
2026-07-15 00:24:43 +00:00
parent c21639b7f1
commit dadabd7954
11 changed files with 438 additions and 107 deletions
-19
View File
@@ -43,25 +43,6 @@ class TestWsUrlGeneration:
assert b"ws://[::1]:9090/ws" in resp.data
class TestApiStatusAll:
@patch("webui.server.get")
def test_success(self, mock_get, client):
mock_get.return_value = {"firewall": {"zones": {}}, "dnsmasq": {}}
resp = client.get("/api/status/all")
assert resp.status_code == 200
data = resp.get_json()
assert data["ok"] is True
assert "firewall" in data["data"]
@patch("webui.server.get")
def test_error(self, mock_get, client):
mock_get.side_effect = RuntimeError("connection refused")
resp = client.get("/api/status/all")
assert resp.status_code == 500
data = resp.get_json()
assert data["ok"] is False
class TestBlueprintsRegistered:
def test_all_blueprints_registered(self, client):
from webui.server import BLUEPRINTS