2017-09-26 02:43:01 +00:00
|
|
|
{{-- Pterodactyl - Panel --}}
|
2017-03-18 17:09:30 +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-03-18 17:09:30 +00:00
|
|
|
@extends('layouts.admin')
|
|
|
|
|
|
|
|
@section('title')
|
2017-10-07 21:16:51 +00:00
|
|
|
Nests → Egg: {{ $egg->name }} → Scripts
|
2017-03-18 17:09:30 +00:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('content-header')
|
2017-10-07 21:16:51 +00:00
|
|
|
<h1>{{ $egg->name }}<small>Manage install and upgrade scripts for this Egg.</small></h1>
|
2017-03-18 17:09:30 +00:00
|
|
|
<ol class="breadcrumb">
|
|
|
|
<li><a href="{{ route('admin.index') }}">Admin</a></li>
|
2017-10-07 21:16:51 +00:00
|
|
|
<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>
|
2017-03-18 17:09:30 +00:00
|
|
|
</ol>
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<div class="nav-tabs-custom nav-tabs-floating">
|
|
|
|
<ul class="nav nav-tabs">
|
2017-10-07 21:16:51 +00:00
|
|
|
<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>
|
2017-03-18 17:09:30 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-10-07 21:16:51 +00:00
|
|
|
<form action="{{ route('admin.nests.egg.scripts', $egg->id) }}" method="POST">
|
2017-03-18 17:09:30 +00:00
|
|
|
<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>
|
2017-10-07 21:16:51 +00:00
|
|
|
@if(! is_null($egg->copyFrom))
|
2017-04-27 20:16:57 +00:00
|
|
|
<div class="box-body">
|
|
|
|
<div class="callout callout-warning no-margin">
|
2018-05-13 14:34:09 +00:00
|
|
|
This service option is copying installation scripts and container 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.
|
2017-04-27 20:16:57 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
2017-03-18 17:09:30 +00:00
|
|
|
<div class="box-body no-padding">
|
2017-10-07 21:16:51 +00:00
|
|
|
<div id="editor_install"style="height:300px">{{ $egg->script_install }}</div>
|
2017-03-18 17:09:30 +00:00
|
|
|
</div>
|
2017-04-20 22:52:43 +00:00
|
|
|
<div class="box-body">
|
|
|
|
<div class="row">
|
2017-04-27 20:16:57 +00:00
|
|
|
<div class="form-group col-sm-4">
|
|
|
|
<label class="control-label">Copy Script From</label>
|
|
|
|
<select id="pCopyScriptFrom" name="copy_script_from">
|
2017-12-31 19:17:06 +00:00
|
|
|
<option value="">None</option>
|
2017-04-27 20:16:57 +00:00
|
|
|
@foreach($copyFromOptions as $opt)
|
2017-10-07 21:16:51 +00:00
|
|
|
<option value="{{ $opt->id }}" {{ $egg->copy_script_from !== $opt->id ?: 'selected' }}>{{ $opt->name }}</option>
|
2017-04-27 20:16:57 +00:00
|
|
|
@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">
|
2017-04-20 22:52:43 +00:00
|
|
|
<label class="control-label">Script Container</label>
|
2017-10-07 21:16:51 +00:00
|
|
|
<input type="text" name="script_container" class="form-control" value="{{ $egg->script_container }}" />
|
2017-04-20 22:52:43 +00:00
|
|
|
<p class="text-muted small">Docker container to use when running this script for the server.</p>
|
|
|
|
</div>
|
2017-04-27 20:16:57 +00:00
|
|
|
<div class="form-group col-sm-4">
|
2017-04-20 22:52:43 +00:00
|
|
|
<label class="control-label">Script Entrypoint Command</label>
|
2017-10-07 21:16:51 +00:00
|
|
|
<input type="text" name="script_entry" class="form-control" value="{{ $egg->script_entry }}" />
|
2017-04-20 22:52:43 +00:00
|
|
|
<p class="text-muted small">The entrypoint command to use for this script.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-04-27 20:16:57 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12 text-muted">
|
|
|
|
The following service options rely on this script:
|
|
|
|
@if(count($relyOnScript) > 0)
|
|
|
|
@foreach($relyOnScript as $rely)
|
2017-10-07 21:16:51 +00:00
|
|
|
<a href="{{ route('admin.nests.egg.view', $rely->id) }}">
|
|
|
|
<code>{{ $rely->name }}</code>@if(!$loop->last), @endif
|
2017-04-27 20:16:57 +00:00
|
|
|
</a>
|
|
|
|
@endforeach
|
|
|
|
@else
|
|
|
|
<em>none</em>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-04-20 22:52:43 +00:00
|
|
|
</div>
|
2017-03-18 17:09:30 +00:00
|
|
|
<div class="box-footer">
|
|
|
|
{!! csrf_field() !!}
|
|
|
|
<textarea name="script_install" class="hidden"></textarea>
|
2017-10-07 21:16:51 +00:00
|
|
|
<button type="submit" name="_method" value="PATCH" class="btn btn-primary btn-sm pull-right">Save</button>
|
2017-03-18 17:09:30 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('footer-scripts')
|
|
|
|
@parent
|
2017-04-20 21:26:20 +00:00
|
|
|
{!! Theme::js('vendor/ace/ace.js') !!}
|
|
|
|
{!! Theme::js('vendor/ace/ext-modelist.js') !!}
|
2017-03-18 17:09:30 +00:00
|
|
|
<script>
|
|
|
|
$(document).ready(function () {
|
2017-04-27 20:16:57 +00:00
|
|
|
$('#pCopyScriptFrom').select2();
|
|
|
|
|
2017-03-18 17:09:30 +00:00
|
|
|
const InstallEditor = ace.edit('editor_install');
|
|
|
|
const Modelist = ace.require('ace/ext/modelist')
|
|
|
|
|
|
|
|
InstallEditor.setTheme('ace/theme/chrome');
|
|
|
|
InstallEditor.getSession().setMode('ace/mode/sh');
|
|
|
|
InstallEditor.getSession().setUseWrapMode(true);
|
|
|
|
InstallEditor.setShowPrintMargin(false);
|
|
|
|
|
|
|
|
$('form').on('submit', function (e) {
|
|
|
|
$('textarea[name="script_install"]').val(InstallEditor.getValue());
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
2017-04-20 21:26:20 +00:00
|
|
|
|
2017-03-18 17:09:30 +00:00
|
|
|
@endsection
|