Development

This commit is contained in:
Matthew Grotke 2026-05-26 01:32:46 -04:00
parent 14c9b4983e
commit 7eae567e6c

View file

@ -591,7 +591,9 @@ def collect_tokens():
tokens['GENERAL_DAILY_EXECUTE_TIME'] = str(dns_blk_gen.get('daily_execute_time_24hr_local', '-'))
tokens['GENERAL_APPLY_ON_SAVE'] = 'true' if session.get('apply_changes_immediately', False) else 'false'
pending_items = get_dashboard_pending()
all_snaps = load_all_snapshots()
_snap_uuid_set = {s.get('uuid') for s in all_snaps}
pending_items = get_dashboard_pending()
if pending_items:
# Group by command; each group = one row in the Pending Actions table.
from collections import defaultdict
@ -601,18 +603,19 @@ def collect_tokens():
rows = ''
for cmd, entries in groups.items():
users = ', '.join(sorted({u for _, u in entries if u and u != 'unknown'}))
if cmd == 'fix problems':
req_cell = '<td class="table-cell">-</td>'
else:
snap_uuids = [_uuid for _uuid, _ in entries if _uuid in _snap_uuid_set]
if snap_uuids:
req_tags = ''.join(
f'<span class="tag" data-tooltip="{_uuid}" data-uuid="{_uuid}">'
f'<span class="tl-full">{_uuid[:8]}</span>'
f'<span class="tl-short">{_uuid[:8]}</span>'
f'<span class="tl-min">{_uuid[:8]}</span>'
f'</span>'
for _uuid, _ in entries
for _uuid in snap_uuids
)
req_cell = f'<td class="table-cell"><div class="tag-list">{req_tags}</div></td>'
else:
req_cell = '<td class="table-cell">-</td>'
rows += (f'<tr>'
f'<td class="table-cell">{e(cmd)}</td>'
f'<td class="table-cell">{e(users)}</td>'
@ -633,7 +636,6 @@ def collect_tokens():
tokens['PENDING_ACTIONS_HTML'] = pending_html
tokens['NO_PENDING'] = 'true' if not pending_items else ''
all_snaps = load_all_snapshots()
done_ts_map = get_done_timestamps()
if all_snaps:
# UUIDs that cannot be reverted: revert entries themselves, and entries