linuxrouter/docker/routlin-dash/app/pages/hostoverrides/view.py

12 lines
456 B
Python
Raw Permalink Normal View History

2026-06-07 00:21:08 -04:00
import config_utils
import factory
2026-06-02 12:49:39 -04:00
def collect_tokens(cfg):
2026-06-07 00:21:08 -04:00
tokens = config_utils.collect_layout_tokens(cfg)
content = factory.load_json(f'{factory.PAGES_DIR}/hostoverrides/content.json')
for table_item in factory.iter_table_items(content.get('items', [])):
2026-06-02 12:49:39 -04:00
ds = table_item.get('datasource', '')
2026-06-07 00:21:08 -04:00
tokens[factory.table_token_key(ds)] = factory.build_table(table_item, tokens, config_utils.load_datasource(ds))
2026-06-02 12:49:39 -04:00
return tokens