From bc0d3d2f324ee613424ee31103207222b4b19640 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 29 Jul 2026 12:21:32 +0200 Subject: Config editor, host networking, whitelist RCON MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- templates/instances/config.html | 64 ++++++++++++ templates/instances/edit.html | 226 ++++++---------------------------------- templates/mods/list.html | 4 +- 3 files changed, 100 insertions(+), 194 deletions(-) create mode 100644 templates/instances/config.html (limited to 'templates') 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 @@ +{% extends "base.html" %} {% block content %} + + +{% if saved %} +
File saved successfully.
+{% endif %} {% if let Some(err) = error %} +
{{ err }}
+{% endif %} + +
+ {# File list sidebar #} +
+

Files

+ {% if files.is_empty() %} +

+ No config files yet.
Start the server to generate them. +

+ {% else %} + + {% endif %} +
+ + {# Editor area #} +
+ {% if let Some(file) = selected_file %} +

{{ file }}

+ {% if let Some(content) = content %} +
+ + +
+ +
+
+ {% else %} +

Could not load file content.

+ {% endif %} {% else %} +

Select a file from the list to edit.

+ {% endif %} +
+
+{% endblock %} diff --git a/templates/instances/edit.html b/templates/instances/edit.html index 77dfca6..ef7d53e 100644 --- a/templates/instances/edit.html +++ b/templates/instances/edit.html @@ -19,125 +19,41 @@ Server Properties @@ -147,12 +63,8 @@ -
+

World Management

- {% if instance.is_active %}
Stop the server before managing the world.
{% endif %} @@ -166,109 +78,39 @@
-
- Export World +
+ Export World -
- - + + +
-
- - + + +
+
+

Configuration Files

+
+ Edit mod/plugin config files inside config/ +
+ +
+

Mods

{% if instance.has_modpack %} {{ mod_count }} mod{% if mod_count != 1 %}s{% endif %} - installed {% if rejected_count > 0 %} ({{ rejected_count }} - rejected) {% endif %} {% else %} No mods installed {% endif %} + installed{% if rejected_count > 0 %} ({{ rejected_count }} rejected){% endif %} + {% else %} No mods installed {% endif %}
diff --git a/templates/mods/list.html b/templates/mods/list.html index b5420b8..b05a0e6 100644 --- a/templates/mods/list.html +++ b/templates/mods/list.html @@ -119,7 +119,7 @@ function batchSubmit(action) { const checked = document.querySelectorAll('input[name="mod_id"]:checked'); if (checked.length === 0) return; - const form = document.getElementById('batch-form'); + const form = document.querySelector('#batch-form'); // Clear any previous hidden inputs form.textContent = ''; form.action = '/instances/{{ instance_id }}/mods/batch-' + action; @@ -129,7 +129,7 @@ function batchSubmit(action) { input.type = 'hidden'; input.name = 'mod_id'; input.value = cb.value; - form.appendChild(input); + form.append(input); } form.submit(); -- cgit v1.2.3