Overview: network status pill for the two NICs
A 'Network' pill next to 'Services' lists each physical NIC with its role (imaging / GE network, from /etc/pxe-server/nic.conf or dnsmasq's interface= pin), link, speed, addresses, and whether dnsmasq serves DHCP/PXE on it. It reads pxe-nic-check's verdict file (/run/pxe-nic-status.json) when present, and shows a red banner when the imaging NIC is on the GE network or a network with another DHCP server, or when dnsmasq answers DHCP on a non-imaging NIC. Without the file it shows link and addresses only. Read-only.
This commit is contained in:
@@ -56,6 +56,7 @@ from services import (
|
||||
images,
|
||||
imaging_status,
|
||||
mcl_ppkg,
|
||||
nic_status,
|
||||
system,
|
||||
unattend,
|
||||
wim,
|
||||
@@ -113,6 +114,11 @@ def dashboard():
|
||||
img["os_label"], img["driver_count"] = "", 0
|
||||
img["lint"] = image_pages._lint_counts(img["image_type"])
|
||||
services = [system.service_status(s) for s in ("dnsmasq", "apache2", "smbd")]
|
||||
try:
|
||||
nic = nic_status.status()
|
||||
except Exception: # the page must render even if this breaks
|
||||
app.logger.exception("network status failed")
|
||||
nic = None
|
||||
sessions, _hidden = imaging_status.hide_stale(imaging_status.list_sessions())
|
||||
floor = imaging_status.floor_order(sessions)
|
||||
real = [x for x in floor if x["floor_state"] != "logs"]
|
||||
@@ -121,6 +127,7 @@ def dashboard():
|
||||
"dashboard.html",
|
||||
images=image_list,
|
||||
services=services,
|
||||
nic=nic,
|
||||
image_types=config.IMAGE_TYPES,
|
||||
friendly_names=config.FRIENDLY_NAMES,
|
||||
sessions=real[:6],
|
||||
|
||||
Reference in New Issue
Block a user