2017-09-26 02:43:01 +00:00
{{ -- Pterodactyl - Panel -- }}
2017-02-19 00:31:44 +00:00
{{ -- Copyright ( c ) 2015 - 2017 Dane Everitt < dane @ daneeveritt . com > -- }}
2017-09-26 02:43:01 +00:00
{{ -- This software is licensed under the terms of the MIT license . -- }}
{{ -- https :// opensource . org / licenses / MIT -- }}
2017-02-19 00:31:44 +00:00
@ extends ( 'layouts.admin' )
@ section ( 'title' )
New Server
@ endsection
@ section ( 'content-header' )
< h1 > Create Server < small > Add a new server to the panel .</ small ></ h1 >
< ol class = " breadcrumb " >
< li >< a href = " { { route('admin.index') }} " > Admin </ a ></ li >
< li >< a href = " { { route('admin.servers') }} " > Servers </ a ></ li >
< li class = " active " > Create Server </ li >
</ ol >
@ endsection
@ section ( 'content' )
< form action = " { { route('admin.servers.new') }} " method = " POST " >
< div class = " row " >
< div class = " col-xs-12 " >
2017-02-24 03:52:05 +00:00
< div class = " box " >
2017-02-19 00:31:44 +00:00
< div class = " box-header with-border " >
< h3 class = " box-title " > Core Details </ h3 >
</ div >
2020-04-11 19:56:03 +00:00
2017-02-19 00:31:44 +00:00
< div class = " box-body row " >
2017-04-01 03:07:19 +00:00
< div class = " col-md-6 " >
< div class = " form-group " >
< label for = " pName " > Server Name </ label >
< input type = " text " class = " form-control " id = " pName " name = " name " value = " { { old('name') }} " placeholder = " Server Name " >
2020-09-23 02:37:41 +00:00
< p class = " small text-muted no-margin " > Character limits : < code > a - z A - Z 0 - 9 _ - .</ code > and < code > [ Space ] </ code >.</ p >
2017-04-01 03:07:19 +00:00
</ div >
2020-04-11 19:56:03 +00:00
2017-04-01 03:07:19 +00:00
< div class = " form-group " >
< label for = " pUserId " > Server Owner </ label >
2020-04-11 19:56:03 +00:00
< select id = " pUserId " name = " owner_id " class = " form-control " style = " padding-left:0; " ></ select >
2017-04-01 03:07:19 +00:00
</ div >
2017-02-19 00:31:44 +00:00
</ div >
2020-04-11 19:56:03 +00:00
2017-04-01 16:29:49 +00:00
< div class = " col-md-6 " >
< div class = " form-group " >
2020-04-11 19:56:03 +00:00
< label for = " pDescription " class = " control-label " > Server Description </ label >
< textarea id = " pDescription " name = " description " rows = " 3 " class = " form-control " > {{ old ( 'description' ) }} </ textarea >
2017-04-01 16:29:49 +00:00
< p class = " text-muted small " > A brief description of this server .</ p >
</ div >
2020-04-11 19:56:03 +00:00
2017-04-01 16:29:49 +00:00
< div class = " form-group " >
< div class = " checkbox checkbox-primary no-margin-bottom " >
2020-04-11 19:56:03 +00:00
< input id = " pStartOnCreation " name = " start_on_completion " type = " checkbox " {{ \Pterodactyl\Helpers\Utilities :: checked ( 'start_on_completion' , 1 ) }} />
2017-04-01 16:29:49 +00:00
< label for = " pStartOnCreation " class = " strong " > Start Server when Installed </ label >
</ div >
</ div >
2017-02-19 00:31:44 +00:00
</ div >
</ div >
</ div >
</ div >
</ div >
2020-04-11 19:56:03 +00:00
2017-02-19 00:31:44 +00:00
< div class = " row " >
< div class = " col-xs-12 " >
< div class = " box " >
< div class = " overlay " id = " allocationLoader " style = " display:none; " >< i class = " fa fa-refresh fa-spin " ></ i ></ div >
< div class = " box-header with-border " >
< h3 class = " box-title " > Allocation Management </ h3 >
</ div >
2020-04-11 19:56:03 +00:00
2017-02-19 00:31:44 +00:00
< div class = " box-body row " >
2017-02-24 03:52:05 +00:00
< div class = " form-group col-sm-4 " >
2017-09-21 23:03:29 +00:00
< label for = " pNodeId " > Node </ label >
< select name = " node_id " id = " pNodeId " class = " form-control " >
2017-02-19 00:31:44 +00:00
@ foreach ( $locations as $location )
2017-09-21 23:03:29 +00:00
< optgroup label = " { { $location->long }} ( { { $location->short }}) " >
@ foreach ( $location -> nodes as $node )
< option value = " { { $node->id }} "
@ if ( $location -> id === old ( 'location_id' )) selected @ endif
> {{ $node -> name }} </ option >
@ endforeach
</ optgroup >
2017-02-19 00:31:44 +00:00
@ endforeach
</ select >
2020-04-11 19:56:03 +00:00
2017-02-19 00:31:44 +00:00
< p class = " small text-muted no-margin " > The node which this server will be deployed to .</ p >
</ div >
2020-04-11 19:56:03 +00:00
2017-02-24 03:52:05 +00:00
< div class = " form-group col-sm-4 " >
< label for = " pAllocation " > Default Allocation </ label >
2020-04-11 19:56:03 +00:00
< select id = " pAllocation " name = " allocation_id " class = " form-control " ></ select >
2017-02-24 03:52:05 +00:00
< p class = " small text-muted no-margin " > The main allocation that will be assigned to this server .</ p >
2017-02-19 00:31:44 +00:00
</ div >
2020-04-11 19:56:03 +00:00
2017-09-21 23:03:29 +00:00
< div class = " form-group col-sm-4 " >
2017-02-24 03:52:05 +00:00
< label for = " pAllocationAdditional " > Additional Allocation ( s ) </ label >
2020-04-11 19:56:03 +00:00
< select id = " pAllocationAdditional " name = " allocation_additional[] " class = " form-control " multiple ></ select >
2017-02-24 03:52:05 +00:00
< p class = " small text-muted no-margin " > Additional allocations to assign to this server on creation .</ p >
2017-02-19 00:31:44 +00:00
</ div >
</ div >
</ div >
</ div >
</ div >
2020-04-11 19:56:03 +00:00
2018-03-03 05:11:30 +00:00
< div class = " row " >
< div class = " col-xs-12 " >
< div class = " box " >
< div class = " overlay " id = " allocationLoader " style = " display:none; " >< i class = " fa fa-refresh fa-spin " ></ i ></ div >
< div class = " box-header with-border " >
< h3 class = " box-title " > Application Feature Limits </ h3 >
</ div >
2020-04-11 19:56:03 +00:00
2018-03-03 05:11:30 +00:00
< div class = " box-body row " >
< div class = " form-group col-xs-6 " >
2020-04-11 19:56:03 +00:00
< label for = " pDatabaseLimit " class = " control-label " > Database Limit </ label >
2018-03-03 05:11:30 +00:00
< div >
2020-04-11 19:56:03 +00:00
< input type = " text " id = " pDatabaseLimit " name = " database_limit " class = " form-control " value = " { { old('database_limit', 0) }} " />
2018-03-03 05:11:30 +00:00
</ div >
2020-04-26 19:12:29 +00:00
< p class = " text-muted small " > The total number of databases a user is allowed to create for this server .</ p >
2018-03-03 05:11:30 +00:00
</ div >
< div class = " form-group col-xs-6 " >
2020-04-11 19:56:03 +00:00
< label for = " pAllocationLimit " class = " control-label " > Allocation Limit </ label >
2018-03-03 05:11:30 +00:00
< div >
2020-04-11 19:56:03 +00:00
< input type = " text " id = " pAllocationLimit " name = " allocation_limit " class = " form-control " value = " { { old('allocation_limit', 0) }} " />
2018-03-03 05:11:30 +00:00
</ div >
2020-04-26 19:12:29 +00:00
< p class = " text-muted small " > The total number of allocations a user is allowed to create for this server .</ p >
</ div >
< div class = " form-group col-xs-6 " >
< label for = " pBackupLimit " class = " control-label " > Backup Limit </ label >
< div >
< input type = " text " id = " pBackupLimit " name = " backup_limit " class = " form-control " value = " { { old('backup_limit', 0) }} " />
</ div >
< p class = " text-muted small " > The total number of backups that can be created for this server .</ p >
2018-03-03 05:11:30 +00:00
</ div >
</ div >
</ div >
</ div >
</ div >
2017-02-24 03:52:05 +00:00
< div class = " row " >
< div class = " col-xs-12 " >
< div class = " box " >
< div class = " box-header with-border " >
< h3 class = " box-title " > Resource Management </ h3 >
</ div >
2020-04-11 19:56:03 +00:00
2017-02-24 03:52:05 +00:00
< div class = " box-body row " >
2020-04-10 03:46:12 +00:00
< div class = " form-group col-xs-6 " >
< label for = " pCPU " > CPU Limit </ label >
2020-04-11 19:56:03 +00:00
2020-04-10 03:46:12 +00:00
< div class = " input-group " >
2020-04-11 19:56:03 +00:00
< input type = " text " id = " pCPU " name = " cpu " class = " form-control " value = " { { old('cpu', 0) }} " />
2020-04-10 03:46:12 +00:00
< span class = " input-group-addon " >%</ span >
</ div >
2020-04-11 19:56:03 +00:00
< 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 < em > physical </ em > cores and multiply it by 100. For example , on a quad core system < code > ( 4 * 100 = 400 ) </ code > there is < code > 400 %</ code > available . To limit a server to using half of a single core , you would set the value to < code > 50 </ code >. To allow a server to use up to two physical cores , set the value to < code > 200 </ code >. BlockIO should be a value 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 >
2020-04-10 03:46:12 +00:00
</ div >
2020-04-11 19:56:03 +00:00
2020-04-10 03:46:12 +00:00
< div class = " form-group col-xs-6 " >
2020-10-06 21:09:16 +00:00
< label for = " pThreads " > CPU Pinning </ label >
2020-04-11 19:56:03 +00:00
2020-04-10 03:46:12 +00:00
< div >
2020-04-11 19:56:03 +00:00
< input type = " text " id = " pThreads " name = " threads " class = " form-control " value = " { { old('threads') }} " />
2020-04-10 03:46:12 +00:00
</ div >
2020-04-11 19:56:03 +00:00
2020-04-10 03:46:12 +00:00
< p class = " text-muted small " >< strong > Advanced :</ strong > Enter the specific CPU cores that this process can run on , or leave blank to allow all cores . This can be a single number , or a comma seperated list . Example : < code > 0 </ code > , < code > 0 - 1 , 3 </ code > , or < code > 0 , 1 , 3 , 4 </ code >.</ p >
</ div >
</ div >
2020-04-11 19:56:03 +00:00
2020-04-10 03:46:12 +00:00
< div class = " box-body row " >
< div class = " form-group col-xs-6 " >
2017-02-24 03:52:05 +00:00
< label for = " pMemory " > Memory </ label >
2020-04-11 19:56:03 +00:00
2017-02-24 03:52:05 +00:00
< div class = " input-group " >
2020-04-11 19:56:03 +00:00
< input type = " text " id = " pMemory " name = " memory " class = " form-control " value = " { { old('memory') }} " />
2017-02-24 03:52:05 +00:00
< span class = " input-group-addon " > MB </ span >
</ div >
2020-06-24 03:24:09 +00:00
< 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 >
2017-02-24 03:52:05 +00:00
</ div >
2020-04-11 19:56:03 +00:00
2020-04-10 03:46:12 +00:00
< div class = " form-group col-xs-6 " >
2017-02-24 03:52:05 +00:00
< label for = " pSwap " > Swap </ label >
2020-04-11 19:56:03 +00:00
2017-02-24 03:52:05 +00:00
< div class = " input-group " >
2020-04-11 19:56:03 +00:00
< input type = " text " id = " pSwap " name = " swap " class = " form-control " value = " { { old('swap', 0) }} " />
2017-02-24 03:52:05 +00:00
< span class = " input-group-addon " > MB </ span >
</ div >
2020-06-24 03:24:09 +00:00
< 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 >
2017-02-24 03:52:05 +00:00
</ div >
</ div >
2020-04-11 19:56:03 +00:00
2017-02-24 03:52:05 +00:00
< div class = " box-body row " >
2020-04-10 03:46:12 +00:00
< div class = " form-group col-xs-6 " >
2017-02-24 03:52:05 +00:00
< label for = " pDisk " > Disk Space </ label >
< div class = " input-group " >
2020-04-11 19:56:03 +00:00
< input type = " text " id = " pDisk " name = " disk " class = " form-control " value = " { { old('disk') }} " />
< span class = " input-group-addon " > MB </ span >
2020-03-29 18:41:55 +00:00
</ div >
2020-06-24 03:24:09 +00:00
< 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 >
2017-02-24 03:52:05 +00:00
</ div >
2020-04-11 19:56:03 +00:00
2020-04-10 03:46:12 +00:00
< div class = " form-group col-xs-6 " >
2017-02-24 03:52:05 +00:00
< label for = " pIO " > Block IO Weight </ label >
2020-04-11 19:56:03 +00:00
2020-04-03 21:43:15 +00:00
< div >
2020-04-11 19:56:03 +00:00
< input type = " text " id = " pIO " name = " io " class = " form-control " value = " { { old('io', 500) }} " />
2017-02-24 03:52:05 +00:00
</ div >
2020-04-11 19:56:03 +00:00
< 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 >.</ p >
2017-02-24 03:52:05 +00:00
</ div >
</ div >
</ div >
</ div >
</ div >
2020-04-11 19:56:03 +00:00
2017-02-24 23:19:03 +00:00
< div class = " row " >
< div class = " col-md-6 " >
< div class = " box " >
< div class = " box-header with-border " >
2017-10-07 22:21:41 +00:00
< h3 class = " box-title " > Nest Configuration </ h3 >
2017-02-24 23:19:03 +00:00
</ div >
2020-04-11 19:56:03 +00:00
2017-02-24 23:19:03 +00:00
< div class = " box-body row " >
< div class = " form-group col-xs-12 " >
2017-10-07 22:21:41 +00:00
< label for = " pNestId " > Nest </ label >
2020-04-11 19:56:03 +00:00
< select id = " pNestId " name = " nest_id " class = " form-control " >
2017-10-07 22:21:41 +00:00
@ foreach ( $nests as $nest )
< option value = " { { $nest->id }} "
@ if ( $nest -> id === old ( 'nest_id' ))
2017-02-24 23:19:03 +00:00
selected = " selected "
@ endif
2017-10-07 22:21:41 +00:00
> {{ $nest -> name }} </ option >
2017-02-24 23:19:03 +00:00
@ endforeach
</ select >
2020-04-11 19:56:03 +00:00
2017-10-07 22:21:41 +00:00
< p class = " small text-muted no-margin " > Select the Nest that this server will be grouped under .</ p >
2017-02-24 23:19:03 +00:00
</ div >
2020-04-11 19:56:03 +00:00
2017-02-24 23:19:03 +00:00
< div class = " form-group col-xs-12 " >
2017-10-07 22:21:41 +00:00
< label for = " pEggId " > Egg </ label >
2020-04-11 19:56:03 +00:00
< select id = " pEggId " name = " egg_id " class = " form-control " ></ select >
2017-10-07 22:21:41 +00:00
< p class = " small text-muted no-margin " > Select the Egg that will define how this server should operate .</ p >
2017-02-24 23:19:03 +00:00
</ div >
2017-04-20 21:57:40 +00:00
< div class = " form-group col-xs-12 " >
< div class = " checkbox checkbox-primary no-margin-bottom " >
2020-05-08 03:46:49 +00:00
< input type = " checkbox " id = " pSkipScripting " name = " skip_scripts " value = " 1 " {{ \Pterodactyl\Helpers\Utilities :: checked ( 'skip_scripts' , 0 ) }} />
2017-10-07 22:21:41 +00:00
< label for = " pSkipScripting " class = " strong " > Skip Egg Install Script </ label >
2017-04-20 21:57:40 +00:00
</ div >
2020-04-11 19:56:03 +00:00
2020-09-13 18:13:37 +00:00
< 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 >
2017-04-20 21:57:40 +00:00
</ div >
2017-02-24 23:19:03 +00:00
</ div >
</ div >
</ div >
2020-04-11 19:56:03 +00:00
2017-02-24 23:19:03 +00:00
< div class = " col-md-6 " >
< div class = " box " >
< div class = " box-header with-border " >
< h3 class = " box-title " > Docker Configuration </ h3 >
</ div >
2020-04-11 19:56:03 +00:00
2017-02-24 23:19:03 +00:00
< div class = " box-body row " >
< div class = " form-group col-xs-12 " >
2017-10-07 22:21:41 +00:00
< label for = " pDefaultContainer " > Docker Image </ label >
2020-12-13 17:53:17 +00:00
< select id = " pDefaultContainer " name = " image " class = " form-control " ></ select >
< input id = " pDefaultContainerCustom " name = " custom_image " value = " { { old('custom_image') }} " class = " form-control " placeholder = " Or enter a custom image... " style = " margin-top:1rem " />
< 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 >
2017-02-24 23:19:03 +00:00
</ div >
</ div >
</ div >
</ div >
</ div >
2020-04-11 19:56:03 +00:00
2017-02-24 23:19:03 +00:00
< div class = " row " >
< div class = " col-md-12 " >
< div class = " box " >
< div class = " box-header with-border " >
< h3 class = " box-title " > Startup Configuration </ h3 >
</ div >
2020-04-11 19:56:03 +00:00
2017-02-24 23:19:03 +00:00
< div class = " box-body row " >
< div class = " form-group col-xs-12 " >
< label for = " pStartup " > Startup Command </ label >
2020-04-11 19:56:03 +00:00
< input type = " text " id = " pStartup " name = " startup " value = " { { old('startup') }} " class = " form-control " />
2018-05-13 14:34:09 +00:00
< 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 >
2017-02-24 23:19:03 +00:00
</ div >
</ div >
2020-04-11 19:56:03 +00:00
2017-02-24 23:19:03 +00:00
< div class = " box-header with-border " style = " margin-top:-10px; " >
< h3 class = " box-title " > Service Variables </ h3 >
</ div >
2020-04-11 19:56:03 +00:00
2017-02-24 23:19:03 +00:00
< div class = " box-body row " id = " appendVariablesTo " ></ div >
2020-04-11 19:56:03 +00:00
2017-02-24 23:19:03 +00:00
< div class = " box-footer " >
{ !! csrf_field () !! }
< input type = " submit " class = " btn btn-success pull-right " value = " Create Server " />
</ div >
</ div >
</ div >
</ div >
2017-02-19 00:31:44 +00:00
</ form >
@ endsection
@ section ( 'footer-scripts' )
@ parent
2017-02-24 23:19:03 +00:00
{ !! Theme :: js ( 'vendor/lodash/lodash.js' ) !! }
2020-04-11 20:46:30 +00:00
< script type = " application/javascript " >
// Persist 'Service Variables'
function serviceVariablesUpdated ( eggId , ids ) {
@ if ( old ( 'egg_id' ))
// Check if the egg id matches.
if ( eggId != '{{ old(' egg_id ') }}' ) {
return ;
}
@ if ( old ( 'environment' ))
@ foreach ( old ( 'environment' ) as $key => $value )
$ ( '#' + ids [ '{{ $key }}' ]) . val ( '{{ $value }}' );
@ endforeach
@ endif
@ endif
2020-12-13 17:53:17 +00:00
@ if ( old ( 'image' ))
$ ( '#pDefaultContainer' ) . val ( '{{ old(' image ') }}' );
@ endif
2020-04-11 20:46:30 +00:00
}
// END Persist 'Service Variables'
</ script >
2020-12-13 17:53:17 +00:00
{ !! Theme :: js ( 'js/admin/new-server.js?v=20201212' ) !! }
2020-04-11 19:56:03 +00:00
< script type = " application/javascript " >
$ ( document ) . ready ( function () {
2020-04-11 20:46:30 +00:00
// Persist 'Server Owner' select2
2020-04-11 20:14:05 +00:00
@ if ( old ( 'owner_id' ))
$ . ajax ({
url : '/admin/users/accounts.json?user_id={{ old(' owner_id ') }}' ,
dataType : 'json' ,
}) . then ( function ( data ) {
initUserIdSelect ([ data ]);
});
@ else
initUserIdSelect ();
@ endif
2020-04-11 20:46:30 +00:00
// END Persist 'Server Owner' select2
2020-04-11 20:14:05 +00:00
2020-04-11 20:46:30 +00:00
// Persist 'Node' select2
2020-04-11 19:56:03 +00:00
@ if ( old ( 'node_id' ))
$ ( '#pNodeId' ) . val ( '{{ old(' node_id ') }}' ) . change ();
2020-04-11 20:46:30 +00:00
// Persist 'Default Allocation' select2
2020-04-11 19:56:03 +00:00
@ if ( old ( 'allocation_id' ))
$ ( '#pAllocation' ) . val ( '{{ old(' allocation_id ') }}' ) . change ();
@ endif
2020-04-11 20:46:30 +00:00
// END Persist 'Default Allocation' select2
2020-04-11 19:56:03 +00:00
2020-04-11 20:46:30 +00:00
// Persist 'Additional Allocations' select2
2020-04-11 19:56:03 +00:00
@ if ( old ( 'allocation_additional' ))
const additional_allocations = [];
@ for ( $i = 0 ; $i < count ( old ( 'allocation_additional' )); $i ++ )
additional_allocations . push ( '{{ old(' allocation_additional . '.$i)}}' );
@ endfor
$ ( '#pAllocationAdditional' ) . val ( additional_allocations ) . change ();
@ endif
2020-04-11 20:46:30 +00:00
// END Persist 'Additional Allocations' select2
2020-04-11 19:56:03 +00:00
@ endif
2020-04-11 20:46:30 +00:00
// END Persist 'Node' select2
2020-04-11 19:56:03 +00:00
2020-04-11 20:46:30 +00:00
// Persist 'Nest' select2
2020-04-11 20:14:05 +00:00
@ if ( old ( 'nest_id' ))
$ ( '#pNestId' ) . val ( '{{ old(' nest_id ') }}' ) . change ();
2020-04-11 20:46:30 +00:00
// Persist 'Egg' select2
2020-04-11 20:14:05 +00:00
@ if ( old ( 'egg_id' ))
$ ( '#pEggId' ) . val ( '{{ old(' egg_id ') }}' ) . change ();
@ endif
2020-04-11 20:46:30 +00:00
// END Persist 'Egg' select2
2020-04-11 19:56:03 +00:00
@ endif
2020-04-11 20:46:30 +00:00
// END Persist 'Nest' select2
2020-04-11 19:56:03 +00:00
});
</ script >
2017-02-19 00:31:44 +00:00
@ endsection