Support for viewing and exporting packs
This commit is contained in:
parent
a1bc6fa2d3
commit
09c2dcc1b6
8 changed files with 403 additions and 21 deletions
|
@ -24,6 +24,7 @@
|
|||
namespace Pterodactyl\Http\Controllers\Admin;
|
||||
|
||||
use Alert;
|
||||
use DB;
|
||||
use Log;
|
||||
use Storage;
|
||||
|
||||
|
@ -42,17 +43,7 @@ class PackController extends Controller
|
|||
//
|
||||
}
|
||||
|
||||
public function list(Request $request, $id)
|
||||
{
|
||||
$option = Models\ServiceOptions::findOrFail($id);
|
||||
return view('admin.services.packs.index', [
|
||||
'packs' => Models\ServicePack::where('option', $option->id)->get(),
|
||||
'service' => Models\Service::findOrFail($option->parent_service),
|
||||
'option' => $option
|
||||
]);
|
||||
}
|
||||
|
||||
public function new(Request $request, $opt = null)
|
||||
protected function formatServices()
|
||||
{
|
||||
$options = Models\ServiceOptions::select(
|
||||
'services.name AS p_service',
|
||||
|
@ -72,8 +63,41 @@ class PackController extends Controller
|
|||
]]);
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
public function listAll(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function listByOption(Request $request, $id)
|
||||
{
|
||||
$option = Models\ServiceOptions::findOrFail($id);
|
||||
return view('admin.services.packs.byoption', [
|
||||
'packs' => Models\ServicePack::where('option', $option->id)->get(),
|
||||
'service' => Models\Service::findOrFail($option->parent_service),
|
||||
'option' => $option
|
||||
]);
|
||||
}
|
||||
|
||||
public function listByService(Request $request, $id)
|
||||
{
|
||||
return view('admin.services.packs.byservice', [
|
||||
'service' => Models\Service::findOrFail($id),
|
||||
'options' => Models\ServiceOptions::select(
|
||||
'service_options.id',
|
||||
'service_options.name',
|
||||
DB::raw('(SELECT COUNT(id) FROM service_packs WHERE service_packs.option = service_options.id) AS p_count')
|
||||
)->where('parent_service', $id)->get()
|
||||
]);
|
||||
}
|
||||
|
||||
public function new(Request $request, $opt = null)
|
||||
{
|
||||
|
||||
return view('admin.services.packs.new', [
|
||||
'services' => $array,
|
||||
'services' => $this->formatServices(),
|
||||
'packFor' => $opt,
|
||||
]);
|
||||
}
|
||||
|
@ -103,6 +127,58 @@ class PackController extends Controller
|
|||
public function edit(Request $request, $id)
|
||||
{
|
||||
$pack = Models\ServicePack::findOrFail($id);
|
||||
dd($pack, Storage::url('packs/' . $pack->uuid));
|
||||
$option = Models\ServiceOptions::select('id', 'parent_service', 'name')->where('id', $pack->option)->first();
|
||||
return view('admin.services.packs.edit', [
|
||||
'pack' => $pack,
|
||||
'services' => $this->formatServices(),
|
||||
'files' => Storage::files('packs/' . $pack->uuid),
|
||||
'service' => Models\Service::findOrFail($option->parent_service),
|
||||
'option' => $option
|
||||
]);
|
||||
}
|
||||
|
||||
public function export(Request $request, $id, $files = false)
|
||||
{
|
||||
$pack = Models\ServicePack::findOrFail($id);
|
||||
$json = [
|
||||
'name' => $pack->name,
|
||||
'version' => $pack->version,
|
||||
'description' => $pack->dscription,
|
||||
'selectable' => (bool) $pack->selectable,
|
||||
'visible' => (bool) $pack->visible,
|
||||
'build' => [
|
||||
'memory' => $pack->build_memory,
|
||||
'swap' => $pack->build_swap,
|
||||
'cpu' => $pack->build_cpu,
|
||||
'io' => $pack->build_io,
|
||||
'container' => $pack->build_container,
|
||||
'script' => $pack->build_script
|
||||
]
|
||||
];
|
||||
|
||||
$filename = tempnam(sys_get_temp_dir(), 'pterodactyl_');
|
||||
if ((bool) $files) {
|
||||
$zip = new \ZipArchive;
|
||||
if (!$zip->open($filename, \ZipArchive::CREATE)) {
|
||||
exit("cannot open <$filename>\n");
|
||||
}
|
||||
|
||||
$files = Storage::files('packs/' . $pack->uuid);
|
||||
foreach ($files as $file) {
|
||||
$zip->addFile(storage_path('app/' . $file), basename(storage_path('app/' . $file)));
|
||||
}
|
||||
|
||||
$zip->addFromString('import.json', json_encode($json, JSON_PRETTY_PRINT));
|
||||
$zip->close();
|
||||
|
||||
return response()->download($filename, 'pack-' . $pack->name . '.zip')->deleteFileAfterSend(true);
|
||||
} else {
|
||||
$fp = fopen($filename, 'a+');
|
||||
fwrite($fp, json_encode($json, JSON_PRETTY_PRINT));
|
||||
fclose($fp);
|
||||
return response()->download($filename, 'pack-' . $pack->name . '.json', [
|
||||
'Content-Type' => 'application/json'
|
||||
])->deleteFileAfterSend(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -446,14 +446,29 @@ class AdminRoutes {
|
|||
$router->post('/new', [
|
||||
'uses' => 'Admin\PackController@create'
|
||||
]);
|
||||
$router->get('/for/{option}', [
|
||||
'as' => 'admin.services.packs.for',
|
||||
'uses' => 'Admin\PackController@list'
|
||||
$router->get('/', [
|
||||
'as' => 'admin.services.packs',
|
||||
'uses' => 'Admin\PackController@listAll'
|
||||
]);
|
||||
$router->get('/for/option/{option}', [
|
||||
'as' => 'admin.services.packs.option',
|
||||
'uses' => 'Admin\PackController@listByOption'
|
||||
]);
|
||||
$router->get('/for/service/{service}', [
|
||||
'as' => 'admin.services.packs.service',
|
||||
'uses' => 'Admin\PackController@listByService'
|
||||
]);
|
||||
$router->get('/edit/{pack}', [
|
||||
'as' => 'admin.services.packs.edit',
|
||||
'uses' => 'Admin\PackController@edit'
|
||||
]);
|
||||
$router->post('/edit/{pack}', [
|
||||
'uses' => 'Admin\PackController@update'
|
||||
]);
|
||||
$router->get('/edit/{pack}/export/{archive?}', [
|
||||
'as' => 'admin.services.packs.export',
|
||||
'uses' => 'Admin\PackController@export'
|
||||
]);
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
<li><a href="/admin/services">Services</a></li>
|
||||
<li><a href="{{ route('admin.services.service', $service->id) }}">{{ $service->name }}</a></li>
|
||||
<li class="active">{{ $option->name }}</li>
|
||||
<li><a href="{{ route('admin.services.packs.for', $option->id) }}">Service Packs</a></li>
|
||||
</ul>
|
||||
<div class="alert alert-warning"><strong>Warning!</strong> This page contains advanced settings that the panel and daemon use to control servers. Modifying information on this page is not recommended unless you are absolutely sure of what you are doing.</div>
|
||||
<h3>Settings</h3><hr />
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
<ul class="breadcrumb">
|
||||
<li><a href="/admin">Admin Control</a></li>
|
||||
<li><a href="/admin/services">Services</a></li>
|
||||
<li><a href="{{ route('admin.services.service', $service->id) }}">{{ $service->name }}</a></li>
|
||||
<li><a href="{{ route('admin.services.option', [$service->id, $option->id]) }}">{{ $option->name }}</a></li>
|
||||
<li class="active">Service Packs</li>
|
||||
<li><a href="{{ route('admin.services.packs') }}">Packs</a></li>
|
||||
<li><a href="{{ route('admin.services.packs.service', $service->id) }}">{{ $service->name }}</a></li>
|
||||
<li class="active">{{ $option->name }}</li>
|
||||
</ul>
|
||||
<h3 class="nopad">Service Packs</h3><hr />
|
||||
<table class="table table-bordered table-hover">
|
||||
|
@ -46,7 +46,7 @@
|
|||
<tbody>
|
||||
@foreach ($packs as $pack)
|
||||
<tr>
|
||||
<td>{{ $pack->name }}</td>
|
||||
<td><a href="{{ route('admin.services.packs.edit', $pack->id) }}">{{ $pack->name }}</a></td>
|
||||
<td>{{ $pack->version }}</td>
|
||||
<td><code>{{ $pack->uuid }}</code></td>
|
||||
<td>@if($pack->selectable)<span class="label label-success"><i class="fa fa-check"></i></span>@else<span class="label label-default"><i class="fa fa-times"></i></span>@endif</td>
|
||||
|
@ -66,4 +66,9 @@
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find("a[href='/admin/services/packs']").addClass('active');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
67
resources/views/admin/services/packs/byservice.blade.php
Normal file
67
resources/views/admin/services/packs/byservice.blade.php
Normal file
|
@ -0,0 +1,67 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
||||
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
||||
{{-- in the Software without restriction, including without limitation the rights --}}
|
||||
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
||||
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
||||
{{-- furnished to do so, subject to the following conditions: --}}
|
||||
|
||||
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
||||
{{-- copies or substantial portions of the Software. --}}
|
||||
|
||||
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
||||
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
||||
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
||||
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
||||
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
||||
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
||||
{{-- SOFTWARE. --}}
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title')
|
||||
Service Packs for {{ $service->name }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/admin">Admin Control</a></li>
|
||||
<li><a href="/admin/services">Services</a></li>
|
||||
<li><a href="{{ route('admin.services.packs') }}">Packs</a></li>
|
||||
<li class="active">{{ $service->name }}</li>
|
||||
</ul>
|
||||
<h3 class="nopad">Service Packs</h3><hr />
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Total Packs</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($options as $option)
|
||||
<tr>
|
||||
<td><a href="{{ route('admin.services.packs.option', $option->id) }}">{{ $option->name }}</a></td>
|
||||
<td>{{ $option->p_count }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<a href="{{ route('admin.services.packs.new') }}">
|
||||
<button class="pull-right btn btn-xxs btn-primary"><i class="fa fa-plus"></i></button>
|
||||
</a>
|
||||
<a href="{{ route('admin.services.packs.new') }}">
|
||||
<button class="pull-right btn btn-xxs btn-default" style="margin-right:5px;"><i class="fa fa-upload"></i> Install from Template</button>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find("a[href='/admin/services/packs']").addClass('active');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -0,0 +1,217 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
||||
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
||||
{{-- in the Software without restriction, including without limitation the rights --}}
|
||||
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
||||
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
||||
{{-- furnished to do so, subject to the following conditions: --}}
|
||||
|
||||
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
||||
{{-- copies or substantial portions of the Software. --}}
|
||||
|
||||
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
||||
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
||||
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
||||
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
||||
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
||||
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
||||
{{-- SOFTWARE. --}}
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title')
|
||||
Add New Service Pack
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/admin">Admin Control</a></li>
|
||||
<li><a href="/admin/services">Services</a></li>
|
||||
<li><a href="{{ route('admin.services.packs') }}">Packs</a></li>
|
||||
<li><a href="{{ route('admin.services.packs.service', $service->id) }}">{{ $service->name }}</a></li>
|
||||
<li><a href="{{ route('admin.services.packs.option', $option->id) }}">{{ $option->name }}</a></li>
|
||||
<li class="active">{{ $pack->name }} ({{ $pack->version }})</li>
|
||||
</ul>
|
||||
<h3 class="nopad">Manage Service Pack</h3><hr />
|
||||
<form action="{{ route('admin.services.packs.edit', $pack->id) }}" method="POST">
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label class="control-label">Pack Name:</label>
|
||||
<div>
|
||||
<input type="text" name="name" value="{{ old('name', $pack->name) }}" placeholder="My Awesome Pack" class="form-control" />
|
||||
<p class="text-muted"><small>The name of the pack which will be seen in dropdown menus and to users.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label class="control-label">Pack Version:</label>
|
||||
<div>
|
||||
<input type="text" name="version" value="{{ old('version', $pack->version) }}" placeholder="v0.8.1" class="form-control" />
|
||||
<p class="text-muted"><small>The version of the program included in this pack.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 form-group">
|
||||
<label class="control-label">Description:</label>
|
||||
<div>
|
||||
<textarea name="description" class="form-control" rows="3">{{ old('description', $pack->description) }}</textarea>
|
||||
<p class="text-muted"><small>Provide a description of the pack which will be shown to users.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<label class="control-label">Associated Service Option:</label>
|
||||
<select name="option" class="form-control">
|
||||
@foreach($services as $service => $options)
|
||||
<option disabled>{{ $service }}</option>
|
||||
@foreach($options as $option)
|
||||
<option value="{{ $option['id'] }}" @if($pack->id === (int) $option['id'])selected="selected"@endif> -- {{ $option['name'] }}</option>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3 fuelux">
|
||||
<label class="control-label"> </label>
|
||||
<div>
|
||||
<label class="checkbox-formheight checkbox-custom checkbox-inline highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" type="checkbox" name="selectable" value="1" @if($pack->selectable)checked="checked"@endif> User Selectable
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 fuelux">
|
||||
<label class="control-label"> </label>
|
||||
<div>
|
||||
<label class="checkbox-formheight checkbox-custom checkbox-inline highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" type="checkbox" name="visible" value="1" @if($pack->visible)checked="checked"@endif> Visible
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h5 class="nopad">Build Parameters</h5>
|
||||
<div class="well" style="margin-bottom:0">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-3 col-xs-6">
|
||||
<label class="control-label">Memory:</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="build_memory" class="form-control" value="{{ old('build_memory', $pack->build_memory) }}"/>
|
||||
<span class="input-group-addon">MB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-3 col-xs-6">
|
||||
<label class="control-label">Swap:</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="build_swap" class="form-control" value="{{ old('build_swap', $pack->build_swap) }}"/>
|
||||
<span class="input-group-addon">MB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-3 col-xs-6">
|
||||
<label class="control-label">CPU:</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="build_cpu" class="form-control" value="{{ old('build_cpu', $pack->build_cpu) }}"/>
|
||||
<span class="input-group-addon">%</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-3 col-xs-6">
|
||||
<label class="control-label">IO:</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="build_io" class="form-control" value="{{ old('build_io', $pack->build_io) }}"/>
|
||||
<span class="input-group-addon">I/O</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<div>
|
||||
<p class="text-muted"><small>If you would like to set limits on the build container you may do so above. Setting <code>memory</code>, <code>swap</code>, or <code>cpu</code> to <code>0</code> will allow unlimited resource utilization. IO must be in a range between <code>10</code> to <code>1000</code> and is a relative weighting to other container IO usage.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<label class="control-label">Build Container:</label>
|
||||
<div>
|
||||
<input type="text" name="build_container" class="form-control" value="{{ old('build_container', $pack->build_container) }}"/>
|
||||
<p class="text-muted"><small>Provide the docker container image that will be used to build this service pack. This container is <em>only</em> used if a build script is provided below.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label class="control-label">Build Script:</label>
|
||||
<div id="build_script" style="height:200px">{{ $pack->build_script }}</div>
|
||||
<textarea id="editor_contents" name="build_script" class="hidden"></textarea>
|
||||
<p class="text-muted"><small>This script will be run inside the container if provided. You should use this script to download any additional dependencies or compile packages as necessary on the node. Your uploaded archive (if provided), will be available in <code>/input</code> as <code>archive.tar.gz</code> or as <code>archive.zip</code> depending on what format you uploaded as. Your completed pack should be saved as <code>package.tar.gz</code> in the <code>/output</code> directory (e.g. <code>/output/package.tar.gz</code>).</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h5 class="nopad">Package Archive</h5>
|
||||
<div class="well" style="margin-bottom:0">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
@if(count($files) > 1)
|
||||
<div class="alert alert-danger"><strong>Warning!</strong> Service packs should only contain a single pack archive in either <code>.zip</code> or <code>.tar.gz</code> format. We've detected more than one file for this pack.</div>
|
||||
@endif
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Filename</th>
|
||||
<th>File Size</th>
|
||||
<th>SHA1 Hash</th>
|
||||
<th>Last Modified</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($files as &$file)
|
||||
<tr>
|
||||
<td>{{ basename($file) }}</td>
|
||||
<td><code>{{ Storage::size($file) }}</code> Bytes</td>
|
||||
<td><code>{{ sha1_file(storage_path('app/' . $file)) }}</code></td>
|
||||
<td>{{ Carbon::createFromTimestamp(Storage::lastModified($file))->toDateTimeString() }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="text-muted"><small>If you wish to modify or upload a new file it should be uploaded to <code>{{ storage_path('app/packs/' . $pack->uuid) }}</code> as either <code>archive.zip</code> or <code>archive.tar.gz</code>.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-sm btn-primary" value="Edit Service Pack" />
|
||||
<a href="{{ route('admin.services.packs.export', $pack->id) }}"><button type="button" class="pull-right btn btn-sm btn-default"><i class="fa fa-file"></i> Export</button></a>
|
||||
<a href="{{ route('admin.services.packs.export', [ $pack->id, 'true' ]) }}"><button type="button" class="pull-right btn btn-sm btn-default" style="margin-right:10px;"><i class="fa fa-download"></i> Export with Files</button></a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{!! Theme::js('js/vendor/ace/ace.js') !!}
|
||||
{!! Theme::js('js/vendor/ace/ext-modelist.js') !!}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find("a[href='/admin/services/packs']").addClass('active');
|
||||
const Editor = ace.edit('build_script');
|
||||
|
||||
Editor.setTheme('ace/theme/chrome');
|
||||
Editor.getSession().setUseWrapMode(true);
|
||||
Editor.setShowPrintMargin(false);
|
||||
Editor.getSession().setMode('ace/mode/sh');
|
||||
Editor.setOptions({
|
||||
minLines: 12,
|
||||
maxLines: Infinity
|
||||
});
|
||||
|
||||
Editor.on('change', event => {
|
||||
$('#editor_contents').val(Editor.getValue());
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -172,6 +172,7 @@
|
|||
{!! Theme::js('js/vendor/ace/ext-modelist.js') !!}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find("a[href='/admin/services/packs']").addClass('active');
|
||||
const Editor = ace.edit('build_script');
|
||||
|
||||
Editor.setTheme('ace/theme/chrome');
|
||||
|
|
|
@ -102,6 +102,7 @@
|
|||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Services <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/admin/services/packs">Service Packs</a></li>
|
||||
<li><a href="/admin/services">List Services</a></li>
|
||||
<li><a href="/admin/services/new">Add Service</a></li>
|
||||
</ul>
|
||||
|
@ -161,6 +162,7 @@
|
|||
</div>
|
||||
<div class="list-group">
|
||||
<a href="#" class="list-group-item list-group-item-heading"><strong>Service Management</strong></a>
|
||||
<a href="/admin/services/packs" class="list-group-item">Service Packs</a>
|
||||
<a href="/admin/services" class="list-group-item">List Services</a>
|
||||
<a href="/admin/services/new" class="list-group-item">Add Service</a>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue