Vendors HTMX 2.0.4 (the prior file was a 1-line stub) and uses it to poll two new partials on a 2s tick while a job is in flight: - /servers/<id>/actions → state badge, filtered action buttons, last-job sentence, live job log (SSE) while a Start/Stop/Reset job is running. When the job is terminal the partial re-renders without hx-trigger and polling stops. - /overlays/<id>/build-status → build state badge, last-build sentence, live job log while a build_overlay job is running. Same terminal-state stop behavior. Server detail restructure: - Editable name moves out of the page body into a Rename modal triggered from a link next to Delete in the page footer. - Compact dl with Port (linked as steam://run/550//+connect <host>:<port>) and Blueprint. - Actions row: state badge + state-filtered buttons (start/stop, reset) + last-job sentence. Drift warning when desired ≠ actual. - Recent Jobs table removed. Overlay detail restructure: - Single panel, dl Type/Scope, no separate Last build row, no Builds section. - Script form gets two compound submits: "Save and build" and "Save, reset and rebuild". Standalone Rebuild/Wipe gone. - Build status state badge + last-build sentence under the editor; action buttons hide while a build is in flight. - Rename modal in the page footer next to Delete. sse.js binds on htmx:load (covers initial document and post-swap inserts) and closes EventSources on htmx:beforeCleanupElement to avoid leaking streams across swaps. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
120 lines
4.8 KiB
HTML
120 lines
4.8 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Overlay {{ overlay.name }} | left4me{% endblock %}
|
|
|
|
{% block content %}
|
|
{% set can_edit = g.user.admin or (overlay.type in ['workshop', 'script'] and overlay.user_id == g.user.id) %}
|
|
<section class="panel">
|
|
<div class="page-heading">
|
|
<h1>Overlay: {{ overlay.name }}</h1>
|
|
</div>
|
|
|
|
<dl class="server-info">
|
|
<div><dt>Type</dt><dd>{{ overlay.type }}</dd></div>
|
|
<div><dt>Scope</dt><dd>{% if overlay.user_id %}private{% else %}system{% endif %}</dd></div>
|
|
</dl>
|
|
|
|
{% if overlay.type == 'script' %}
|
|
<h2 class="section-title">Script</h2>
|
|
{% if can_edit %}
|
|
<form method="post" action="/overlays/{{ overlay.id }}/script" class="stack">
|
|
<input type="hidden" name="csrf_token" value="{{ session.get('csrf_token', '') }}">
|
|
<label>Bash script
|
|
<textarea name="script" rows="20" spellcheck="false">{{ overlay.script or "" }}</textarea>
|
|
</label>
|
|
<p class="muted">Runs sandboxed against the overlay directory mounted at <code>/overlay</code>.</p>
|
|
{% if not latest_build_is_running %}
|
|
<div class="form-actions-inline">
|
|
<button type="submit" name="action" value="save_build">Save and build</button>
|
|
<button type="submit" name="action" value="save_reset_build">Save, reset and rebuild</button>
|
|
</div>
|
|
{% endif %}
|
|
</form>
|
|
{% else %}
|
|
<pre class="script-preview">{{ overlay.script or "" }}</pre>
|
|
{% endif %}
|
|
{% include "_overlay_build_status.html" %}
|
|
{% endif %}
|
|
|
|
{% if overlay.type == 'workshop' %}
|
|
<h2 class="section-title">Workshop items</h2>
|
|
{% if can_edit and not latest_build_is_running %}
|
|
<form method="post" action="/overlays/{{ overlay.id }}/items" class="stack">
|
|
<input type="hidden" name="csrf_token" value="{{ session.get('csrf_token', '') }}">
|
|
<fieldset class="workshop-input-mode">
|
|
<legend>Input mode</legend>
|
|
<label><input type="radio" name="input_mode" value="items" checked> Items (paste IDs or URLs; one or many)</label>
|
|
<label><input type="radio" name="input_mode" value="collection"> Collection (one ID or URL)</label>
|
|
</fieldset>
|
|
<label>Workshop input <textarea name="input" rows="3" placeholder="123456789 https://steamcommunity.com/sharedfiles/filedetails/?id=987654321"></textarea></label>
|
|
<button type="submit">Add</button>
|
|
</form>
|
|
{% endif %}
|
|
|
|
<div id="overlay-item-table">
|
|
{% include "_overlay_item_table.html" with context %}
|
|
</div>
|
|
|
|
{% include "_overlay_build_status.html" %}
|
|
{% endif %}
|
|
|
|
<h2 class="section-title">Files</h2>
|
|
{% if not file_tree_root_entries %}
|
|
<p class="muted">No files yet — build this overlay to populate it.</p>
|
|
{% else %}
|
|
{% set entries = file_tree_root_entries %}
|
|
{% set truncated = file_tree_truncated %}
|
|
{% set truncated_count = file_tree_truncated_count %}
|
|
{% include "_overlay_file_tree.html" %}
|
|
{% endif %}
|
|
|
|
<h2 class="section-title">Used by</h2>
|
|
{% if using_blueprints %}
|
|
<ul class="used-by-list">
|
|
{% for blueprint in using_blueprints %}
|
|
<li><a href="/blueprints/{{ blueprint.id }}">{{ blueprint.name }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% else %}
|
|
<p class="muted">Not used by any blueprint.</p>
|
|
{% endif %}
|
|
</section>
|
|
|
|
{% if can_edit %}
|
|
<div class="page-footer-actions">
|
|
<button type="button" class="danger-outline" data-modal-open="delete-overlay-modal">Delete overlay</button>
|
|
<a href="#" class="link-button" data-modal-open="rename-overlay-modal">Rename</a>
|
|
</div>
|
|
|
|
<dialog id="rename-overlay-modal" class="modal" aria-labelledby="rename-overlay-title">
|
|
<div class="modal-header">
|
|
<h2 id="rename-overlay-title">Rename overlay</h2>
|
|
<button type="button" class="modal-close" data-modal-close aria-label="Close">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form method="post" action="/overlays/{{ overlay.id }}" class="inline-save">
|
|
<input type="hidden" name="csrf_token" value="{{ session.get('csrf_token', '') }}">
|
|
<input name="name" value="{{ overlay.name }}" required autofocus>
|
|
<button type="submit">Save</button>
|
|
</form>
|
|
</div>
|
|
</dialog>
|
|
|
|
<dialog id="delete-overlay-modal" class="modal" aria-labelledby="delete-overlay-title">
|
|
<div class="modal-header">
|
|
<h2 id="delete-overlay-title">Delete overlay "{{ overlay.name }}"?</h2>
|
|
<button type="button" class="modal-close" data-modal-close aria-label="Close">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p>This cannot be undone. Overlays in use by a blueprint cannot be deleted.</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="button-secondary" data-modal-close>Cancel</button>
|
|
<form method="post" action="/overlays/{{ overlay.id }}/delete" class="inline-form">
|
|
<input type="hidden" name="csrf_token" value="{{ session.get('csrf_token', '') }}">
|
|
<button class="danger" type="submit">Delete</button>
|
|
</form>
|
|
</div>
|
|
</dialog>
|
|
{% endif %}
|
|
{% endblock %}
|