2017-09-26 02:43:01 +00:00
|
|
|
{{-- Pterodactyl - Panel --}}
|
2017-03-12 05:00:06 +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-12 05:00:06 +00:00
|
|
|
@extends('layouts.admin')
|
|
|
|
|
|
|
|
@section('title')
|
2017-10-07 21:16:51 +00:00
|
|
|
Egg → {{ $egg->name }} → Variables
|
2017-03-12 05:00:06 +00:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('content-header')
|
2017-10-07 21:16:51 +00:00
|
|
|
<h1>{{ $egg->name }}<small>Managing variables for this Egg.</small></h1>
|
2017-03-12 05:00:06 +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') }}">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>
|
2017-03-12 05:00:06 +00:00
|
|
|
<li class="active">Variables</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">
|
2017-10-07 21:16:51 +00:00
|
|
|
<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>
|
2019-10-22 23:37:42 +00:00
|
|
|
<li><a href="{{ route('admin.nests.egg.scripts', $egg->id) }}">Install Script</a></li>
|
2017-03-12 05:00:06 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
2017-10-07 21:16:51 +00:00
|
|
|
<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)
|
2017-03-12 05:00:06 +00:00
|
|
|
<div class="col-sm-6">
|
|
|
|
<div class="box">
|
|
|
|
<div class="box-header with-border">
|
|
|
|
<h3 class="box-title">{{ $variable->name }}</h3>
|
|
|
|
</div>
|
2017-10-07 21:16:51 +00:00
|
|
|
<form action="{{ route('admin.nests.egg.variables.edit', ['id' => $egg->id, 'variable' => $variable->id]) }}" method="POST">
|
2017-03-12 05:00:06 +00:00
|
|
|
<div class="box-body">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-label">Name</label>
|
|
|
|
<input type="text" name="name" value="{{ $variable->name }}" class="form-control" />
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-label">Description</label>
|
|
|
|
<textarea name="description" class="form-control" rows="3">{{ $variable->description }}</textarea>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="form-group col-md-6">
|
|
|
|
<label class="form-label">Environment Variable</label>
|
|
|
|
<input type="text" name="env_variable" value="{{ $variable->env_variable }}" class="form-control" />
|
|
|
|
</div>
|
|
|
|
<div class="form-group col-md-6">
|
|
|
|
<label class="form-label">Default Value</label>
|
|
|
|
<input type="text" name="default_value" value="{{ $variable->default_value }}" class="form-control" />
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-12">
|
2018-05-13 14:34:09 +00:00
|
|
|
<p class="text-muted small">This variable can be accessed in the startup command by using <code>{{ $variable->env_variable }}</code>.</p>
|
2017-03-12 05:00:06 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-label">Permissions</label>
|
|
|
|
<select name="options[]" class="pOptions form-control" multiple>
|
|
|
|
<option value="user_viewable" {{ (! $variable->user_viewable) ?: 'selected' }}>Users Can View</option>
|
|
|
|
<option value="user_editable" {{ (! $variable->user_editable) ?: 'selected' }}>Users Can Edit</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-label">Input Rules</label>
|
|
|
|
<input type="text" name="rules" class="form-control" value="{{ $variable->rules }}" />
|
2019-07-08 08:05:51 +00:00
|
|
|
<p class="text-muted small">These rules are defined using standard <a href="https://laravel.com/docs/5.7/validation#available-validation-rules" target="_blank">Laravel Framework validation rules</a>.</p>
|
2017-03-12 05:00:06 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="box-footer">
|
|
|
|
{!! csrf_field() !!}
|
2017-08-12 20:29:01 +00:00
|
|
|
<button class="btn btn-sm btn-primary pull-right" name="_method" value="PATCH" type="submit">Save</button>
|
2018-02-25 22:21:50 +00:00
|
|
|
<button class="btn btn-sm btn-danger pull-left muted muted-hover" data-action="delete" name="_method" value="DELETE" type="submit"><i class="fa fa-trash-o"></i></button>
|
2017-03-12 05:00:06 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endforeach
|
|
|
|
</div>
|
2017-03-12 20:28:38 +00:00
|
|
|
<div class="modal fade" id="newVariableModal" tabindex="-1" role="dialog">
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
2018-01-21 17:58:59 +00:00
|
|
|
<h4 class="modal-title">Create New Egg Variable</h4>
|
2017-03-12 20:28:38 +00:00
|
|
|
</div>
|
2017-10-07 21:16:51 +00:00
|
|
|
<form action="{{ route('admin.nests.egg.variables', $egg->id) }}" method="POST">
|
2017-03-12 20:28:38 +00:00
|
|
|
<div class="modal-body">
|
|
|
|
<div class="form-group">
|
2018-01-21 17:58:59 +00:00
|
|
|
<label class="control-label">Name <span class="field-required"></span></label>
|
2018-03-17 20:09:09 +00:00
|
|
|
<input type="text" name="name" class="form-control" value="{{ old('name') }}"/>
|
2017-03-12 20:28:38 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2018-01-21 17:58:59 +00:00
|
|
|
<label class="control-label">Description</label>
|
2018-03-17 20:09:09 +00:00
|
|
|
<textarea name="description" class="form-control" rows="3">{{ old('description') }}</textarea>
|
2017-03-12 20:28:38 +00:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="form-group col-md-6">
|
2018-01-21 17:58:59 +00:00
|
|
|
<label class="control-label">Environment Variable <span class="field-required"></span></label>
|
2018-03-17 20:09:09 +00:00
|
|
|
<input type="text" name="env_variable" class="form-control" value="{{ old('env_variable') }}" />
|
2017-03-12 20:28:38 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-group col-md-6">
|
2018-01-21 17:58:59 +00:00
|
|
|
<label class="control-label">Default Value</label>
|
2018-03-17 20:09:09 +00:00
|
|
|
<input type="text" name="default_value" class="form-control" value="{{ old('default_value') }}" />
|
2017-03-12 20:28:38 +00:00
|
|
|
</div>
|
|
|
|
<div class="col-xs-12">
|
2018-05-13 14:34:09 +00:00
|
|
|
<p class="text-muted small">This variable can be accessed in the startup command by entering <code>@{{environment variable value}}</code>.</p>
|
2017-03-12 20:28:38 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2018-01-21 17:58:59 +00:00
|
|
|
<label class="control-label">Permissions</label>
|
2017-03-12 20:28:38 +00:00
|
|
|
<select name="options[]" class="pOptions form-control" multiple>
|
|
|
|
<option value="user_viewable">Users Can View</option>
|
|
|
|
<option value="user_editable">Users Can Edit</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2018-01-21 17:58:59 +00:00
|
|
|
<label class="control-label">Input Rules <span class="field-required"></span></label>
|
2018-03-17 20:09:09 +00:00
|
|
|
<input type="text" name="rules" class="form-control" value="{{ old('rules', 'required|string|max:20') }}" placeholder="required|string|max:20" />
|
2019-07-08 08:05:51 +00:00
|
|
|
<p class="text-muted small">These rules are defined using standard <a href="https://laravel.com/docs/5.7/validation#available-validation-rules" target="_blank">Laravel Framework validation rules</a>.</p>
|
2017-03-12 20:28:38 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
{!! csrf_field() !!}
|
|
|
|
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">Close</button>
|
|
|
|
<button type="submit" class="btn btn-primary">Create Variable</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-03-12 05:00:06 +00:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('footer-scripts')
|
|
|
|
@parent
|
|
|
|
<script>
|
|
|
|
$('.pOptions').select2();
|
|
|
|
$('[data-action="delete"]').on('mouseenter', function (event) {
|
|
|
|
$(this).find('i').html(' Delete Variable');
|
|
|
|
}).on('mouseleave', function (event) {
|
|
|
|
$(this).find('i').html('');
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@endsection
|