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:
+11
-5
@@ -379,20 +379,26 @@ def _parse_wireguard_conf(text: str) -> dict[str, Any]:
|
||||
|
||||
|
||||
def import_networkd() -> bool:
|
||||
"""Parse /etc/systemd/network/99-*.network -> config/network/config.json."""
|
||||
"""Parse /etc/systemd/network/*.network -> config/network/config.json."""
|
||||
if not NETWORKD_DIR.exists():
|
||||
logger.debug("Skipping network: %s not found", NETWORKD_DIR)
|
||||
return False
|
||||
|
||||
network_files = sorted(NETWORKD_DIR.glob("99-*.network"))
|
||||
network_files = sorted(NETWORKD_DIR.glob("*.network"))
|
||||
if not network_files:
|
||||
logger.debug("Skipping network: no 99-*.network files")
|
||||
logger.debug("Skipping network: no *.network files")
|
||||
return False
|
||||
|
||||
parsed_interfaces: dict[str, dict[str, Any]] = {}
|
||||
for nf in network_files:
|
||||
# Extract interface name from filename: 99-eth0.network -> eth0
|
||||
iface_name = nf.stem[3:] # strip "99-"
|
||||
# Extract interface name from filename, stripping optional priority prefix:
|
||||
# 99-eth0.network -> eth0
|
||||
# eth0.network -> eth0
|
||||
base = nf.stem
|
||||
if "-" in base and base.split("-", 1)[0].isdigit():
|
||||
iface_name = base.split("-", 1)[1]
|
||||
else:
|
||||
iface_name = base
|
||||
try:
|
||||
parsed_interface = _parse_network_file(nf)
|
||||
if parsed_interface:
|
||||
|
||||
Reference in New Issue
Block a user