Development
This commit is contained in:
parent
563d82daf3
commit
70ccfe2c29
48 changed files with 549 additions and 578 deletions
|
|
@ -3,9 +3,9 @@ import sqlite3
|
|||
import time
|
||||
import datetime
|
||||
|
||||
from config_utils import collect_layout_tokens, CREDENTIALS_DB
|
||||
from factory import load_json, build_table, table_token_key, iter_table_items, PAGES_DIR
|
||||
import settings as settings
|
||||
import config_utils
|
||||
import factory
|
||||
import settings
|
||||
|
||||
PRO_LICENSE = settings.is_pro()
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ HASH_TYPE_LABELS = {0: 'Cleartext', 1: 'NT-Password', 2: 'Bcrypt'}
|
|||
|
||||
def _load_credentials():
|
||||
try:
|
||||
conn = sqlite3.connect(CREDENTIALS_DB)
|
||||
conn = sqlite3.connect(config_utils.CREDENTIALS_DB)
|
||||
conn.row_factory = sqlite3.Row
|
||||
conn.execute("""
|
||||
CREATE TABLE IF NOT EXISTS credentials (
|
||||
|
|
@ -61,7 +61,7 @@ def _format_expiry(date_set, valid_for):
|
|||
|
||||
|
||||
def collect_tokens(cfg):
|
||||
tokens = collect_layout_tokens(cfg)
|
||||
tokens = config_utils.collect_layout_tokens(cfg)
|
||||
|
||||
tokens['PRO_NOTE'] = (
|
||||
'' if PRO_LICENSE else
|
||||
|
|
@ -92,10 +92,10 @@ def collect_tokens(cfg):
|
|||
r['expires_label'] = _format_expiry(r.get('date_set', 0), r.get('valid_for'))
|
||||
display_rows.append(r)
|
||||
|
||||
content = load_json(f'{PAGES_DIR}/clientcredentials/content.json')
|
||||
for table_item in iter_table_items(content.get('items', [])):
|
||||
content = factory.load_json(f'{factory.PAGES_DIR}/clientcredentials/content.json')
|
||||
for table_item in factory.iter_table_items(content.get('items', [])):
|
||||
ds = table_item.get('datasource', '')
|
||||
data = display_rows if ds == 'sqlite:client_credentials' else []
|
||||
tokens[table_token_key(ds)] = build_table(table_item, tokens, data)
|
||||
tokens[factory.table_token_key(ds)] = factory.build_table(table_item, tokens, data)
|
||||
|
||||
return tokens
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue