Nest & Egg management working through the ACP now.

This commit is contained in:
Dane Everitt 2017-10-07 16:16:51 -05:00
parent df87ea0867
commit 6b8464ea3a
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
32 changed files with 616 additions and 566 deletions

View file

@ -6,20 +6,20 @@
@extends('layouts.admin')
@section('title')
Service → New Option
Nests → New Egg
@endsection
@section('content-header')
<h1>New Option<small>Create a new service option to assign to servers.</small></h1>
<h1>New Egg<small>Create a new Egg to assign to servers.</small></h1>
<ol class="breadcrumb">
<li><a href="{{ route('admin.index') }}">Admin</a></li>
<li><a href="{{ route('admin.services') }}">Service</a></li>
<li class="active">New Service Option</li>
<li><a href="{{ route('admin.nests') }}">Nests</a></li>
<li class="active">New Egg</li>
</ol>
@endsection
@section('content')
<form action="{{ route('admin.services.option.new') }}" method="POST">
<form action="{{ route('admin.nests.egg.new') }}" method="POST">
<div class="row">
<div class="col-xs-12">
<div class="box">
@ -30,42 +30,37 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label for="pServiceId" class="form-label">Associated Service</label>
<select name="service_id" id="pServiceId">
@foreach($services as $service)
<option value="{{ $service->id }}" {{ old('service_id') != $service->id ?: 'selected' }}>{{ $service->name }} &lt;{{ $service->author }}&gt;</option>
@endforeach
</select>
<label for="pNestId" class="form-label">Associated Nest</label>
<div>
<select name="nest_id" id="pNestId">
@foreach($nests as $nest)
<option value="{{ $nest->id }}" {{ old('nest_id') != $nest->id ?: 'selected' }}>{{ $nest->name }} &lt;{{ $nest->author }}&gt;</option>
@endforeach
</select>
<p class="text-muted small">Think of a Nest as a category. You can put multiple Eggs in a nest, but consider putting only Eggs that are related to eachother in each Nest.</p>
</div>
</div>
<div class="form-group">
<label for="pName" class="form-label">Option Name</label>
<label for="pName" class="form-label">Name</label>
<input type="text" id="pName" name="name" value="{{ old('name') }}" class="form-control" />
<p class="text-muted small">A simple, human-readable name to use as an identifier for this service.</p>
<p class="text-muted small">A simple, human-readable name to use as an identifier for this Egg. This is what users will see as thier gameserver type.</p>
</div>
<div class="form-group">
<label for="pDescription" class="form-label">Description</label>
<textarea id="pDescription" name="description" class="form-control" rows="8">{{ old('description') }}</textarea>
<p class="text-muted small">A description of this service that will be displayed throughout the panel as needed.</p>
<p class="text-muted small">A description of this Egg.</p>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="pTag" class="form-label">Option Tag</label>
<div class="input-group">
<span class="input-group-addon">{{ config('pterodactyl.service.author') }}:</span>
<input type="text" id="pTag" name="tag" value="{{ old('tag') }}" class="form-control" />
</div>
<p class="text-muted small">This should be a unique identifer for this service option that is not used for any other service options. Must be alpha-numeric and no more than 60 characters in length.</p>
</div>
<div class="form-group">
<label for="pDockerImage" class="control-label">Docker Image <span class="field-optional"></span></label>
<label for="pDockerImage" class="control-label">Docker Image</label>
<input type="text" id="pDockerImage" name="docker_image" value="{{ old('docker_image') }}" placeholder="quay.io/pterodactyl/service" class="form-control" />
<p class="text-muted small">The default docker image that should be used for new servers under this service option. This can be left blank to use the parent service's defined image, and can also be changed per-server.</p>
<p class="text-muted small">The default docker image that should be used for new servers using this Egg. This can be changed per-server.</p>
</div>
<div class="form-group">
<label for="pStartup" class="control-label">Startup Command <span class="field-optional"></span></label>
<textarea id="pStartup" name="startup" class="form-control" rows="4">{{ old('startup') }}</textarea>
<p class="text-muted small">The default statup command that should be used for new servers under this service option. This can be left blank to use the parent service's startup, and can also be changed per-server.</p>
<label for="pStartup" class="control-label">Startup Command</label>
<textarea id="pStartup" name="startup" class="form-control" rows="14">{{ old('startup') }}</textarea>
<p class="text-muted small">The default statup command that should be used for new servers created with this Egg. You can change this per-server as needed.</p>
</div>
</div>
</div>
@ -90,7 +85,7 @@
<select name="config_from" id="pConfigFrom" class="form-control">
<option value="0">None</option>
</select>
<p class="text-muted small">If you would like to default to settings from another option select the option from the menu above.</p>
<p class="text-muted small">If you would like to default to settings from another Egg select it from the dropdown above.</p>
</div>
<div class="form-group">
<label for="pConfigStop" class="form-label">Stop Command</label>
@ -118,7 +113,7 @@
</div>
<div class="box-footer">
{!! csrf_field() !!}
<button type="submit" class="btn btn-success btn-sm pull-right">Create Service</button>
<button type="submit" class="btn btn-success btn-sm pull-right">Create</button>
</div>
</div>
</div>
@ -131,15 +126,15 @@
{!! Theme::js('vendor/lodash/lodash.js') !!}
<script>
$(document).ready(function() {
$('#pServiceId').select2().change();
$('#pNestId').select2().change();
$('#pConfigFrom').select2();
});
$('#pServiceId').on('change', function (event) {
$('#pNestId').on('change', function (event) {
$('#pConfigFrom').html('<option value="">None</option>').select2({
data: $.map(_.get(Pterodactyl.services, $(this).val() + '.options', []), function (item) {
data: $.map(_.get(Pterodactyl.nests, $(this).val() + '.eggs', []), function (item) {
return {
id: item.id,
text: item.name + ' <' + item.tag + '>',
text: item.name + ' <' + item.author + '>',
};
}),
});

View file

@ -6,16 +6,16 @@
@extends('layouts.admin')
@section('title')
Service &rarr; Option: {{ $option->name }} &rarr; Scripts
Nests &rarr; Egg: {{ $egg->name }} &rarr; Scripts
@endsection
@section('content-header')
<h1>{{ $option->name }}<small>Manage install and upgrade scripts for this service option.</small></h1>
<h1>{{ $egg->name }}<small>Manage install and upgrade scripts for this Egg.</small></h1>
<ol class="breadcrumb">
<li><a href="{{ route('admin.index') }}">Admin</a></li>
<li><a href="{{ route('admin.services') }}">Service</a></li>
<li><a href="{{ route('admin.services.view', $option->service->id) }}">{{ $option->service->name }}</a></li>
<li class="active">{{ $option->name }}</li>
<li><a href="{{ route('admin.nests') }}">Service</a></li>
<li><a href="{{ route('admin.nests.view', $egg->nest->id) }}">{{ $egg->nest->name }}</a></li>
<li class="active">{{ $egg->name }}</li>
</ol>
@endsection
@ -24,29 +24,29 @@
<div class="col-xs-12">
<div class="nav-tabs-custom nav-tabs-floating">
<ul class="nav nav-tabs">
<li><a href="{{ route('admin.services.option.view', $option->id) }}">Configuration</a></li>
<li><a href="{{ route('admin.services.option.variables', $option->id) }}">Variables</a></li>
<li class="active"><a href="{{ route('admin.services.option.scripts', $option->id) }}">Scripts</a></li>
<li><a href="{{ route('admin.nests.egg.view', $egg->id) }}">Configuration</a></li>
<li><a href="{{ route('admin.nests.egg.variables', $egg->id) }}">Variables</a></li>
<li class="active"><a href="{{ route('admin.nests.egg.scripts', $egg->id) }}">Scripts</a></li>
</ul>
</div>
</div>
</div>
<form action="{{ route('admin.services.option.scripts', $option->id) }}" method="POST">
<form action="{{ route('admin.nests.egg.scripts', $egg->id) }}" method="POST">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Install Script</h3>
</div>
@if(! is_null($option->copyFrom))
@if(! is_null($egg->copyFrom))
<div class="box-body">
<div class="callout callout-warning no-margin">
This service option is copying installation scripts and containe options from <a href="{{ route('admin.services.option.view', $option->copyFrom->id) }}">{{ $option->copyFrom->name }}</a>. Any changes you make to this script will not apply unless you select "None" from the dropdown box below.
This service option is copying installation scripts and containe options from <a href="{{ route('admin.nests.egg.view', $egg->copyFrom->id) }}">{{ $egg->copyFrom->name }}</a>. Any changes you make to this script will not apply unless you select "None" from the dropdown box below.
</div>
</div>
@endif
<div class="box-body no-padding">
<div id="editor_install"style="height:300px">{{ $option->script_install }}</div>
<div id="editor_install"style="height:300px">{{ $egg->script_install }}</div>
</div>
<div class="box-body">
<div class="row">
@ -55,19 +55,19 @@
<select id="pCopyScriptFrom" name="copy_script_from">
<option value="0">None</option>
@foreach($copyFromOptions as $opt)
<option value="{{ $opt->id }}" {{ $option->copy_script_from !== $opt->id ?: 'selected' }}>{{ $opt->name }}</option>
<option value="{{ $opt->id }}" {{ $egg->copy_script_from !== $opt->id ?: 'selected' }}>{{ $opt->name }}</option>
@endforeach
</select>
<p class="text-muted small">If selected, script above will be ignored and script from selected option will be used in place.</p>
</div>
<div class="form-group col-sm-4">
<label class="control-label">Script Container</label>
<input type="text" name="script_container" class="form-control" value="{{ $option->script_container }}" />
<input type="text" name="script_container" class="form-control" value="{{ $egg->script_container }}" />
<p class="text-muted small">Docker container to use when running this script for the server.</p>
</div>
<div class="form-group col-sm-4">
<label class="control-label">Script Entrypoint Command</label>
<input type="text" name="script_entry" class="form-control" value="{{ $option->script_entry }}" />
<input type="text" name="script_entry" class="form-control" value="{{ $egg->script_entry }}" />
<p class="text-muted small">The entrypoint command to use for this script.</p>
</div>
</div>
@ -76,8 +76,8 @@
The following service options rely on this script:
@if(count($relyOnScript) > 0)
@foreach($relyOnScript as $rely)
<a href="{{ route('admin.services.option.view', $rely->id) }}">
<code>{{ $rely->name }}</code>&nbsp;
<a href="{{ route('admin.nests.egg.view', $rely->id) }}">
<code>{{ $rely->name }}</code>@if(!$loop->last),&nbsp;@endif
</a>
@endforeach
@else
@ -89,7 +89,7 @@
<div class="box-footer">
{!! csrf_field() !!}
<textarea name="script_install" class="hidden"></textarea>
<button type="submit" class="btn btn-primary btn-sm pull-right">Save Script</button>
<button type="submit" name="_method" value="PATCH" class="btn btn-primary btn-sm pull-right">Save</button>
</div>
</div>
</div>

View file

@ -6,16 +6,16 @@
@extends('layouts.admin')
@section('title')
Service Options &rarr; {{ $option->name }} &rarr; Variables
Egg &rarr; {{ $egg->name }} &rarr; Variables
@endsection
@section('content-header')
<h1>{{ $option->name }}<small>Managing variables for this service option.</small></h1>
<h1>{{ $egg->name }}<small>Managing variables for this Egg.</small></h1>
<ol class="breadcrumb">
<li><a href="{{ route('admin.index') }}">Admin</a></li>
<li><a href="{{ route('admin.services') }}">Service</a></li>
<li><a href="{{ route('admin.services.view', $option->service->id) }}">{{ $option->service->name }}</a></li>
<li><a href="{{ route('admin.services.option.view', $option->id) }}">{{ $option->name }}</a></li>
<li><a href="{{ route('admin.nests') }}">Nests</a></li>
<li><a href="{{ route('admin.nests.view', $egg->nest->id) }}">{{ $egg->nest->name }}</a></li>
<li><a href="{{ route('admin.nests.egg.view', $egg->id) }}">{{ $egg->name }}</a></li>
<li class="active">Variables</li>
</ol>
@endsection
@ -25,22 +25,30 @@
<div class="col-xs-12">
<div class="nav-tabs-custom nav-tabs-floating">
<ul class="nav nav-tabs">
<li><a href="{{ route('admin.services.option.view', $option->id) }}">Configuration</a></li>
<li class="active"><a href="{{ route('admin.services.option.variables', $option->id) }}">Variables</a></li>
<li class="tab-success"><a href="#modal" data-toggle="modal" data-target="#newVariableModal">New Variable</a></li>
<li><a href="{{ route('admin.services.option.scripts', $option->id) }}">Scripts</a></li>
<li><a href="{{ route('admin.nests.egg.view', $egg->id) }}">Configuration</a></li>
<li class="active"><a href="{{ route('admin.nests.egg.variables', $egg->id) }}">Variables</a></li>
<li><a href="{{ route('admin.nests.egg.scripts', $egg->id) }}">Scripts</a></li>
</ul>
</div>
</div>
</div>
<div class="row">
@foreach($option->variables as $variable)
<div class="col-xs-12">
<div class="box no-border">
<div class="box-body">
<a href="#" class="btn btn-sm btn-success pull-right" data-toggle="modal" data-target="#newVariableModal">Create New Variable</a>
</div>
</div>
</div>
</div>
<div class="row">
@foreach($egg->variables as $variable)
<div class="col-sm-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ $variable->name }}</h3>
</div>
<form action="{{ route('admin.services.option.variables.edit', ['id' => $option->id, 'variable' => $variable->id]) }}" method="POST">
<form action="{{ route('admin.nests.egg.variables.edit', ['id' => $egg->id, 'variable' => $variable->id]) }}" method="POST">
<div class="box-body">
<div class="form-group">
<label class="form-label">Name</label>
@ -93,7 +101,7 @@
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Create New Option Variable</h4>
</div>
<form action="{{ route('admin.services.option.variables', $option->id) }}" method="POST">
<form action="{{ route('admin.nests.egg.variables', $egg->id) }}" method="POST">
<div class="modal-body">
<div class="form-group">
<label class="form-label">Name</label>