Development
This commit is contained in:
parent
ac0aa4de22
commit
91d8b950b7
5 changed files with 38 additions and 35 deletions
|
|
@ -290,7 +290,7 @@ def queued_msg(cmd=None, description='', action_label='Configuration saved'):
|
|||
return _build_timing_msg(entry_ts, cmd, action_label)
|
||||
|
||||
|
||||
# ── Snapshot system ───────────────────────────────────────────────────────────
|
||||
# Snapshot system ===================================================
|
||||
|
||||
def _pending_uuid_set():
|
||||
return {item[0] for item in _read_dashboard_pending()}
|
||||
|
|
@ -437,7 +437,7 @@ def save_config_with_snapshot(new_core, path, key, operation, before, after,
|
|||
return _build_timing_msg(entry_ts, cmd)
|
||||
|
||||
|
||||
# ── Misc ──────────────────────────────────────────────────────────────────────
|
||||
# Misc ==============================================================
|
||||
|
||||
def run_apply():
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -931,7 +931,8 @@ def _render_item(item, tokens, inherited_req=None):
|
|||
if extra:
|
||||
cls = f'{cls} {extra}'
|
||||
text = e(apply_tokens(item.get('text', ''), tokens))
|
||||
action = e(apply_tokens(item.get('action', '#'), tokens))
|
||||
action_raw = item.get('action', '')
|
||||
action = e(apply_tokens(action_raw, tokens))
|
||||
disabled_val = apply_tokens(str(item.get('disabled', '')), tokens)
|
||||
disabled = ' disabled' if disabled_val and disabled_val not in ('false', '0') else ''
|
||||
formaction = item.get('formaction', '')
|
||||
|
|
@ -941,7 +942,9 @@ def _render_item(item, tokens, inherited_req=None):
|
|||
if item.get('method', '').lower() == 'post':
|
||||
return (f'<form method="post" action="{action}" class="form-inline">'
|
||||
f'<button type="submit" class="btn {e(cls)}"{disabled}>{text}</button></form>')
|
||||
return f'<a href="{action}" class="btn {e(cls)}">{text}</a>'
|
||||
if action_raw:
|
||||
return f'<a href="{action}" class="btn {e(cls)}">{text}</a>'
|
||||
return f'<button type="submit" class="btn {e(cls)}"{disabled}>{text}</button>'
|
||||
|
||||
if t == 'button_cancel':
|
||||
text = e(apply_tokens(item.get('text', 'Cancel'), tokens))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue