1
+ <main class="w-full flex-grow p-6">
2
+ <div class="py-3">
3
+ <main class="h-full overflow-y-auto">
4
+ <div class="container mx-auto grid">
5
+ <div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4">
6
+ <!-- Tasks start -->
7
+ <?php
8
+ $ tasks = \webinterface \main::buildDefaultRequest ("task " , "GET " );
9
+ foreach ($ tasks ['tasks ' ] as $ task ) { ?>
10
+ <div class="min-w-0 p-4 dark:bg-gray-800 bg-white rounded-lg shadow-lg">
11
+ <h4 class="mb-4 font-semibold text-blue-500"><?= $ task ['name ' ] ?> </h4>
12
+ <div class="flex">
13
+ <span class="text-gray-400">•</span>
14
+ <p class="flex-1 dark:text-white text-gray-900 items-center pl-2">
15
+ Memory: <?= $ task ['processConfiguration ' ]['maxHeapMemorySize ' ] ?> MB<br></p>
16
+ </div>
17
+ <div class="flex">
18
+ <span class="text-gray-400">•</span>
19
+ <p class="flex-1 dark:text-white text-gray-900 items-center pl-2">Nodes:
20
+ <?php
21
+ if (count ($ task ['associatedNodes ' ]) == 0 ) {
22
+ echo "all " ;
23
+ } else {
24
+ $ nodes = "" ;
25
+ foreach ($ task ['associatedNodes ' ] as $ node ) {
26
+ $ nodes .= $ node . ", " ;
27
+ }
28
+ echo substr ($ nodes , 0 , -2 );
29
+ }
30
+ ?>
31
+ <br></p>
32
+ </div>
33
+ <div class="flex">
34
+ <span class="text-gray-400">•</span>
35
+ <p class="flex-1 dark:text-white text-gray-900 items-center pl-2">
36
+ AutoDeleteOnStop: <?= $ task ['autoDeleteOnStop ' ] ? "true " : "false " ; ?> <br></p>
37
+ </div>
38
+ <div class="flex">
39
+ <span class="text-gray-400">•</span>
40
+ <p class="flex-1 dark:text-white text-gray-900 items-center pl-2">
41
+ Static: <?= $ task ['staticServices ' ] ? "true " : "false " ; ?> <br></p>
42
+ </div>
43
+ <div class="flex">
44
+ <span class="text-gray-400">•</span>
45
+ <p class="flex-1 dark:text-white text-gray-900 items-center pl-2">
46
+ StartPort: <?= $ task ['startPort ' ]; ?> <br></p>
47
+ </div>
48
+ <div class="flex">
49
+ <span class="text-gray-400">•</span>
50
+ <p class="flex-1 dark:text-white text-gray-900 items-center pl-2">Groups:
51
+ <?php
52
+ if (count ($ task ['groups ' ]) == 0 ) {
53
+ echo "- " ;
54
+ } else {
55
+ $ groups = "" ;
56
+ foreach ($ task ['groups ' ] as $ group ) {
57
+ $ groups .= $ group . ", " ;
58
+ }
59
+ echo substr ($ groups , 0 , -2 );
60
+ }
61
+ ?>
62
+ <br></p>
63
+ </div>
64
+ <div class="flex">
65
+ <span class="text-gray-400">•</span>
66
+ <p class="flex-1 dark:text-white text-gray-900 items-center pl-2">
67
+ Environment: <?= $ task ['processConfiguration ' ]['environment ' ] ?> <br></p>
68
+ </div>
69
+ <div class="flex justify-center mt-4 space-x-3 text-sm text-white">
70
+ <div class="flex items-center">
71
+ <a href="/tasks/<?= $ task ['name ' ]; ?> "
72
+ class="h-10 bg-blue-500 text-white rounded-md px-4 py-2 m-2 hover:bg-blue-600 focus:outline-none focus:shadow-outline">Show</a>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ <?php } ?>
77
+ <!-- Tasks end -->
78
+ </div>
79
+ </div>
80
+ </main>
81
+ </div>
82
+ <div class="py-3">
83
+ <main class="h-full overflow-y-auto">
84
+ <div class="container mx-auto grid">
85
+ <div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-1">
86
+ <!-- Create Task -->
87
+ <div class="w-full">
88
+ <form method="post">
89
+ <div class="coding inverse-toggle px-5 pt-4 shadow-lg text-gray-100 dark:bg-gray-800 bg-white pb-6 pt-4 rounded-lg leading-normal overflow-hidden">
90
+ <div class="top mb-2 flex">
91
+ <h4 class="mb-2 font-semibold dark:text-white text-gray-900">Create Task</h4>
92
+ </div>
93
+ <div class="flex-1 flex flex-col md:flex-row text-sm font-mono subpixel-antialiased">
94
+ <div class="w-full flex-1 mx-2">
95
+ <input placeholder="Name"
96
+ name="name"
97
+ type="text"
98
+ class="my-2 p-2 dark:bg-gray-900 bg-gray-100 flex border dark:border-gray-900 border-gray-100 rounded px-2 appearance-none outline-none w-full dark:text-white text-gray-900 focus:ring-2 focus:ring-blue-600"
99
+ required
100
+ >
101
+ </div>
102
+ <div class="w-full flex-1 mx-2">
103
+ <input placeholder="Ram"
104
+ name="ram"
105
+ type="number"
106
+ min="0"
107
+ value="512"
108
+ class="my-2 p-2 dark:bg-gray-900 bg-gray-100 flex border dark:border-gray-900 border-gray-100 rounded px-2 appearance-none outline-none w-full dark:text-white text-gray-900 focus:ring-2 focus:ring-blue-600"
109
+ required
110
+ >
111
+ </div>
112
+ <div class="w-full flex-1 mx-2">
113
+ <select
114
+ name="environment"
115
+ id="environment-state"
116
+ class="my-2 p-2 dark:bg-gray-900 bg-gray-100 flex border dark:border-gray-900 border-gray-100 rounded px-2 appearance-none outline-none w-full dark:text-white text-gray-900 focus:ring-2 focus:ring-blue-600"
117
+ required
118
+ >
119
+ <option value="" class="text-sm font-mono subpixel-antialiased">
120
+ Select Environment
121
+ </option>
122
+ <option value="minecraft_server"
123
+ class="text-sm font-mono subpixel-antialiased">
124
+ Minecraft Server
125
+ </option>
126
+ <option value="glowstone" class="text-sm font-mono subpixel-antialiased">
127
+ Glowstone
128
+ </option>
129
+ <option value="nukkit" class="text-sm font-mono subpixel-antialiased">
130
+ Nukkit
131
+ </option>
132
+ <option value="go_mint" class="text-sm font-mono subpixel-antialiased">
133
+ Go Mint
134
+ </option>
135
+ <option value="bungeecord" class="text-sm font-mono subpixel-antialiased">
136
+ Bungeecord
137
+ </option>
138
+ <option value="velocity" class="text-sm font-mono subpixel-antialiased">
139
+ Velocity
140
+ </option>
141
+ <option value="waterdog_pe" class="text-sm font-mono subpixel-antialiased">
142
+ Waterdog PE
143
+ </option>
144
+ </select>
145
+ </div>
146
+ <div class="w-full flex-1 mx-2">
147
+ <select
148
+ name="node"
149
+ id="node-state"
150
+ class="my-2 p-2 dark:bg-gray-900 bg-gray-100 flex border dark:border-gray-900 border-gray-100 rounded px-2 appearance-none outline-none w-full dark:text-white text-gray-900 focus:ring-2 focus:ring-blue-600"
151
+ required
152
+ >
153
+ <option value="" class="text-sm font-mono subpixel-antialiased">
154
+ Select Node
155
+ </option>
156
+ <option value="all" class="text-sm font-mono subpixel-antialiased">
157
+ All Nodes
158
+ </option>
159
+ <?php
160
+ $ nodes = \webinterface \main::buildDefaultRequest ("cluster " , "GET " );
161
+ foreach ($ nodes ['nodes ' ] as $ node ) { ?>
162
+ <option class="text-sm font-mono subpixel-antialiased"><?= $ node ['node ' ]['uniqueId ' ]; ?> </option>
163
+ <?php } ?>
164
+ </select>
165
+ </div>
166
+ <div class="w-full flex-1 mx-2">
167
+ <input placeholder="Port"
168
+ name="port"
169
+ type="number"
170
+ min="0"
171
+ max="65535"
172
+ value="25565"
173
+ class="my-2 p-2 dark:bg-gray-900 bg-gray-100 flex border dark:border-gray-900 border-gray-100 rounded px-2 appearance-none outline-none w-full dark:text-white text-gray-900 focus:ring-2 focus:ring-blue-600"
174
+ required
175
+ >
176
+ </div>
177
+ <div class="w-full flex-1 mx-2">
178
+ <label class="inline-flex items-center mt-3">
179
+ <input type="checkbox" name="static" class="form-checkbox h-5 w-5"><span
180
+ class="ml-2 dark:text-white text-gray-900">Static</span>
181
+ </label>
182
+ <label class="inline-flex items-center mt-3">
183
+ <input type="checkbox" name="auto_delete_on_stop"
184
+ class="form-checkbox h-5 w-5" checked><span
185
+ class="ml-2 dark:text-white text-gray-900">AutoDeleteOnStop</span>
186
+ </label>
187
+ <label class="inline-flex items-center mt-3">
188
+ <input type="checkbox" name="maintenance" class="form-checkbox h-5 w-5"
189
+ checked><span
190
+ class="ml-2 dark:text-white text-gray-900">Maintenance</span>
191
+ </label>
192
+ </div>
193
+ </div>
194
+ <button type="submit"
195
+ class="h-10 bg-blue-500 text-white rounded-md px-4 py-2 m-2 hover:bg-blue-600 focus:outline-none focus:shadow-outline">
196
+ Create
197
+ </button>
198
+ </div>
199
+ </form>
200
+ </div>
201
+ </div>
202
+ </div>
203
+ </main>
204
+ </div>
205
+ </main>
0 commit comments