Development
This commit is contained in:
parent
6d9aac0460
commit
59ac3c5973
20 changed files with 1466 additions and 1 deletions
19
docker/routlin-dash/app/pages/physicalinterfaces/view.py
Normal file
19
docker/routlin-dash/app/pages/physicalinterfaces/view.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import json
|
||||
from view_common import get_system_interfaces, iface_info
|
||||
|
||||
|
||||
def collect_tokens(cfg):
|
||||
net = cfg.get('network_interfaces', {})
|
||||
wan = net.get('wan_interface', '')
|
||||
lan = net.get('lan_interface', '')
|
||||
sys_ifaces = get_system_interfaces()
|
||||
for configured in [wan, lan]:
|
||||
if configured and configured not in sys_ifaces:
|
||||
sys_ifaces.append(configured)
|
||||
sys_ifaces.sort()
|
||||
iface_data = [iface_info(i) for i in sys_ifaces]
|
||||
return {
|
||||
'GENERAL_WAN_INTERFACE': str(wan or '-'),
|
||||
'GENERAL_LAN_INTERFACE': str(lan or '-'),
|
||||
'NETWORK_INTERFACE_DATA_JSON': json.dumps(iface_data),
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue