summaryrefslogtreecommitdiffstats
path: root/templates/instances/edit.html
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--templates/instances/edit.html349
1 files changed, 271 insertions, 78 deletions
diff --git a/templates/instances/edit.html b/templates/instances/edit.html
index fdfc0e1..2660461 100644
--- a/templates/instances/edit.html
+++ b/templates/instances/edit.html
@@ -1,94 +1,287 @@
1{% extends "base.html" %} 1{% extends "base.html" %} {% block content %}
2{% block content %}
3<h1>Edit: {{ instance.name }}</h1> 2<h1>Edit: {{ instance.name }}</h1>
4 3
5<div class="card card-muted"> 4<div class="card card-muted">
6 <div class="meta"> 5 <div class="meta">
7 <span><strong>Version:</strong> {{ instance.version }}</span> 6 <span><strong>Version:</strong> {{ instance.version }}</span>
8 <span><strong>Type:</strong> {{ instance.server_type }}</span> 7 <span><strong>Type:</strong> {{ instance.server_type }}</span>
9 <span><strong>World:</strong> {{ instance.world_source }}</span> 8 <span><strong>World:</strong> {{ instance.world_source }}</span>
10 {% if let Some(seed) = current_seed %} 9 {% if let Some(seed) = current_seed %}
11 <span><strong>Seed:</strong> {{ seed }}</span> 10 <span><strong>Seed:</strong> {{ seed }}</span>
12 {% endif %} 11 {% endif %} {% if instance.has_modpack %}
13 {% if instance.has_modpack %} 12 <span><strong>Modpack:</strong> Installed</span>
14 <span><strong>Modpack:</strong> Installed</span> 13 {% endif %}
15 {% endif %} 14 </div>
16 </div>
17</div> 15</div>
18 16
19<form action="/instances/{{ instance.id }}/edit" method="post" class="form-col"> 17<form action="/instances/{{ instance.id }}/edit" method="post" class="form-col">
20 <fieldset> 18 <fieldset>
21 <legend>Server Properties</legend> 19 <legend>Server Properties</legend>
22 <label> 20 <label>
23 Memory (MB) 21 Memory (MB)
24 <input type="number" name="memory_mb" value="{{ instance.memory_mb }}" min="512" max="{{ max_memory_mb }}" required> 22 <input
25 </label> 23 type="number"
26 <label> 24 name="memory_mb"
27 Difficulty 25 value="{{ instance.memory_mb }}"
28 <select name="difficulty"> 26 min="512"
29 <option value="0" {% if instance.difficulty == 0 %}selected{% endif %}>Peaceful</option> 27 max="{{ max_memory_mb }}"
30 <option value="1" {% if instance.difficulty == 1 %}selected{% endif %}>Easy</option> 28 required
31 <option value="2" {% if instance.difficulty == 2 %}selected{% endif %}>Normal</option> 29 />
32 <option value="3" {% if instance.difficulty == 3 %}selected{% endif %}>Hard</option> 30 </label>
33 </select> 31 <label>
34 </label> 32 Difficulty
35 <label> 33 <select name="difficulty">
36 Gamemode 34 <option
37 <select name="gamemode"> 35 value="0"
38 <option value="0" {% if instance.gamemode == 0 %}selected{% endif %}>Survival</option> 36 {%
39 <option value="1" {% if instance.gamemode == 1 %}selected{% endif %}>Creative</option> 37 if
40 <option value="2" {% if instance.gamemode == 2 %}selected{% endif %}>Adventure</option> 38 instance.difficulty=""
41 <option value="3" {% if instance.gamemode == 3 %}selected{% endif %}>Spectator</option> 39 ="0"
42 </select> 40 %}selected{%
43 </label> 41 endif
44 <label> 42 %}
45 Max Players 43 >
46 <input type="number" name="max_players" value="{{ instance.max_players }}" min="1" max="100"> 44 Peaceful
47 </label> 45 </option>
48 <label> 46 <option
49 <input type="checkbox" name="pvp" {% if instance.pvp %}checked{% endif %}> PvP enabled 47 value="1"
50 </label> 48 {%
51 <label> 49 if
52 MOTD 50 instance.difficulty=""
53 <input type="text" name="motd" value="{{ instance.motd }}" maxlength="59"> 51 ="1"
54 </label> 52 %}selected{%
55 </fieldset> 53 endif
54 %}
55 >
56 Easy
57 </option>
58 <option
59 value="2"
60 {%
61 if
62 instance.difficulty=""
63 ="2"
64 %}selected{%
65 endif
66 %}
67 >
68 Normal
69 </option>
70 <option
71 value="3"
72 {%
73 if
74 instance.difficulty=""
75 ="3"
76 %}selected{%
77 endif
78 %}
79 >
80 Hard
81 </option>
82 </select>
83 </label>
84 <label>
85 Gamemode
86 <select name="gamemode">
87 <option value="0" {% if instance.gamemode="" ="0" %}selected{% endif %}>
88 Survival
89 </option>
90 <option value="1" {% if instance.gamemode="" ="1" %}selected{% endif %}>
91 Creative
92 </option>
93 <option value="2" {% if instance.gamemode="" ="2" %}selected{% endif %}>
94 Adventure
95 </option>
96 <option value="3" {% if instance.gamemode="" ="3" %}selected{% endif %}>
97 Spectator
98 </option>
99 </select>
100 </label>
101 <label>
102 Max Players
103 <input
104 type="number"
105 name="max_players"
106 value="{{ instance.max_players }}"
107 min="1"
108 max="100"
109 />
110 </label>
111 <label>
112 <input
113 type="checkbox"
114 name="pvp"
115 {%
116 if
117 instance.pvp
118 %}checked{%
119 endif
120 %}
121 />
122 PvP enabled
123 </label>
124 <label>
125 <input
126 type="checkbox"
127 name="whitelist_enabled"
128 {%
129 if
130 instance.whitelist_enabled
131 %}checked{%
132 endif
133 %}
134 />
135 Whitelist enabled
136 </label>
137 <label>
138 MOTD
139 <input
140 type="text"
141 name="motd"
142 value="{{ instance.motd }}"
143 maxlength="59"
144 />
145 </label>
146 </fieldset>
56 147
57 <div class="actions"> 148 <div class="actions">
58 <button type="submit" class="btn-ok">Save Changes</button> 149 <button type="submit" class="btn-ok">Save Changes</button>
59 <a href="/instances" class="btn">Cancel</a> 150 <a href="/instances" class="btn">Cancel</a>
60 </div> 151 </div>
61</form> 152</form>
62 153
63<div class="card{% if instance.is_active %} card-muted{% endif %}" style="margin-top:1.5rem"> 154<div
64 <h3>World Management</h3> 155 class="card{% if instance.is_active %} card-muted{% endif %}"
156 style="margin-top: 1.5rem"
157>
158 <h3>World Management</h3>
65 159
66 {% if instance.is_active %} 160 {% if instance.is_active %}
67 <div class="flash flash-warn">Stop the server before managing the world.</div> 161 <div class="flash flash-warn">Stop the server before managing the world.</div>
68 {% endif %} 162 {% endif %}
69 163
70 <div class="meta" style="margin-bottom:1rem"> 164 <div class="meta" style="margin-bottom: 1rem">
71 <span><strong>Current seed:</strong> 165 <span
72 {% if let Some(seed) = current_seed %} 166 ><strong>Current seed:</strong>
73 {{ seed }} 167 {% if let Some(seed) = current_seed %} {{ seed }} {% else %}
74 {% else %} 168 <em>not yet generated</em>
75 <em>not yet generated</em> 169 {% endif %}
76 {% endif %} 170 </span>
77 </span> 171 </div>
78 </div>
79 172
80 <div class="actions" style="flex-wrap:wrap; gap:1rem; {% if instance.is_active %}pointer-events:none; opacity:0.5{% endif %}"> 173 <div
81 <a href="/instances/{{ instance.id }}/world/export" class="btn" hx-boost="false"{% if instance.is_active %} tabindex="-1"{% endif %}>Export World</a> 174 class="actions"
175 style="flex-wrap:wrap; gap:1rem; {% if instance.is_active %}pointer-events:none; opacity:0.5{% endif %}"
176 >
177 <a
178 href="/instances/{{ instance.id }}/world/export"
179 class="btn"
180 hx-boost="false"
181 {%
182 if
183 instance.is_active
184 %}
185 tabindex="-1"
186 {%
187 endif
188 %}
189 >Export World</a
190 >
82 191
83 <form action="/instances/{{ instance.id }}/world/import" method="post" enctype="multipart/form-data" style="display:flex;align-items:center;gap:0.5rem" hx-boost="false"> 192 <form
84 <input type="file" name="world_zip" accept=".zip" required style="font-size:0.85rem"{% if instance.is_active %} disabled{% endif %}> 193 action="/instances/{{ instance.id }}/world/import"
85 <button type="submit" class="btn" onclick="return confirm('This will replace the current world. Continue?')"{% if instance.is_active %} disabled{% endif %}>Import</button> 194 method="post"
86 </form> 195 enctype="multipart/form-data"
196 style="display: flex; align-items: center; gap: 0.5rem"
197 hx-boost="false"
198 >
199 <input
200 type="file"
201 name="world_zip"
202 accept=".zip"
203 required
204 style="font-size: 0.85rem"
205 {%
206 if
207 instance.is_active
208 %}
209 disabled{%
210 endif
211 %}
212 />
213 <button
214 type="submit"
215 class="btn"
216 onclick="
217 return confirm('This will replace the current world. Continue?');
218 "
219 {%
220 if
221 instance.is_active
222 %}
223 disabled{%
224 endif
225 %}
226 >
227 Import
228 </button>
229 </form>
230
231 <form
232 action="/instances/{{ instance.id }}/world/regenerate"
233 method="post"
234 class="form-row"
235 onsubmit="
236 return confirm(
237 'This will DELETE the current world and generate a new one. Continue?',
238 );
239 "
240 >
241 <input
242 type="text"
243 name="seed"
244 placeholder="Seed (empty = random)"
245 style="width: 180px"
246 {%
247 if
248 instance.is_active
249 %}
250 disabled{%
251 endif
252 %}
253 />
254 <button
255 type="submit"
256 class="btn-danger"
257 {%
258 if
259 instance.is_active
260 %}
261 disabled{%
262 endif
263 %}
264 >
265 Regenerate
266 </button>
267 </form>
268 </div>
269</div>
87 270
88 <form action="/instances/{{ instance.id }}/world/regenerate" method="post" class="form-row" onsubmit="return confirm('This will DELETE the current world and generate a new one. Continue?')"> 271<div class="card" style="margin-top: 1.5rem">
89 <input type="text" name="seed" placeholder="Seed (empty = random)" style="width:180px"{% if instance.is_active %} disabled{% endif %}> 272 <h3>Mods</h3>
90 <button type="submit" class="btn-danger"{% if instance.is_active %} disabled{% endif %}>Regenerate</button> 273 <div class="meta" style="margin-bottom: 0.5rem">
91 </form> 274 <span>
92 </div> 275 {% if instance.has_modpack %}
276 <strong>{{ mod_count }}</strong> mod{% if mod_count != 1 %}s{% endif %}
277 installed {% if rejected_count > 0 %} (<strong
278 >{{ rejected_count }}</strong
279 >
280 rejected) {% endif %} {% else %} No mods installed {% endif %}
281 </span>
282 </div>
283 <div class="actions">
284 <a href="/instances/{{ instance.id }}/mods" class="btn">Manage Mods</a>
285 </div>
93</div> 286</div>
94{% endblock %} 287{% endblock %}