Development
This commit is contained in:
parent
6ad78e9ed7
commit
ffbdce3436
2 changed files with 7 additions and 3 deletions
|
|
@ -1528,7 +1528,7 @@ def build_item(item, tokens, inherited_req=None):
|
||||||
|
|
||||||
# Layout renderer =====================================================
|
# Layout renderer =====================================================
|
||||||
|
|
||||||
def render_layout(view_id, content_html, tokens, page_name=None):
|
def render_layout(view_id, content_html, tokens, page_name=None, suppress_pending_bar=False):
|
||||||
level = client_level()
|
level = client_level()
|
||||||
has_pending_alert = not config_utils._apply_changes_immediately() and bool(config_utils.get_dashboard_pending())
|
has_pending_alert = not config_utils._apply_changes_immediately() and bool(config_utils.get_dashboard_pending())
|
||||||
titlebar_html = f'<div class="titlebar"><span class="titlebar-brand">{config_utils.WEB_APP_DISPLAY_NAME}</span></div>'
|
titlebar_html = f'<div class="titlebar"><span class="titlebar-brand">{config_utils.WEB_APP_DISPLAY_NAME}</span></div>'
|
||||||
|
|
@ -1645,7 +1645,7 @@ def render_layout(view_id, content_html, tokens, page_name=None):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
pending_bar = ''
|
pending_bar = ''
|
||||||
if has_pending_alert and not problem_bars and view_id != 'actions':
|
if has_pending_alert and not problem_bars and view_id != 'actions' and not suppress_pending_bar:
|
||||||
pending_bar = (
|
pending_bar = (
|
||||||
'<div class="info-bar info-bar-warning">'
|
'<div class="info-bar info-bar-warning">'
|
||||||
'<span>You have actions pending. Please visit the <strong>Actions</strong> page.</span>'
|
'<span>You have actions pending. Please visit the <strong>Actions</strong> page.</span>'
|
||||||
|
|
|
||||||
|
|
@ -106,13 +106,17 @@ def serve_view(page_name):
|
||||||
config_utils.queue_command('gen radius')
|
config_utils.queue_command('gen radius')
|
||||||
|
|
||||||
flash_html = ''
|
flash_html = ''
|
||||||
|
has_success_flash = False
|
||||||
for category, message in get_flashed_messages(with_categories=True):
|
for category, message in get_flashed_messages(with_categories=True):
|
||||||
variant = {'error': 'danger', 'warning': 'warning', 'success': 'success'}.get(category, 'info')
|
variant = {'error': 'danger', 'warning': 'warning', 'success': 'success'}.get(category, 'info')
|
||||||
msg_html = message if isinstance(message, Markup) else factory.e(message)
|
msg_html = message if isinstance(message, Markup) else factory.e(message)
|
||||||
flash_html += f'<div class="info-bar info-bar-{variant} info-bar-flash"><span>{msg_html}</span></div>'
|
flash_html += f'<div class="info-bar info-bar-{variant} info-bar-flash"><span>{msg_html}</span></div>'
|
||||||
|
if category == 'success':
|
||||||
|
has_success_flash = True
|
||||||
|
|
||||||
content_html = flash_html + factory.build_items(view_def.get('items', []), tokens, view_req)
|
content_html = flash_html + factory.build_items(view_def.get('items', []), tokens, view_req)
|
||||||
return factory.render_layout(page_name, content_html, tokens, page_name=page_name)
|
return factory.render_layout(page_name, content_html, tokens, page_name=page_name,
|
||||||
|
suppress_pending_bar=has_success_flash)
|
||||||
|
|
||||||
# Register blueprints =================================================
|
# Register blueprints =================================================
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue