diff options
Diffstat (limited to '')
| -rw-r--r-- | templates/instances/config.html | 64 |
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 | >← 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 %} | ||
