- Native <dialog> modal infra (CSS + ~30 LOC JS, no framework) used for create forms and delete confirmations. - Index pages become listing-only: + Create button opens a modal; the broken blueprint Actions column and inline overlay edit cells are gone. - Server detail gains a blueprint reassignment form; existing Delete button now opens a confirmation modal before tearing down the runtime. - Blueprint detail gains a Delete button + confirmation modal (was unreachable from the UI before). - New overlay detail page at /overlays/<id> with edit form, "Used by" blueprints list, and delete (admin only). - Server create: port field is now optional; backend auto-assigns the next free port from LEFT4ME_PORT_RANGE_START/_END (default 27015-27115). 409 on range exhaustion. - New routes: POST /blueprints/<id>/delete (form sentinel matching overlays pattern), POST /servers/<id> (form-friendly blueprint reassign), GET /overlays/<id>. - Server delete operation now redirects to /servers; overlay update redirects to /overlays/<id>. Server rename remains unsupported pending an id-vs-name design pass for l4d2host (the runtime directory is name-keyed; renaming would orphan files). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
64 lines
2.1 KiB
HTML
64 lines
2.1 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Overlay {{ overlay.name }} | left4me{% endblock %}
|
|
|
|
{% block content %}
|
|
<section class="panel">
|
|
<div class="page-heading">
|
|
<h1>Overlay: {{ overlay.name }}</h1>
|
|
{% if g.user.admin %}
|
|
<button type="button" class="danger" data-modal-open="delete-overlay-modal">Delete</button>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{% if g.user.admin %}
|
|
<form method="post" action="/overlays/{{ overlay.id }}" class="stack">
|
|
<input type="hidden" name="csrf_token" value="{{ session.get('csrf_token', '') }}">
|
|
<label>Name <input name="name" value="{{ overlay.name }}" required></label>
|
|
<label>Path <input name="path" value="{{ overlay.path }}" required></label>
|
|
<div>
|
|
<button type="submit">Save</button>
|
|
</div>
|
|
</form>
|
|
{% else %}
|
|
<table class="definition-table">
|
|
<tbody>
|
|
<tr><th>Name</th><td>{{ overlay.name }}</td></tr>
|
|
<tr><th>Path</th><td>{{ overlay.path }}</td></tr>
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<h2>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 g.user.admin %}
|
|
<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 %}
|