|
96 | 96 | </div> |
97 | 97 | <div class="well"> |
98 | 98 | <div class="row"> |
99 | | - <div class="form-group col-md-3 col-xs-6"> |
| 99 | + <div class="form-group col-md-4 col-xs-4"> |
100 | 100 | <label for="memory" class="control-label">Memory</label> |
101 | 101 | <div class="input-group"> |
102 | 102 | <input type="text" name="memory" class="form-control" value="{{ old('memory') }}"/> |
103 | 103 | <span class="input-group-addon">MB</span> |
104 | 104 | </div> |
105 | 105 | </div> |
106 | | - <div class="form-group col-md-3 col-xs-6"> |
| 106 | + <div class="form-group col-md-4 col-xs-4"> |
| 107 | + <label for="memory" class="control-label">Swap</label> |
| 108 | + <div class="input-group"> |
| 109 | + <input type="text" name="swap" class="form-control" value="{{ old('swap', 0) }}"/> |
| 110 | + <span class="input-group-addon">MB</span> |
| 111 | + </div> |
| 112 | + </div> |
| 113 | + <div class="form-group col-md-4 col-xs-4"> |
| 114 | + <label for="memory" class="control-label">OOM Killer</label> |
| 115 | + <div> |
| 116 | + <span class="input-group-addon" style="height:36px;"> |
| 117 | + <input type="checkbox" name="oom_disabled"/> |
| 118 | + </span> |
| 119 | + <span class="input-group-addon" style="height:36px;"> |
| 120 | + Disable OOM Killer |
| 121 | + </span> |
| 122 | + </div> |
| 123 | + </div> |
| 124 | + </div> |
| 125 | + <div class="row"> |
| 126 | + <div class="col-md-12"> |
| 127 | + <p class="text-muted"><small>If you do not want to assign swap space to a server simply put <code>0</code> for the value. We suggest leaving OOM Killer enabled unless you know what you are doing, disabling it could cause your server to hang unexpectedly.</small><p> |
| 128 | + </div> |
| 129 | + </div> |
| 130 | + <div class="row"> |
| 131 | + <div class="form-group col-md-4 col-xs-4"> |
107 | 132 | <label for="disk" class="control-label">Disk Space</label> |
108 | 133 | <div class="input-group"> |
109 | 134 | <input type="text" name="disk" class="form-control" value="{{ old('disk') }}"/> |
110 | 135 | <span class="input-group-addon">MB</span> |
111 | 136 | </div> |
112 | 137 | </div> |
113 | | - <div class="form-group col-md-3 col-xs-6"> |
| 138 | + <div class="form-group col-md-4 col-xs-4"> |
114 | 139 | <label for="cpu" class="control-label">CPU Limit</label> |
115 | 140 | <div class="input-group"> |
116 | | - <input type="text" name="cpu" value="0" class="form-control" value="{{ old('cpu') }}"/> |
| 141 | + <input type="text" name="cpu" class="form-control" value="{{ old('cpu', 0) }}"/> |
117 | 142 | <span class="input-group-addon">%</span> |
118 | 143 | </div> |
119 | 144 | </div> |
120 | | - <div class="form-group col-md-3 col-xs-6"> |
| 145 | + <div class="form-group col-md-4 col-xs-4"> |
121 | 146 | <label for="io" class="control-label">Block I/O</label> |
122 | 147 | <div class="input-group"> |
123 | | - <input type="text" name="io" value="500" class="form-control" value="{{ old('io') }}"/> |
| 148 | + <input type="text" name="io" class="form-control" value="{{ old('io', 500) }}"/> |
124 | 149 | <span class="input-group-addon">I/O</span> |
125 | 150 | </div> |
126 | 151 | </div> |
|
167 | 192 | <label for="use_custom_image" class="control-label">Use Custom Docker Image</label> |
168 | 193 | <div class="input-group"> |
169 | 194 | <span class="input-group-addon"> |
170 | | - <input @if(old('name') === 'use_custom_image')checked="checked"@endif type="checkbox" name="use_custom_image"/> |
| 195 | + <input @if(old('use_custom_image') === 'use_custom_image')checked="checked"@endif type="checkbox" name="use_custom_image"/> |
171 | 196 | </span> |
172 | 197 | <input type="text" class="form-control" name="custom_image_name" value="{{ old('custom_image_name') }}" disabled /> |
173 | 198 | </div> |
|
177 | 202 | </div> |
178 | 203 | </div> |
179 | 204 | </div> |
180 | | - <div class="well"> |
| 205 | + <div class="well" id="serviceOptions" style="display:none;"> |
181 | 206 | <div class="row"> |
182 | | - <div class="col-md-12"> |
183 | | - <h3 class="nopad">Service Environment Variables</h3> |
| 207 | + <div class="form-group col-md-12"> |
| 208 | + <h3 class="nopad">Service Setup & Options</h3> |
184 | 209 | <hr /> |
| 210 | + <label for="startup" class="control-label">Startup Command</label> |
| 211 | + <div class="input-group"> |
| 212 | + <span class="input-group-addon" id="startupExec"></span> |
| 213 | + <input type="text" class="form-control" name="startup" value="{{ old('startup') }}" /> |
| 214 | + </div> |
| 215 | + </div> |
| 216 | + </div> |
| 217 | + <div class="row"> |
| 218 | + <div class="col-md-12"> |
185 | 219 | <div class="alert alert-info">Some service options have additional environment variables that you can define for a given instance. They will show up below when you select a service option. If none show up, chances are that none were defined, and there is nothing to worry about.</div> |
186 | 220 | <span id="serverVariables"></span> |
187 | 221 | </div> |
|
313 | 347 |
|
314 | 348 | currentService = $('#getService').val(); |
315 | 349 | handleLoader('#load_services', true); |
| 350 | + $('#serviceOptions').slideUp(); |
| 351 | + $('#getOption').html('<option disabled selected> -- Select a Service Option</option>'); |
316 | 352 |
|
317 | 353 | $.ajax({ |
318 | 354 | method: 'POST', |
|
324 | 360 | service: $('#getService').val() |
325 | 361 | } |
326 | 362 | }).done(function (data) { |
327 | | - $.each(data, function (i, option) { |
| 363 | + $('#startupExec').html(data.exec); |
| 364 | + $('input[name="startup"]').val(data.startup); |
| 365 | + $.each(data.options, function (i, option) { |
328 | 366 | $('#getOption').append('<option value="' + option.id + '" data-image="' + option.docker_image + '">' + option.name + '</option>'); |
329 | 367 | }); |
330 | 368 | $('#getOption').parent().parent().removeClass('hidden'); |
|
341 | 379 | $('#getOption').on('change', function (event) { |
342 | 380 |
|
343 | 381 | handleLoader('#load_services', true); |
| 382 | + handleLoader('#serviceOptions', true); |
344 | 383 | $('#serverVariables').html(''); |
345 | 384 | $('input[name="custom_image_name"]').val($(this).find(':selected').data('image')); |
346 | 385 |
|
|
363 | 402 | <input type="text" autocomplete="off" name="env_' + item.env_variable + '" class="form-control" value="' + item.default_value + '" />\ |
364 | 403 | <p class="text-muted"><small>' + item.description + '</small></p>\ |
365 | 404 | <p class="text-muted"><small>Regex Requirements for Input: <code>' + item.regex + '</code></small></p>\ |
| 405 | + <p class="text-muted"><small>Access in Startup: <code>${' + item.env_variable + '}</code></small></p>\ |
366 | 406 | </div>\ |
367 | 407 | </div>\ |
368 | 408 | '; |
369 | 409 | $('#serverVariables').append(dataAppend); |
370 | 410 | }); |
| 411 | + $('#serviceOptions').slideDown(); |
371 | 412 | }).fail(function (jqXHR) { |
372 | 413 | console.error(jqXHR); |
373 | 414 | }).always(function () { |
374 | 415 | handleLoader('#load_services'); |
| 416 | + handleLoader('#serviceOptions'); |
375 | 417 | }); |
376 | 418 |
|
377 | 419 | }); |
|
0 commit comments