summaryrefslogtreecommitdiffstats
path: root/templates/instances/config.html
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-07-29 12:21:32 +0200
committersalmonik <salmonik@tuta.io>2026-07-29 12:21:32 +0200
commitbc0d3d2f324ee613424ee31103207222b4b19640 (patch)
tree483f699f303c44af6ec27b8f357e220b4d683e0c /templates/instances/config.html
parentEnable/disable mods, batch toggle & delete (diff)
downloadminecraft-ui-bc0d3d2f324ee613424ee31103207222b4b19640.tar.gz
minecraft-ui-bc0d3d2f324ee613424ee31103207222b4b19640.zip
Config editor, host networking, whitelist RCON
- Config file editor at /instances/{id}/config (browse & edit config/ files) - Host networking for Docker container (fixes WireGuard MTU DNS issues) - Whitelist changes applied live via RCON instead of stopping the server - Config edit handler detects which fields changed: whitelist → RCON, other settings → restart container - walk_dir simplified (removed unused root param) - import_world uses if-let instead of never-looping while-let - docker-compose.yml updated as reference template
Diffstat (limited to '')
-rw-r--r--templates/instances/config.html64
1 files changed, 64 insertions, 0 deletions
diff --git a/templates/instances/config.html b/templates/instances/config.html
new file mode 100644
index 0000000..192a123
--- /dev/null
+++ b/templates/instances/config.html
@@ -0,0 +1,64 @@
1{% extends "base.html" %} {% block content %}
2<div class="page-header">
3 <h1>Config Files: {{ instance_name }}</h1>
4 <a href="/instances/{{ instance_id }}/edit" class="btn"
5 >&larr; Back to Instance</a
6 >
7</div>
8
9{% if saved %}
10<div class="flash flash-ok">File saved successfully.</div>
11{% endif %} {% if let Some(err) = error %}
12<div class="flash flash-err">{{ err }}</div>
13{% endif %}
14
15<div style="display: flex; gap: 1.5rem; align-items: flex-start">
16 {# File list sidebar #}
17 <div class="card" style="flex: 0 0 260px; max-height: 70vh; overflow-y: auto">
18 <h3 style="margin-bottom: 0.5rem">Files</h3>
19 {% if files.is_empty() %}
20 <p style="font-size: 0.85rem; color: var(--fg-muted)">
21 No config files yet.<br />Start the server to generate them.
22 </p>
23 {% else %}
24 <ul style="list-style: none; padding: 0; margin: 0; font-size: 0.85rem">
25 {% for f in files %}
26 <li style="padding: 0.25rem 0">
27 <a
28 href="/instances/{{ instance_id }}/config?path={{ f }}"
29 style="{% if selected_file.as_deref() == Some(f) %}font-weight:bold;color:var(--ok){% endif %}"
30 >
31 {{ f }}
32 </a>
33 </li>
34 {% endfor %}
35 </ul>
36 {% endif %}
37 </div>
38
39 {# Editor area #}
40 <div class="card" style="flex: 1">
41 {% if let Some(file) = selected_file %}
42 <h3 style="margin-bottom: 0.5rem">{{ file }}</h3>
43 {% if let Some(content) = content %}
44 <form method="post" action="/instances/{{ instance_id }}/config">
45 <input type="hidden" name="path" value="{{ file }}" />
46 <textarea
47 name="content"
48 rows="30"
49 style="width: 100%; font-family: monospace; font-size: 0.8rem"
50 spellcheck="false"
51 >
52{{ content }}</textarea>
53 <div style="margin-top: 0.5rem">
54 <button type="submit" class="btn-ok">Save</button>
55 </div>
56 </form>
57 {% else %}
58 <p style="color: var(--fg-muted)">Could not load file content.</p>
59 {% endif %} {% else %}
60 <p style="color: var(--fg-muted)">Select a file from the list to edit.</p>
61 {% endif %}
62 </div>
63</div>
64{% endblock %}