linuxrouter/docker/routlin-dash/app/pages/intervlan/view.py
2026-06-07 00:21:08 -04:00

17 lines
650 B
Python

import json
import config_utils
import factory
def collect_tokens(cfg):
tokens = config_utils.collect_layout_tokens(cfg)
tokens['PROTOCOL_OPTIONS'] = json.dumps([
{'value': 'tcp', 'label': 'TCP'},
{'value': 'udp', 'label': 'UDP'},
{'value': 'both', 'label': 'TCP/UDP'},
])
content = factory.load_json(f'{factory.PAGES_DIR}/intervlan/content.json')
for table_item in factory.iter_table_items(content.get('items', [])):
ds = table_item.get('datasource', '')
tokens[factory.table_token_key(ds)] = factory.build_table(table_item, tokens, config_utils.load_datasource(ds))
return tokens