Development
This commit is contained in:
parent
95a6961855
commit
6a3197dd68
3 changed files with 15 additions and 4 deletions
|
|
@ -4,6 +4,7 @@ from flask import session
|
||||||
|
|
||||||
CONFIGS_DIR = '/routlin_location'
|
CONFIGS_DIR = '/routlin_location'
|
||||||
DATA_DIR = '/data'
|
DATA_DIR = '/data'
|
||||||
|
WWW_DIR = '/www'
|
||||||
ACCOUNTS_FILE = f'{DATA_DIR}/authorized_accounts.json'
|
ACCOUNTS_FILE = f'{DATA_DIR}/authorized_accounts.json'
|
||||||
CONFIG_FILE = f'{CONFIGS_DIR}/config.json'
|
CONFIG_FILE = f'{CONFIGS_DIR}/config.json'
|
||||||
DASHBOARD_QUEUE = f'{CONFIGS_DIR}/.dashboard-queue'
|
DASHBOARD_QUEUE = f'{CONFIGS_DIR}/.dashboard-queue'
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import json, re, subprocess, os, sys, html as html_mod
|
||||||
import sanitize
|
import sanitize
|
||||||
import validation as validate
|
import validation as validate
|
||||||
from datetime import datetime, timezone
|
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__)
|
bp = Blueprint('view_page', __name__)
|
||||||
|
|
||||||
|
|
@ -56,6 +56,14 @@ def _load_css():
|
||||||
return ''
|
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 ======================================================
|
# Shell helper ======================================================
|
||||||
|
|
||||||
def _run(cmd):
|
def _run(cmd):
|
||||||
|
|
@ -672,9 +680,10 @@ 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 ''
|
||||||
tokens['APPLY_WARNING'] = (
|
tokens['APPLY_WARNING'] = (
|
||||||
'<span class="btn-notice btn-notice-warning">'
|
f'<span class="btn-notice btn-notice-warning">'
|
||||||
'Applying actions will temporarily disrupt connections as network services are restarted.'
|
f'{_load_icon("arrow-right")}'
|
||||||
'</span>'
|
f'Applying actions will temporarily disrupt connections as network services are restarted.'
|
||||||
|
f'</span>'
|
||||||
if pending_items else ''
|
if pending_items else ''
|
||||||
)
|
)
|
||||||
done_ts_map = get_done_timestamps()
|
done_ts_map = get_done_timestamps()
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ services:
|
||||||
- "25327:25327"
|
- "25327:25327"
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/data
|
- ./data:/data
|
||||||
|
- ./www:/www
|
||||||
- $HOME/routlin:/routlin_location
|
- $HOME/routlin:/routlin_location
|
||||||
- /sys/class/net:/sys/class/net:ro
|
- /sys/class/net:/sys/class/net:ro
|
||||||
- /sys/devices:/sys/devices:ro
|
- /sys/devices:/sys/devices:ro
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue