{# Memory-shell probe panel. Loaded into #memory-shell-panel by the page shell, and by itself while a probe is running: an htmx poll chain stops as soon as the element is replaced by a panel whose `running` set is empty, so an idle page does not poll. The swap target is the page container, so this root element never targets itself. #}
{% if error %}
{{ error }}
{% endif %} {% if not available %}
{{ _('Memory-shell probe unavailable') }}
{{ unavailable_reason }}
{% else %} {# ── status row ─────────────────────────────────────── #}
{{ _('Probe:') }} {{ _('Enabled') if enabled else _('Disabled') }} {{ _('Auto probe:') }} {{ _('Enabled') if auto_probe else _('Disabled') }} {{ _('Cooldown:') }} {{ cooldown_seconds }}s {{ _('HTTP timeout:') }} {{ http_timeout_seconds }}s {{ _('Runs:') }} {{ runs }} {{ _('Failures:') }} {{ failures }} {% if running %} {{ _('Probing...') }} {{ running|join(', ') }} {% endif %}
{{ _('Trigger extensions:') }} {% for extension in trigger_extensions %}{{ extension }}{% if not loop.last %} {% endif %}{% endfor %}
{% if not enabled %}
{{ _('The memory-shell probe is disabled in config.toml; manual probes would only be recorded as failures.') }}
{% endif %} {# ── per-site table ─────────────────────────────────── #}
{{ _('Monitored sites') }}
{% for site in sites %} {% else %} {% endfor %}
{{ _('Site') }} {{ _('Root') }} {{ _('Base URL') }} {{ _('Last run') }} {{ _('Entries') }} {{ _('Suspicious') }} {{ _('Cooldown') }} {{ _('Actions') }}
{{ site.name }}
{{ site.site_id }}
{{ site.root or _('None') }} {{ site.base_url or _('None') }} {{ site.last_run or _('Never') }} {% if site.failure %}
{{ _('Failed') }}
{% endif %} {% if site.cleanup_error %}
{{ _('Cleanup failed') }}
{% endif %}
{{ site.entry_summary or _('None') }} {% if site.suspect_count %} {{ site.suspect_count }} {% else %}0{% endif %} {{ site.cooldown_remaining }}s {% if site.running %} {{ _('Probing...') }} {% else %} {% endif %}

{{ _('No watched site is configured for probing.') }}

{# ── findings ───────────────────────────────────────── #}
{{ _('Findings') }}
{% for finding in findings %}
{{ _('Suspicious') }} {{ finding.suspect_count }} {{ finding.site_name }} {{ finding.finished_at }} {% if finding.url %}{{ finding.url }}{% endif %} {% if finding.container %}{{ _('Container:') }} {{ finding.container }}{% endif %}
{% for entry in finding.suspects %} {% endfor %}
{{ _('Kind') }} {{ _('Name') }} {{ _('URLs') }} {{ _('Class name') }} {{ _('Class loader') }} {{ _('On disk') }} {{ _('Reasons') }}
{{ entry.kind or _('Unknown') }} {{ entry.name or _('None') }} {{ entry.urls|join(', ') if entry.urls else _('None') }} {{ entry.class_name or _('None') }} {{ entry.class_loader or _('None') }} {% if entry.on_disk %}{{ _('Yes') }} {% else %}{{ _('No') }}{% endif %} {% for reason in entry.reasons %}{{ reason }}{% if not loop.last %} {% endif %}{% endfor %} {% if not entry.reasons %}{{ _('None') }}{% endif %}
{% if finding.clean_count %}
{{ _('%(count)s non-suspicious entries collapsed', count=finding.clean_count) }}
{% endif %}
{% else %}

{{ _('No suspicious entry has been reported yet.') }}

{% endfor %} {# ── recent runs: failures and cleanup state stay visible ── #}
{{ _('Recent runs') }}
{% for run in recent_runs %} {% else %} {% endfor %}
{{ _('Site') }} {{ _('Time') }} {{ _('Trigger:') }} {{ _('Duration:') }} {{ _('Status') }} {{ _('Entries') }}
{{ run.site_name }}
{% if run.triggered_by %}
{{ _('Triggered by:') }} {{ run.triggered_by }}
{% endif %}
{{ run.finished_at or _('Never') }} {{ _('Manual') if run.trigger == 'manual' else _('Auto') }} {{ run.duration_ms }} ms {% if run.failure %}{{ _('Failed') }} {% elif not run.cleanup_ok %}{{ _('Cleanup failed') }} {% elif run.ok %}{{ _('Clean') }} {% else %}{{ _('Unknown') }}{% endif %}
{{ run.entry_summary or _('None') }}
{% if run.clean_count %}
{{ _('%(count)s non-suspicious entries collapsed', count=run.clean_count) }}
{% endif %} {% if run.failure %}
{{ _('Probe failed:') }} {{ run.failure }}
{% endif %} {% if not run.cleanup_ok %}
{{ _('Probe cleanup failed:') }} {{ run.cleanup_error or _('Unknown') }}
{{ _('A probe file may still exist in the web root. Remove it manually.') }}
{% endif %} {% if run.report_error %}
{{ _('Report error:') }} {{ run.report_error }}
{% endif %}

{{ _('No probe has run yet.') }}

{% endif %}