{% import "components.html" as c with context %} {% set sharing = share_data is defined %} {% set base = "/computers/" ~ ref(selected.computer.id) %}
{% call c.column_header(selected.computer.name, back="/computers") %} {% if selected.system in c.os_icons %}{{ c.icon(c.os_icons[selected.system]) }}{% endif %} {% endcall %} {% if permissions.COMPUTERS_SHARE in selected.actions %}
{% endif %}
{% if sharing %} {% include "shares.html" %} {% else %} {# the commands that connect a computer just added, shown this once at the top of its page; the pane's refresh has no token to show, so the box keeps what it holds. the boxes marked to be skipped are named by their computer, so a morph onto another computer's page never takes one for its own #}
{% if enrolment is defined and enrolment %}{% include "enrolled.html" %}{% endif %}
{{ c.section_title(t.text("computers.agents")) }} {# the agents in a box of their own, the way to add one hanging off its corner #}
{% for agent in selected.agents %} {% set attrs %}x-data="agentStatus" data-agent='{{ dict(poll("agent-status", agent), labels=status_labels)|tojson }}'{% endset %} {{ c.list_item(agent.name, icons=c.agent_icons(agent, with_system=false), settings="/agents/" ~ ref(selected.computer.id) ~ "/" ~ ref(agent.id) ~ "/profile", status=agent.status, identity=agent.name, href="/agents/" ~ ref(selected.computer.id) ~ "/" ~ ref(agent.id), off=(agent.status == "offline"), live_status=true, attrs=attrs) }} {% endfor %} {% if not selected.agents %}{{ c.empty(t.text("computers.no_agents"), "users") }}{% endif %}
{% if permissions.AGENTS_CREATE in selected.actions %}
{% endif %} {# the question takes the button's place whole - a morph would leave a box marked to be skipped as it is - and the mark then keeps the pane's refresh from putting the button back #} {% if permissions.COMPUTERS_DELETE in selected.actions %}

{{ t.text("computers.remove") }}

{{ t.text("computers.remove_hint") }}

{% endif %} {% endif %}