forked from pterodactyl/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.blade.php
More file actions
123 lines (114 loc) · 5.88 KB
/
scripts.blade.php
File metadata and controls
123 lines (114 loc) · 5.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
{{-- Pterodactyl - Panel --}}
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
{{-- This software is licensed under the terms of the MIT license. --}}
{{-- https://opensource.org/licenses/MIT --}}
@extends('layouts.admin')
@section('title')
Nests → Egg: {{ $egg->name }} → Install Script
@endsection
@section('content-header')
<h1>{{ $egg->name }}<small>Manage the install script for this Egg.</small></h1>
<ol class="breadcrumb">
<li><a href="{{ route('admin.index') }}">Admin</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">{{ $egg->name }}</li>
</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">
<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) }}">Install Script</a></li>
</ul>
</div>
</div>
</div>
<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($egg->copyFrom))
<div class="box-body">
<div class="callout callout-warning no-margin">
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.
</div>
</div>
@endif
<div class="box-body no-padding">
<div id="editor_install"style="height:300px">{{ $egg->script_install }}</div>
</div>
<div class="box-body">
<div class="row">
<div class="form-group col-sm-4">
<label class="control-label">Copy Script From</label>
<select id="pCopyScriptFrom" name="copy_script_from">
<option value="">None</option>
@foreach($copyFromOptions as $opt)
<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="{{ $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="{{ $egg->script_entry }}" />
<p class="text-muted small">The entrypoint command to use for this script.</p>
</div>
</div>
<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)
<a href="{{ route('admin.nests.egg.view', $rely->id) }}">
<code>{{ $rely->name }}</code>@if(!$loop->last), @endif
</a>
@endforeach
@else
<em>none</em>
@endif
</div>
</div>
</div>
<div class="box-footer">
{!! csrf_field() !!}
<textarea name="script_install" class="hidden"></textarea>
<button type="submit" name="_method" value="PATCH" class="btn btn-primary btn-sm pull-right">Save</button>
</div>
</div>
</div>
</div>
</form>
@endsection
@section('footer-scripts')
@parent
{!! Theme::js('vendor/ace/ace.js') !!}
{!! Theme::js('vendor/ace/ext-modelist.js') !!}
<script>
$(document).ready(function () {
$('#pCopyScriptFrom').select2();
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>
@endsection