{# Overview. What an operator wants on opening the panel, in order: is anything broken, is anything happening right now, what is deployed, and what just finished. Everything else is one click away and does not belong here. #} {% extends "base.html" %} {% import "_macros.html" as m %} {% block title %}Overview{% endblock %} {% block content %} {% call m.page_head("Overview", machine.hostname) %} Deploy {% endcall %} {# Attention first. When nothing is wrong this section is absent entirely, rather than showing a green "all systems operational" panel that trains people to ignore the top of the page. #} {% if attention %}

Needs attention

{% for item in attention %} {% call m.row(item.domain, item.state, item.meta, item.href, "row-" ~ item.id, none, item.state_text) %} Open {% endcall %} {% endfor %}
{% endif %} {# In flight, and only when there is something in flight: an empty "running" panel on every page load is furniture. #} {% if running %}

Working now

{% for job in running %} {% call m.row(job.name, job.state, [("step", job.current_step), ("progress", job.progress ~ "/" ~ job.total_steps), ("started", job.started)], "/activity", "row-" ~ job.id, none, job.status) %} {{ m.follow_button("Logs", job.name, job.log_url) }} {% endcall %} {% endfor %}
{% endif %} {# The machine's vital signs over time. The history comes from /api/metrics/{metric} and the live edge rides the metrics event on the shared /events stream; panel.js owns both, keyed off the data-chart hooks. The buttons are read by the client rather than being links: switching the window re-reads history without a navigation, and a plain data attribute is all the delegated click listener needs under script-src 'self'. #}

Machine

CPU
Memory
Network rx tx
Disk

Applications

{% if apps %}
{% for app in apps %} {% call m.row(app.domain, app.state, app.meta, app.href, "row-" ~ app.id, none, app.state_text) %} {{ m.follow_button("Logs", app.domain, app.log_url) }} {{ m.action_button("Restart", app.restart_endpoint, none, "Restarted " ~ app.domain) }} {% endcall %} {% endfor %}
{% else %} {{ m.empty( "No applications yet", "Deploy one from a Git repository, an archive or a local directory.", command="wasm create -d example.com -s https://github.com/you/app") }} {% endif %}

Recent activity

{% if activity %} {% for entry in activity %} {% endfor %}
Finished Action Resource Result
{{ entry.finished }} {{ entry.name }} {{ entry.resource }} {{ m.badge(entry.state, entry.status) }}
{% else %}

Nothing has happened on this machine yet.

{% endif %}
{% endblock %}