Development
This commit is contained in:
parent
14c9b4983e
commit
7eae567e6c
1 changed files with 8 additions and 6 deletions
|
|
@ -591,7 +591,9 @@ def collect_tokens():
|
||||||
tokens['GENERAL_DAILY_EXECUTE_TIME'] = str(dns_blk_gen.get('daily_execute_time_24hr_local', '-'))
|
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'
|
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:
|
if pending_items:
|
||||||
# Group by command; each group = one row in the Pending Actions table.
|
# Group by command; each group = one row in the Pending Actions table.
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
@ -601,18 +603,19 @@ def collect_tokens():
|
||||||
rows = ''
|
rows = ''
|
||||||
for cmd, entries in groups.items():
|
for cmd, entries in groups.items():
|
||||||
users = ', '.join(sorted({u for _, u in entries if u and u != 'unknown'}))
|
users = ', '.join(sorted({u for _, u in entries if u and u != 'unknown'}))
|
||||||
if cmd == 'fix problems':
|
snap_uuids = [_uuid for _uuid, _ in entries if _uuid in _snap_uuid_set]
|
||||||
req_cell = '<td class="table-cell">-</td>'
|
if snap_uuids:
|
||||||
else:
|
|
||||||
req_tags = ''.join(
|
req_tags = ''.join(
|
||||||
f'<span class="tag" data-tooltip="{_uuid}" data-uuid="{_uuid}">'
|
f'<span class="tag" data-tooltip="{_uuid}" data-uuid="{_uuid}">'
|
||||||
f'<span class="tl-full">{_uuid[:8]}</span>'
|
f'<span class="tl-full">{_uuid[:8]}</span>'
|
||||||
f'<span class="tl-short">{_uuid[:8]}</span>'
|
f'<span class="tl-short">{_uuid[:8]}</span>'
|
||||||
f'<span class="tl-min">{_uuid[:8]}</span>'
|
f'<span class="tl-min">{_uuid[:8]}</span>'
|
||||||
f'</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>'
|
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>'
|
rows += (f'<tr>'
|
||||||
f'<td class="table-cell">{e(cmd)}</td>'
|
f'<td class="table-cell">{e(cmd)}</td>'
|
||||||
f'<td class="table-cell">{e(users)}</td>'
|
f'<td class="table-cell">{e(users)}</td>'
|
||||||
|
|
@ -633,7 +636,6 @@ def collect_tokens():
|
||||||
tokens['PENDING_ACTIONS_HTML'] = pending_html
|
tokens['PENDING_ACTIONS_HTML'] = pending_html
|
||||||
tokens['NO_PENDING'] = 'true' if not pending_items else ''
|
tokens['NO_PENDING'] = 'true' if not pending_items else ''
|
||||||
|
|
||||||
all_snaps = load_all_snapshots()
|
|
||||||
done_ts_map = get_done_timestamps()
|
done_ts_map = get_done_timestamps()
|
||||||
if all_snaps:
|
if all_snaps:
|
||||||
# UUIDs that cannot be reverted: revert entries themselves, and entries
|
# UUIDs that cannot be reverted: revert entries themselves, and entries
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue