Development
This commit is contained in:
parent
7da1630ab3
commit
0e18010353
3 changed files with 23 additions and 3 deletions
|
|
@ -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,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue