summaryrefslogtreecommitdiffstats
path: root/templates/instances/create.html
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-07-12 19:38:03 +0200
committersalmonik <salmonik@tuta.io>2026-07-12 19:38:03 +0200
commitae7ef10b67737f08a86743f687bca30a12e9e17a (patch)
tree056539ab76b801559dc8d07ee6599220e2bd8e07 /templates/instances/create.html
parentarchitecture (diff)
downloadminecraft-ui-ae7ef10b67737f08a86743f687bca30a12e9e17a.tar.gz
minecraft-ui-ae7ef10b67737f08a86743f687bca30a12e9e17a.zip
first stable
Diffstat (limited to 'templates/instances/create.html')
-rw-r--r--templates/instances/create.html115
1 files changed, 115 insertions, 0 deletions
diff --git a/templates/instances/create.html b/templates/instances/create.html
new file mode 100644
index 0000000..45f70f4
--- /dev/null
+++ b/templates/instances/create.html
@@ -0,0 +1,115 @@
1{% extends "base.html" %}
2{% block content %}
3<h1>Create Instance</h1>
4
5{% if let Some(msg) = error %}
6<div class="flash flash-err">{{ msg }}</div>
7{% endif %}
8
9<form action="/instances/new" method="post" class="form-col form-wide">
10 <fieldset>
11 <legend>Basic Info</legend>
12 <label>
13 Name
14 <input type="text" name="name" required placeholder="My Server">
15 </label>
16 <label>
17 Version
18 <select name="version" required>
19 {% for v in versions %}
20 <option value="{{ v }}">{{ v }}</option>
21 {% endfor %}
22 </select>
23 </label>
24 <label>
25 Type
26 <select name="server_type" required>
27 <option value="VANILLA">Vanilla</option>
28 <option value="FORGE">Forge</option>
29 <option value="FABRIC">Fabric</option>
30 </select>
31 </label>
32 <label>
33 Memory (MB)
34 <input type="number" name="memory_mb" value="4096" min="512" max="{{ max_memory_mb }}" required>
35 <small>512 MB – {{ max_memory_mb }} MB</small>
36 </label>
37 </fieldset>
38
39 <fieldset>
40 <legend>World</legend>
41 <label>
42 <input type="radio" name="world_source" value="generate" checked onchange="toggleWorldSource()">
43 Generate new world
44 </label>
45 <div id="gen-options">
46 <label>
47 Seed (optional)
48 <input type="text" name="seed" placeholder="Leave empty for random">
49 </label>
50 <label>
51 Level Type
52 <select name="level_type">
53 <option value="DEFAULT">Default</option>
54 <option value="FLAT">Flat</option>
55 <option value="LARGEBIOMES">Large Biomes</option>
56 <option value="AMPLIFIED">Amplified</option>
57 </select>
58 </label>
59 </div>
60 <label>
61 <input type="radio" name="world_source" value="upload" onchange="toggleWorldSource()">
62 Upload world (ZIP)
63 </label>
64 <div id="upload-options" style="display:none">
65 <label>
66 World ZIP
67 <input type="file" name="world_zip" accept=".zip">
68 </label>
69 </div>
70 </fieldset>
71
72 <fieldset>
73 <legend>Server Properties</legend>
74 <label>
75 Difficulty
76 <select name="difficulty">
77 <option value="0">Peaceful</option>
78 <option value="1">Easy</option>
79 <option value="2">Normal</option>
80 <option value="3" selected>Hard</option>
81 </select>
82 </label>
83 <label>
84 Gamemode
85 <select name="gamemode">
86 <option value="0" selected>Survival</option>
87 <option value="1">Creative</option>
88 <option value="2">Adventure</option>
89 <option value="3">Spectator</option>
90 </select>
91 </label>
92 <label>
93 Max Players
94 <input type="number" name="max_players" value="20" min="1" max="100">
95 </label>
96 <label>
97 <input type="checkbox" name="pvp" checked> PvP enabled
98 </label>
99 <label>
100 MOTD
101 <input type="text" name="motd" value="A Minecraft Server" maxlength="59">
102 </label>
103 </fieldset>
104
105 <button type="submit" class="btn-ok">Create Instance</button>
106</form>
107
108<script>
109function toggleWorldSource() {
110 var genRadio = document.querySelector('input[value="generate"]');
111 document.getElementById('gen-options').style.display = genRadio.checked ? '' : 'none';
112 document.getElementById('upload-options').style.display = genRadio.checked ? 'none' : '';
113}
114</script>
115{% endblock %}