Development
This commit is contained in:
parent
7da1630ab3
commit
0e18010353
3 changed files with 23 additions and 3 deletions
|
|
@ -45,13 +45,17 @@
|
||||||
"field": "mac_address",
|
"field": "mac_address",
|
||||||
"class": "col-mono"
|
"class": "col-mono"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "Vendor",
|
||||||
|
"field": "vendor"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "VLAN",
|
"label": "VLAN",
|
||||||
"field": "vlan_name"
|
"field": "vlan_name"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "Obtained",
|
"label": "Last Active",
|
||||||
"field": "obtained"
|
"field": "last_active"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "Expires",
|
"label": "Expires",
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,20 @@ HEALTH_FILE = os.path.join(CONFIGS_DIR, '.health')
|
||||||
|
|
||||||
bp = Blueprint('view_page', __name__)
|
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 ======================================================
|
# File loaders ======================================================
|
||||||
|
|
||||||
|
|
@ -221,8 +235,9 @@ def live_dhcp_leases():
|
||||||
'hostname': hostname_html,
|
'hostname': hostname_html,
|
||||||
'ip_address': parts[2],
|
'ip_address': parts[2],
|
||||||
'mac_address': parts[1],
|
'mac_address': parts[1],
|
||||||
|
'vendor': _get_vendor(parts[1]),
|
||||||
'vlan_name': vlan_name,
|
'vlan_name': vlan_name,
|
||||||
'obtained': obtained,
|
'last_active': obtained,
|
||||||
'expires': relative_time_future(expiry),
|
'expires': relative_time_future(expiry),
|
||||||
'recent': recent,
|
'recent': recent,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
flask
|
flask
|
||||||
bcrypt
|
bcrypt
|
||||||
|
manuf
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue