- 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>
84 lines
3.1 KiB
HTML
84 lines
3.1 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Server {{ server.name }} | left4me{% endblock %}
|
|
|
|
{% block content %}
|
|
<section class="panel">
|
|
<div class="page-heading">
|
|
<h1>Server: {{ server.name }}</h1>
|
|
<div class="button-row">
|
|
{% for operation in ["initialize", "start", "stop"] %}
|
|
<form method="post" action="/servers/{{ server.id }}/{{ operation }}" class="inline-form">
|
|
<input type="hidden" name="csrf_token" value="{{ session.get('csrf_token', '') }}">
|
|
<button type="submit">{{ operation }}</button>
|
|
</form>
|
|
{% endfor %}
|
|
<button type="button" class="danger" data-modal-open="delete-server-modal">delete</button>
|
|
</div>
|
|
</div>
|
|
|
|
<table class="definition-table">
|
|
<tbody>
|
|
<tr><th>Name</th><td>{{ server.name }}</td></tr>
|
|
<tr><th>Port</th><td>{{ server.port }}</td></tr>
|
|
<tr><th>Blueprint</th><td>{% if blueprint %}<a href="/blueprints/{{ blueprint.id }}">{{ blueprint.name }}</a>{% endif %}</td></tr>
|
|
<tr><th>Desired state</th><td>{{ server.desired_state }}</td></tr>
|
|
<tr><th>Actual state</th><td>{{ server.actual_state }}</td></tr>
|
|
<tr><th>Last error</th><td>{{ server.last_error or "-" }}</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<h2>Reassign blueprint</h2>
|
|
<form method="post" action="/servers/{{ server.id }}" class="stack">
|
|
<input type="hidden" name="csrf_token" value="{{ session.get('csrf_token', '') }}">
|
|
<label>Blueprint
|
|
<select name="blueprint_id" required>
|
|
{% for option in blueprints %}
|
|
<option value="{{ option.id }}"{% if option.id == server.blueprint_id %} selected{% endif %}>{{ option.name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</label>
|
|
<p class="field-hint">Changes apply on the next server action.</p>
|
|
<div>
|
|
<button type="submit">Save</button>
|
|
</div>
|
|
</form>
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<div class="page-heading">
|
|
<h2>Recent Jobs</h2>
|
|
<a href="/servers/{{ server.id }}/jobs">View all jobs</a>
|
|
</div>
|
|
{% set rows = recent_job_rows %}
|
|
{% set show_user = false %}
|
|
{% set show_server = false %}
|
|
{% set show_cancel = true %}
|
|
{% set cancel_next = "/servers/" ~ server.id %}
|
|
{% include "_job_table.html" %}
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<h2>Server Log</h2>
|
|
<pre class="log-stream" data-sse-url="/servers/{{ server.id }}/logs/stream"></pre>
|
|
</section>
|
|
|
|
<dialog id="delete-server-modal" class="modal" aria-labelledby="delete-server-title">
|
|
<div class="modal-header">
|
|
<h2 id="delete-server-title">Delete server "{{ server.name }}"?</h2>
|
|
<button type="button" class="modal-close" data-modal-close aria-label="Close">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p>This stops the server and tears down its runtime files. This cannot be undone.</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="button-secondary" data-modal-close>Cancel</button>
|
|
<form method="post" action="/servers/{{ server.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>
|
|
{% endblock %}
|