dashboard/templates/plugins/sleep_state.html

30 lines
1.5 KiB
HTML

{% if error %}<div class="alert">systemd-inhibit failed: {{ error }}</div>{% endif %}
{% if message %}<div class="notice">{{ message }}</div>{% endif %}
<div class="llama-health">
<span class="dot {{ "dot-failed" if verdict == "blocked" else "dot-run" }}"></span>
<span class="llama-health-text">{{ "sleep blocked" if verdict == "blocked" else "sleep allowed" }}</span>
<span class="muted small">block-mode locks only — delay-mode locks are ignored</span>
</div>
<label class="chk">
<input type="checkbox" name="on" value="1" {% if holding %}checked{% endif %} hx-post="/api/plugins/sleep/toggle" hx-target="closest .plugin-body" hx-swap="innerHTML">
keep system awake (this dashboard holds a sleep lock)
</label>
{% if inhibitors %}
<div class="table-wrap">
<table class="table">
<thead><tr><th>who</th><th>what</th><th>why</th><th>mode</th></tr></thead>
<tbody>
{% for e in inhibitors %}
<tr class="{{ "inh-own" if e.own else "" }}">
<td class="cell-clip">{{ e.who }}{% if e.proc %} <span class="muted small mono">{{ e.proc }}</span>{% endif %}</td>
<td>{% for w in e.what.split(":") if w %}<span class="badge">{{ w }}</span> {% endfor %}</td>
<td class="cell-clip muted">{{ e.why }}</td>
<td><span class="badge {{ "badge-block" if e.mode == "block" else "" }}">{{ e.mode }}</span></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="muted small">no active block-mode inhibitors — the system may sleep</div>
{% endif %}