Path: blob/1.0-develop/resources/views/admin/eggs/scripts.blade.php
7460 views
@extends('layouts.admin')12@section('title')3Nests → Egg: {{ $egg->name }} → Install Script4@endsection56@section('content-header')7<h1>{{ $egg->name }}<small>Manage the install script for this Egg.</small></h1>8<ol class="breadcrumb">9<li><a href="{{ route('admin.index') }}">Admin</a></li>10<li><a href="{{ route('admin.nests') }}">Nests</a></li>11<li><a href="{{ route('admin.nests.view', $egg->nest->id) }}">{{ $egg->nest->name }}</a></li>12<li><a href="{{ route('admin.nests.egg.view', $egg->id) }}">{{ $egg->name }}</a></li>13<li class="active">{{ $egg->name }}</li>14</ol>15@endsection1617@section('content')18<div class="row">19<div class="col-xs-12">20<div class="nav-tabs-custom nav-tabs-floating">21<ul class="nav nav-tabs">22<li><a href="{{ route('admin.nests.egg.view', $egg->id) }}">Configuration</a></li>23<li><a href="{{ route('admin.nests.egg.variables', $egg->id) }}">Variables</a></li>24<li class="active"><a href="{{ route('admin.nests.egg.scripts', $egg->id) }}">Install Script</a></li>25</ul>26</div>27</div>28</div>29<form action="{{ route('admin.nests.egg.scripts', $egg->id) }}" method="POST">30<div class="row">31<div class="col-xs-12">32<div class="box">33<div class="box-header with-border">34<h3 class="box-title">Install Script</h3>35</div>36@if(! is_null($egg->copyFrom))37<div class="box-body">38<div class="callout callout-warning no-margin">39This 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.40</div>41</div>42@endif43<div class="box-body no-padding">44<div id="editor_install"style="height:300px">{{ $egg->script_install }}</div>45</div>46<div class="box-body">47<div class="row">48<div class="form-group col-sm-4">49<label class="control-label">Copy Script From</label>50<select id="pCopyScriptFrom" name="copy_script_from">51<option value="">None</option>52@foreach($copyFromOptions as $opt)53<option value="{{ $opt->id }}" {{ $egg->copy_script_from !== $opt->id ?: 'selected' }}>{{ $opt->name }}</option>54@endforeach55</select>56<p class="text-muted small">If selected, script above will be ignored and script from selected option will be used in place.</p>57</div>58<div class="form-group col-sm-4">59<label class="control-label">Script Container</label>60<input type="text" name="script_container" class="form-control" value="{{ $egg->script_container }}" />61<p class="text-muted small">Docker container to use when running this script for the server.</p>62</div>63<div class="form-group col-sm-4">64<label class="control-label">Script Entrypoint Command</label>65<input type="text" name="script_entry" class="form-control" value="{{ $egg->script_entry }}" />66<p class="text-muted small">The entrypoint command to use for this script.</p>67</div>68</div>69<div class="row">70<div class="col-xs-12 text-muted">71The following service options rely on this script:72@if(count($relyOnScript) > 0)73@foreach($relyOnScript as $rely)74<a href="{{ route('admin.nests.egg.view', $rely->id) }}">75<code>{{ $rely->name }}</code>@if(!$loop->last), @endif76</a>77@endforeach78@else79<em>none</em>80@endif81</div>82</div>83</div>84<div class="box-footer">85{!! csrf_field() !!}86<textarea name="script_install" class="hidden"></textarea>87<button type="submit" name="_method" value="PATCH" class="btn btn-primary btn-sm pull-right">Save</button>88</div>89</div>90</div>91</div>92</form>93@endsection9495@section('footer-scripts')96@parent97{!! Theme::js('vendor/ace/ace.js') !!}98{!! Theme::js('vendor/ace/ext-modelist.js') !!}99<script>100$(document).ready(function () {101$('#pCopyScriptFrom').select2();102103const InstallEditor = ace.edit('editor_install');104const Modelist = ace.require('ace/ext/modelist')105106InstallEditor.setTheme('ace/theme/chrome');107InstallEditor.getSession().setMode('ace/mode/sh');108InstallEditor.getSession().setUseWrapMode(true);109InstallEditor.setShowPrintMargin(false);110111$('form').on('submit', function (e) {112$('textarea[name="script_install"]').val(InstallEditor.getValue());113});114});115</script>116117@endsection118119120