diff --git a/docker/routlin-dash/app/action_actions.py b/docker/routlin-dash/app/action_actions.py index 93fffa2..510ac60 100644 --- a/docker/routlin-dash/app/action_actions.py +++ b/docker/routlin-dash/app/action_actions.py @@ -8,17 +8,17 @@ bp = Blueprint('action_actions', __name__) _VIEW = '/view/view_actions' -@bp.route('/action/general_cardpendingchanges_save', methods=['POST']) +@bp.route('/action/actions_cardoptions_save', methods=['POST']) @require_level('administrator') -def general_cardpendingchanges_save(): +def actions_cardoptions_save(): session['apply_changes_immediately'] = 'apply_changes_immediately' in request.form flash('Preference saved.', 'success') return redirect(_VIEW) -@bp.route('/action/general_cardpendingchanges_applyselected', methods=['POST']) +@bp.route('/action/actions_cardpendingchanges_applyselected', methods=['POST']) @require_level('administrator') -def general_cardpendingchanges_applyselected(): +def actions_cardpendingchanges_applyselected(): items = get_dashboard_pending() if not items: flash('No pending changes to apply.', 'info') @@ -36,8 +36,8 @@ def general_cardpendingchanges_applyselected(): return redirect(_VIEW) -@bp.route('/action/general_cardpendingchanges_deleteselected', methods=['POST']) +@bp.route('/action/actions_cardpendingchanges_revertselected', methods=['POST']) @require_level('administrator') -def general_cardpendingchanges_deleteselected(): +def actions_cardpendingchanges_revertselected(): flash('Not yet implemented.', 'info') return redirect(_VIEW) diff --git a/docker/routlin-dash/app/config_utils.py b/docker/routlin-dash/app/config_utils.py index 6fa8ead..ff0ec78 100644 --- a/docker/routlin-dash/app/config_utils.py +++ b/docker/routlin-dash/app/config_utils.py @@ -109,7 +109,7 @@ def _trim_if_needed(): pass -def _apply_on_save(): +def _apply_changes_immediately(): try: return session.get('apply_changes_immediately', False) except Exception: @@ -178,7 +178,7 @@ def _queue_pending_command(cmd, description=''): def _queue_command(cmd, description=''): - if not _apply_on_save(): + if not _apply_changes_immediately(): return _queue_pending_command(cmd, description) done_set = _load_done_set() pending = _read_pending(done_set) @@ -243,7 +243,7 @@ def queued_msg(cmd=None, description='', action_label='Configuration saved'): entry_ts = None if cmd is not None: _entry_uuid, entry_ts = queue_command(cmd, description) - if not _apply_on_save(): + if not _apply_changes_immediately(): return f'{action_label}. Click Apply Now on the Configuration Changes card to apply.' if _is_locked(): mtime = _lock_mtime() diff --git a/docker/routlin-dash/app/view_page.py b/docker/routlin-dash/app/view_page.py index 7596524..a979f5c 100644 --- a/docker/routlin-dash/app/view_page.py +++ b/docker/routlin-dash/app/view_page.py @@ -601,9 +601,6 @@ def collect_tokens(): f'{label}' f'{e(user)}') pending_html = ( - '
' - '

Pending Changes

' '' '' '' @@ -612,10 +609,15 @@ def collect_tokens(): '' f'{rows}' '
Time
' - '
' + '' f'' '
' - '' + '' + '
' + '
' + f'' + '
' + '' '
' ) else: diff --git a/docker/routlin-dash/data/navbar_content.json b/docker/routlin-dash/data/navbar_content.json index 7a19a93..e098d03 100644 --- a/docker/routlin-dash/data/navbar_content.json +++ b/docker/routlin-dash/data/navbar_content.json @@ -6,30 +6,30 @@ "map_to": "view_overview", "client_requirement": "client_is_nothing+" }, - { - "type": "nav_item", - "label": "Actions", - "map_to": "view_actions", - "client_requirement": "client_is_administrator+" - }, { "type": "nav_menu", "label": "%MENU_LABEL%", "client_requirement": "client_is_viewer+", "items": [ - { "type": "nav_item", "label": "Network Interfaces", "map_to": "view_network_interfaces", "client_requirement": "client_is_administrator+" }, - { "type": "nav_item", "label": "DNS", "map_to": "view_upstream_dns", "client_requirement": "client_is_administrator+" }, - { "type": "nav_item", "label": "DNS Blocking", "map_to": "view_dns_blocking", "client_requirement": "client_is_administrator+" }, - { "type": "nav_item", "label": "DDNS", "map_to": "view_ddns" }, - { "type": "nav_item", "label": "VLANs", "map_to": "view_vlans", "client_requirement": "client_is_administrator+" }, - { "type": "nav_item", "label": "Inter-VLAN Exceptions", "map_to": "view_inter_vlan", "client_requirement": "client_is_administrator+" }, - { "type": "nav_item", "label": "Port Forwarding", "map_to": "view_port_forwarding", "client_requirement": "client_is_administrator+" }, - { "type": "nav_item", "label": "DHCP", "map_to": "view_dhcp" }, - { "type": "nav_item", "label": "Host Overrides", "map_to": "view_host_overrides", "client_requirement": "client_is_administrator+" }, - { "type": "nav_item", "label": "VPN", "map_to": "view_vpn" }, - { "type": "nav_item", "label": "Banned IPs", "map_to": "view_banned_ips", "client_requirement": "client_is_administrator+" } + { "type": "nav_item", "label": "Network Interfaces", "map_to": "view_network_interfaces", "client_requirement": "client_is_administrator+" }, + { "type": "nav_item", "label": "DNS", "map_to": "view_upstream_dns", "client_requirement": "client_is_administrator+" }, + { "type": "nav_item", "label": "DNS Blocking", "map_to": "view_dns_blocking", "client_requirement": "client_is_administrator+" }, + { "type": "nav_item", "label": "DDNS", "map_to": "view_ddns" }, + { "type": "nav_item", "label": "VLANs", "map_to": "view_vlans", "client_requirement": "client_is_administrator+" }, + { "type": "nav_item", "label": "Inter-VLAN Exceptions", "map_to": "view_inter_vlan", "client_requirement": "client_is_administrator+" }, + { "type": "nav_item", "label": "Port Forwarding", "map_to": "view_port_forwarding", "client_requirement": "client_is_administrator+" }, + { "type": "nav_item", "label": "DHCP", "map_to": "view_dhcp" }, + { "type": "nav_item", "label": "Host Overrides", "map_to": "view_host_overrides", "client_requirement": "client_is_administrator+" }, + { "type": "nav_item", "label": "VPN", "map_to": "view_vpn" }, + { "type": "nav_item", "label": "Banned IPs", "map_to": "view_banned_ips", "client_requirement": "client_is_administrator+" } ] }, + { + "type": "nav_item", + "label": "Actions", + "map_to": "view_actions", + "client_requirement": "client_is_administrator+" + }, { "type": "nav_menu", "label": "Profile",