17 lines
801 B
Python
17 lines
801 B
Python
import json
|
|
import config_utils
|
|
import factory
|
|
|
|
|
|
def collect_tokens(cfg):
|
|
tokens = config_utils.collect_layout_tokens(cfg)
|
|
tokens['ACCOUNT_LEVEL_OPTIONS'] = json.dumps([
|
|
{'value': 'viewer', 'label': 'Viewer (read-only access to live data)'},
|
|
{'value': 'administrator', 'label': 'Administrator (can modify configuration)'},
|
|
{'value': 'manager', 'label': 'Manager (full access including account management)'},
|
|
])
|
|
content = factory.load_json(f'{factory.PAGES_DIR}/accountmanage/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
|