diff --git a/docker/routlin-dash/app/view_page.py b/docker/routlin-dash/app/view_page.py index c696f1f..ff19df2 100644 --- a/docker/routlin-dash/app/view_page.py +++ b/docker/routlin-dash/app/view_page.py @@ -682,10 +682,7 @@ def collect_tokens(): tokens['NO_PENDING'] = 'true' if not pending_items else '' tokens['NO_DISMISSIBLE_PENDING'] = 'true' if not any(c != 'fix problems' for _, _, c, _ in pending_items) else '' tokens['APPLY_WARNING'] = ( - f'' - f'{_load_icon("arrow-right")}' - f'Applying actions will briefly disrupt connections as network services are restarted.' - f'' + 'note' if pending_items else '' ) done_ts_map = get_done_timestamps() @@ -929,13 +926,11 @@ def render_layout(view_id, content_html, tokens, page_name=None): try: import json as _j st = _j.load(open(HEALTH_FILE)) - grouped = {'error': [], 'warning': []} + problems = [] for section in ('configurations', 'logs'): for item in st.get(section, []): if item.get('status') == 'problem': - sev = item.get('severity', 'error') - text = e(item.get('detail', item.get('name', ''))) - grouped.setdefault(sev, []).append(text) + problems.append(e(item.get('detail', item.get('name', '')))) for item in st.get('services', []): if item.get('status') == 'problem': name = item.get('name', '') @@ -947,12 +942,11 @@ def render_layout(view_id, content_html, tokens, page_name=None): if not item.get('enabled_ok'): exp_parts.append(item.get('expected_enabled', 'enabled')) act_parts.append(item.get('enabled', 'unknown')) - detail = ( + problems.append(e( f"The {utype} `{name}` is expected to be " f"{' and '.join(exp_parts)} but is {' and '.join(act_parts)}." - ) - grouped.setdefault(item.get('severity', 'error'), []).append(e(detail)) - has_problems = any(items for items in grouped.values()) + )) + has_problems = bool(problems) fix_suffix = '' fix_uuid = None if has_problems: @@ -973,12 +967,9 @@ def render_layout(view_id, content_html, tokens, page_name=None): fix_suffix = ('Fix pending. Click Apply Now below to fix.' if view_id == 'actions' else 'Fix pending. Visit the Actions page ASAP to apply fix.') - for sev, items in grouped.items(): - if not items: - continue - cls = 'info-bar-danger' if sev == 'error' else 'info-bar-warning' + if problems: problems_list = ('') uuid_attr = (f' data-health-uuid="{e(fix_uuid)}"' if fix_uuid and _entry_ts_from_queue(fix_uuid) is not None else '') @@ -988,7 +979,7 @@ def render_layout(view_id, content_html, tokens, page_name=None): '
Health check - problems found:
' + problems_list + fix_html + '') - problem_bars += f'
{content}
\n' + problem_bars += f'
{content}
\n' except Exception: pass