{# Cooperative control panel. POSTs write the control_state row; the monitor obeys it within ~3s. All actions carry the X-Avai-Token header (injected from localStorage by dashboard.html); the server fails closed without it. Swapped into #control on load/poll and after every action. #} {% set disabled = (ctrl.disabled_collectors.split(',') if ctrl and ctrl.disabled_collectors else []) %} {% set paused = ctrl and ctrl.paused %}

monitor control

{% if alive %} {{ ctrl.status or "running" }}{% if ctrl and ctrl.pid %} · pid {{ ctrl.pid }}{% endif %} {% else %} monitor offline {% endif %}
{% if not control_enabled %}
Control is disabled. Set AVAI_CONTROL_TOKEN on the dashboard process to enable it, then paste the token below.
{% endif %} {# Token lives only in the browser (localStorage), never server-rendered. #}
{# pause / resume + scan now #}
{% if paused %} {% else %} {% endif %} {% if paused %}scanning paused{% endif %}
{# live settings #}
{# per-collector enable/disable #}
scanners ({{ collectors|length - disabled|length }}/{{ collectors|length }} on)
{% for name in collectors %} {% set off = name in disabled %} {% endfor %}
{# maintenance one-shots #}
maintenance
{% if ctrl and ctrl.command_result %}
last action: {{ ctrl.command_result }}
{% endif %}