Path: blob/1.0-develop/resources/views/admin/servers/new.blade.php
7460 views
@extends('layouts.admin')12@section('title')3New Server4@endsection56@section('content-header')7<h1>Create Server<small>Add a new server to the panel.</small></h1>8<ol class="breadcrumb">9<li><a href="{{ route('admin.index') }}">Admin</a></li>10<li><a href="{{ route('admin.servers') }}">Servers</a></li>11<li class="active">Create Server</li>12</ol>13@endsection1415@section('content')16<form action="{{ route('admin.servers.new') }}" method="POST">17<div class="row">18<div class="col-xs-12">19<div class="box">20<div class="box-header with-border">21<h3 class="box-title">Core Details</h3>22</div>2324<div class="box-body row">25<div class="col-md-6">26<div class="form-group">27<label for="pName">Server Name</label>28<input type="text" class="form-control" id="pName" name="name" value="{{ old('name') }}" placeholder="Server Name">29<p class="small text-muted no-margin">Character limits: <code>a-z A-Z 0-9 _ - .</code> and <code>[Space]</code>.</p>30</div>3132<div class="form-group">33<label for="pUserId">Server Owner</label>34<select id="pUserId" name="owner_id" class="form-control" style="padding-left:0;"></select>35<p class="small text-muted no-margin">Email address of the Server Owner.</p>36</div>37</div>3839<div class="col-md-6">40<div class="form-group">41<label for="pDescription" class="control-label">Server Description</label>42<textarea id="pDescription" name="description" rows="3" class="form-control">{{ old('description') }}</textarea>43<p class="text-muted small">A brief description of this server.</p>44</div>4546<div class="form-group">47<div class="checkbox checkbox-primary no-margin-bottom">48<input id="pStartOnCreation" name="start_on_completion" type="checkbox" {{ \Pterodactyl\Helpers\Utilities::checked('start_on_completion', 1) }} />49<label for="pStartOnCreation" class="strong">Start Server when Installed</label>50</div>51</div>52</div>53</div>54</div>55</div>56</div>5758<div class="row">59<div class="col-xs-12">60<div class="box">61<div class="overlay" id="allocationLoader" style="display:none;"><i class="fa fa-refresh fa-spin"></i></div>62<div class="box-header with-border">63<h3 class="box-title">Allocation Management</h3>64</div>6566<div class="box-body row">67<div class="form-group col-sm-4">68<label for="pNodeId">Node</label>69<select name="node_id" id="pNodeId" class="form-control">70@foreach($locations as $location)71<optgroup label="{{ $location->long }} ({{ $location->short }})">72@foreach($location->nodes as $node)7374<option value="{{ $node->id }}"75@if($location->id === old('location_id')) selected @endif76>{{ $node->name }}</option>7778@endforeach79</optgroup>80@endforeach81</select>8283<p class="small text-muted no-margin">The node which this server will be deployed to.</p>84</div>8586<div class="form-group col-sm-4">87<label for="pAllocation">Default Allocation</label>88<select id="pAllocation" name="allocation_id" class="form-control"></select>89<p class="small text-muted no-margin">The main allocation that will be assigned to this server.</p>90</div>9192<div class="form-group col-sm-4">93<label for="pAllocationAdditional">Additional Allocation(s)</label>94<select id="pAllocationAdditional" name="allocation_additional[]" class="form-control" multiple></select>95<p class="small text-muted no-margin">Additional allocations to assign to this server on creation.</p>96</div>97</div>98</div>99</div>100</div>101102<div class="row">103<div class="col-xs-12">104<div class="box">105<div class="overlay" id="allocationLoader" style="display:none;"><i class="fa fa-refresh fa-spin"></i></div>106<div class="box-header with-border">107<h3 class="box-title">Application Feature Limits</h3>108</div>109110<div class="box-body row">111<div class="form-group col-xs-6">112<label for="pDatabaseLimit" class="control-label">Database Limit</label>113<div>114<input type="text" id="pDatabaseLimit" name="database_limit" class="form-control" value="{{ old('database_limit', 0) }}"/>115</div>116<p class="text-muted small">The total number of databases a user is allowed to create for this server.</p>117</div>118<div class="form-group col-xs-6">119<label for="pAllocationLimit" class="control-label">Allocation Limit</label>120<div>121<input type="text" id="pAllocationLimit" name="allocation_limit" class="form-control" value="{{ old('allocation_limit', 0) }}"/>122</div>123<p class="text-muted small">The total number of allocations a user is allowed to create for this server.</p>124</div>125<div class="form-group col-xs-6">126<label for="pBackupLimit" class="control-label">Backup Limit</label>127<div>128<input type="text" id="pBackupLimit" name="backup_limit" class="form-control" value="{{ old('backup_limit', 0) }}"/>129</div>130<p class="text-muted small">The total number of backups that can be created for this server.</p>131</div>132</div>133</div>134</div>135</div>136<div class="row">137<div class="col-xs-12">138<div class="box">139<div class="box-header with-border">140<h3 class="box-title">Resource Management</h3>141</div>142143<div class="box-body row">144<div class="form-group col-xs-6">145<label for="pCPU">CPU Limit</label>146147<div class="input-group">148<input type="text" id="pCPU" name="cpu" class="form-control" value="{{ old('cpu', 0) }}" />149<span class="input-group-addon">%</span>150</div>151152<p class="text-muted small">If you do not want to limit CPU usage, set the value to <code>0</code>. To determine a value, take the number of threads and multiply it by 100. For example, on a quad core system without hyperthreading <code>(4 * 100 = 400)</code> there is <code>400%</code> available. To limit a server to using half of a single thread, you would set the value to <code>50</code>. To allow a server to use up to two threads, set the value to <code>200</code>.<p>153</div>154155<div class="form-group col-xs-6">156<label for="pThreads">CPU Pinning</label>157158<div>159<input type="text" id="pThreads" name="threads" class="form-control" value="{{ old('threads') }}" />160</div>161162<p class="text-muted small"><strong>Advanced:</strong> Enter the specific CPU threads that this process can run on, or leave blank to allow all threads. This can be a single number, or a comma separated list. Example: <code>0</code>, <code>0-1,3</code>, or <code>0,1,3,4</code>.</p>163</div>164</div>165166<div class="box-body row">167<div class="form-group col-xs-6">168<label for="pMemory">Memory</label>169170<div class="input-group">171<input type="text" id="pMemory" name="memory" class="form-control" value="{{ old('memory') }}" />172<span class="input-group-addon">MiB</span>173</div>174175<p class="text-muted small">The maximum amount of memory allowed for this container. Setting this to <code>0</code> will allow unlimited memory in a container.</p>176</div>177178<div class="form-group col-xs-6">179<label for="pSwap">Swap</label>180181<div class="input-group">182<input type="text" id="pSwap" name="swap" class="form-control" value="{{ old('swap', 0) }}" />183<span class="input-group-addon">MiB</span>184</div>185186<p class="text-muted small">Setting this to <code>0</code> will disable swap space on this server. Setting to <code>-1</code> will allow unlimited swap.</p>187</div>188</div>189190<div class="box-body row">191<div class="form-group col-xs-6">192<label for="pDisk">Disk Space</label>193194<div class="input-group">195<input type="text" id="pDisk" name="disk" class="form-control" value="{{ old('disk') }}" />196<span class="input-group-addon">MiB</span>197</div>198199<p class="text-muted small">This server will not be allowed to boot if it is using more than this amount of space. If a server goes over this limit while running it will be safely stopped and locked until enough space is available. Set to <code>0</code> to allow unlimited disk usage.</p>200</div>201202<div class="form-group col-xs-6">203<label for="pIO">Block IO Weight</label>204205<div>206<input type="text" id="pIO" name="io" class="form-control" value="{{ old('io', 500) }}" />207</div>208209<p class="text-muted small"><strong>Advanced</strong>: The IO performance of this server relative to other <em>running</em> containers on the system. Value should be between <code>10</code> and <code>1000</code>. Please see <a href="https://docs.docker.com/engine/reference/run/#block-io-bandwidth-blkio-constraint" target="_blank">this documentation</a> for more information about it.</p>210</div>211<div class="form-group col-xs-12">212<div class="checkbox checkbox-primary no-margin-bottom">213<input type="checkbox" id="pOomDisabled" name="oom_disabled" value="0" {{ \Pterodactyl\Helpers\Utilities::checked('oom_disabled', 0) }} />214<label for="pOomDisabled" class="strong">Enable OOM Killer</label>215</div>216217<p class="small text-muted no-margin">Terminates the server if it breaches the memory limits. Enabling OOM killer may cause server processes to exit unexpectedly.</p>218</div>219</div>220</div>221</div>222</div>223224<div class="row">225<div class="col-md-6">226<div class="box">227<div class="box-header with-border">228<h3 class="box-title">Nest Configuration</h3>229</div>230231<div class="box-body row">232<div class="form-group col-xs-12">233<label for="pNestId">Nest</label>234235<select id="pNestId" name="nest_id" class="form-control">236@foreach($nests as $nest)237<option value="{{ $nest->id }}"238@if($nest->id === old('nest_id'))239selected="selected"240@endif241>{{ $nest->name }}</option>242@endforeach243</select>244245<p class="small text-muted no-margin">Select the Nest that this server will be grouped under.</p>246</div>247248<div class="form-group col-xs-12">249<label for="pEggId">Egg</label>250<select id="pEggId" name="egg_id" class="form-control"></select>251<p class="small text-muted no-margin">Select the Egg that will define how this server should operate.</p>252</div>253<div class="form-group col-xs-12">254<div class="checkbox checkbox-primary no-margin-bottom">255<input type="checkbox" id="pSkipScripting" name="skip_scripts" value="1" {{ \Pterodactyl\Helpers\Utilities::checked('skip_scripts', 0) }} />256<label for="pSkipScripting" class="strong">Skip Egg Install Script</label>257</div>258259<p class="small text-muted no-margin">If the selected Egg has an install script attached to it, the script will run during the install. If you would like to skip this step, check this box.</p>260</div>261</div>262</div>263</div>264265<div class="col-md-6">266<div class="box">267<div class="box-header with-border">268<h3 class="box-title">Docker Configuration</h3>269</div>270271<div class="box-body row">272<div class="form-group col-xs-12">273<label for="pDefaultContainer">Docker Image</label>274<select id="pDefaultContainer" name="image" class="form-control"></select>275<input id="pDefaultContainerCustom" name="custom_image" value="{{ old('custom_image') }}" class="form-control" placeholder="Or enter a custom image..." style="margin-top:1rem"/>276<p class="small text-muted no-margin">This is the default Docker image that will be used to run this server. Select an image from the dropdown above, or enter a custom image in the text field above.</p>277</div>278</div>279</div>280</div>281</div>282283<div class="row">284<div class="col-md-12">285<div class="box">286<div class="box-header with-border">287<h3 class="box-title">Startup Configuration</h3>288</div>289290<div class="box-body row">291<div class="form-group col-xs-12">292<label for="pStartup">Startup Command</label>293<input type="text" id="pStartup" name="startup" value="{{ old('startup') }}" class="form-control" />294<p class="small text-muted no-margin">The following data substitutes are available for the startup command: <code>@{{SERVER_MEMORY}}</code>, <code>@{{SERVER_IP}}</code>, and <code>@{{SERVER_PORT}}</code>. They will be replaced with the allocated memory, server IP, and server port respectively.</p>295</div>296</div>297298<div class="box-header with-border" style="margin-top:-10px;">299<h3 class="box-title">Service Variables</h3>300</div>301302<div class="box-body row" id="appendVariablesTo"></div>303304<div class="box-footer">305{!! csrf_field() !!}306<input type="submit" class="btn btn-success pull-right" value="Create Server" />307</div>308</div>309</div>310</div>311</form>312@endsection313314@section('footer-scripts')315@parent316{!! Theme::js('vendor/lodash/lodash.js') !!}317318<script type="application/javascript">319// Persist 'Service Variables'320function serviceVariablesUpdated(eggId, ids) {321@if (old('egg_id'))322// Check if the egg id matches.323if (eggId != '{{ old('egg_id') }}') {324return;325}326327@if (old('environment'))328@foreach (old('environment') as $key => $value)329$('#' + ids['{{ $key }}']).val('{{ $value }}');330@endforeach331@endif332@endif333@if(old('image'))334$('#pDefaultContainer').val('{{ old('image') }}');335@endif336}337// END Persist 'Service Variables'338</script>339340{!! Theme::js('js/admin/new-server.js?v=20220530') !!}341342<script type="application/javascript">343$(document).ready(function() {344// Persist 'Server Owner' select2345@if (old('owner_id'))346$.ajax({347url: '/admin/users/accounts.json?user_id={{ old('owner_id') }}',348dataType: 'json',349}).then(function (data) {350initUserIdSelect([ data ]);351});352@else353initUserIdSelect();354@endif355// END Persist 'Server Owner' select2356357// Persist 'Node' select2358@if (old('node_id'))359$('#pNodeId').val('{{ old('node_id') }}').change();360361// Persist 'Default Allocation' select2362@if (old('allocation_id'))363$('#pAllocation').val('{{ old('allocation_id') }}').change();364@endif365// END Persist 'Default Allocation' select2366367// Persist 'Additional Allocations' select2368@if (old('allocation_additional'))369const additional_allocations = [];370371@for ($i = 0; $i < count(old('allocation_additional')); $i++)372additional_allocations.push('{{ old('allocation_additional.'.$i)}}');373@endfor374375$('#pAllocationAdditional').val(additional_allocations).change();376@endif377// END Persist 'Additional Allocations' select2378@endif379// END Persist 'Node' select2380381// Persist 'Nest' select2382@if (old('nest_id'))383$('#pNestId').val('{{ old('nest_id') }}').change();384385// Persist 'Egg' select2386@if (old('egg_id'))387$('#pEggId').val('{{ old('egg_id') }}').change();388@endif389// END Persist 'Egg' select2390@endif391// END Persist 'Nest' select2392});393</script>394@endsection395396397