Development

This commit is contained in:
Matthew Grotke 2026-05-26 20:14:56 -04:00
parent 95a6961855
commit 6a3197dd68
3 changed files with 15 additions and 4 deletions

View file

@ -4,6 +4,7 @@ from flask import session
CONFIGS_DIR = '/routlin_location'
DATA_DIR = '/data'
WWW_DIR = '/www'
ACCOUNTS_FILE = f'{DATA_DIR}/authorized_accounts.json'
CONFIG_FILE = f'{CONFIGS_DIR}/config.json'
DASHBOARD_QUEUE = f'{CONFIGS_DIR}/.dashboard-queue'

View file

@ -4,7 +4,7 @@ import json, re, subprocess, os, sys, html as html_mod
import sanitize
import validation as validate
from datetime import datetime, timezone
from config_utils import config_hash, get_pending_entries, get_dashboard_pending, get_dashboard_done, load_snapshot_for_uuid, load_all_snapshots, get_done_timestamps, queue_command, _find_cmd_in_queues, _entry_ts_from_queue, _apply_changes_immediately, _seconds_until_next_run, _format_timing, _is_locked, _lock_mtime, WEB_APP_DISPLAY_NAME, CONFIGS_DIR, DATA_DIR
from config_utils import config_hash, get_pending_entries, get_dashboard_pending, get_dashboard_done, load_snapshot_for_uuid, load_all_snapshots, get_done_timestamps, queue_command, _find_cmd_in_queues, _entry_ts_from_queue, _apply_changes_immediately, _seconds_until_next_run, _format_timing, _is_locked, _lock_mtime, WEB_APP_DISPLAY_NAME, CONFIGS_DIR, DATA_DIR, WWW_DIR
bp = Blueprint('view_page', __name__)
@ -56,6 +56,14 @@ def _load_css():
return ''
def _load_icon(name):
try:
with open(f'{WWW_DIR}/icons/{name}.svg') as f:
return f.read().strip()
except Exception:
return ''
# Shell helper ======================================================
def _run(cmd):
@ -672,9 +680,10 @@ def collect_tokens():
tokens['PENDING_ACTIONS_HTML'] = pending_html
tokens['NO_PENDING'] = 'true' if not pending_items else ''
tokens['APPLY_WARNING'] = (
'<span class="btn-notice btn-notice-warning">'
'Applying actions will temporarily disrupt connections as network services are restarted.'
'</span>'
f'<span class="btn-notice btn-notice-warning">'
f'{_load_icon("arrow-right")}'
f'Applying actions will temporarily disrupt connections as network services are restarted.'
f'</span>'
if pending_items else ''
)
done_ts_map = get_done_timestamps()

View file

@ -8,6 +8,7 @@ services:
- "25327:25327"
volumes:
- ./data:/data
- ./www:/www
- $HOME/routlin:/routlin_location
- /sys/class/net:/sys/class/net:ro
- /sys/devices:/sys/devices:ro