Development

This commit is contained in:
Matthew Grotke 2026-06-01 22:54:49 -04:00
parent 7da1630ab3
commit 0e18010353
3 changed files with 23 additions and 3 deletions

View file

@ -45,13 +45,17 @@
"field": "mac_address",
"class": "col-mono"
},
{
"label": "Vendor",
"field": "vendor"
},
{
"label": "VLAN",
"field": "vlan_name"
},
{
"label": "Obtained",
"field": "obtained"
"label": "Last Active",
"field": "last_active"
},
{
"label": "Expires",

View file

@ -16,6 +16,20 @@ HEALTH_FILE = os.path.join(CONFIGS_DIR, '.health')
bp = Blueprint('view_page', __name__)
try:
import manuf as _manuf_mod
_mac_parser = _manuf_mod.MacParser()
except Exception:
_mac_parser = None
def _get_vendor(mac):
if _mac_parser is None:
return ''
try:
return _mac_parser.get_manuf(mac) or ''
except Exception:
return ''
# File loaders ======================================================
@ -221,8 +235,9 @@ def live_dhcp_leases():
'hostname': hostname_html,
'ip_address': parts[2],
'mac_address': parts[1],
'vendor': _get_vendor(parts[1]),
'vlan_name': vlan_name,
'obtained': obtained,
'last_active': obtained,
'expires': relative_time_future(expiry),
'recent': recent,
})

View file

@ -1,2 +1,3 @@
flask
bcrypt
manuf