Internal Themes

This commit is contained in:
DDynamic 2016-02-04 17:28:14 -06:00
parent 9a07cc83d1
commit 192498e51a
80 changed files with 20 additions and 1 deletions

View file

@ -1,205 +0,0 @@
{{-- 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.master')
@section('title')
Add File to: {{ $server->name }}
@endsection
@section('scripts')
@parent
<script src="{{ asset('js/binaryjs.js') }}"></script>
@endsection
@section('content')
<div class="col-md-12">
<ul class="nav nav-tabs" id="config_tabs">
<li class="active"><a href="#create" data-toggle="tab">Create File</a></li>
@can('upload-files', $server)<li><a href="#upload" data-toggle="tab">Upload Files</a></li>@endcan
</ul>
<div class="tab-content">
<div class="tab-pane active" id="create">
<div id="write_status" style="display:none;width: 100%; margin: 10px 0 5px;"></div>
<form method="post" id="new_file">
<h4>/home/container/{{ $directory }} <input type="text" id="file_name" class="filename" value="newfile.txt" /></h4>
<div class="form-group">
<div>
<textarea name="file_contents" id="fileContents" style="border: 1px solid #dddddd;" class="form-control console"></textarea>
</div>
</div>
<div class="form-group">
<div>
<button class="btn btn-primary btn-sm" id="create_file">{{ trans('strings.save') }}</button>
<button class="btn btn-default btn-sm" onclick="window.location='/server/{{ $server->uuidShort }}/files?dir=/{{ $directory }}';return false;">{{ trans('server.files.back') }}</button>
</div>
</div>
</form>
</div>
@can('upload-files', $server)
<div class="tab-pane" id="upload">
<h4>/home/container/&nbsp;&nbsp;<input type="text" id="u_file_name" value="{{ $directory }}" style='outline: none;width:450px;background: transparent;margin-left:-5px;padding:0;border: 0px;font-family: "Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight: 250;line-height: 1.1;color: inherit;font-size: 19px;'/></h4>
<div class="alert alert-warning">Please edit the path location above <strong>before you upload files</strong>. They will automatically be placed in the directory you specify above. Simply click next to <code>/home/container/</code> and begin typing. You can change this each time you upload a new file without having to press anything else.</div>
<div class="alert alert-danger" id="upload_error" style="display: none;"></div>
<input type="file" id="fileinput" name="fileUpload[]" multiple="" style="display:none;"/>
<div id="uploader_box" class="well well-sm" style="cursor:pointer;">
<center><h2 style="margin-bottom: 25px;">Connecting...</h2></center>
</div>
<span id="file_progress"></span>
</div>
@endcan
</div>
</div>
<script>
$(window).load(function () {
$('.server-files').addClass('active');
var newFilePath;
var newFileContents;
@can('upload-files', $server)
var client = new BinaryClient('{{ $node->scheme === 'https' ? 'wss' : 'ws' }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/upload/{{ $server->uuid }}', {
chunkSize: 40960
});
// Wait for connection to BinaryJS server
client.on('open', function() {
var box = $('#uploader_box');
box.on('dragenter', doNothing);
box.on('dragover', doNothing);
box.html('<center><h2 style="margin-bottom:25px;">Drag or Click to Upload</h2></center>');
box.on('click', function () {
$('#fileinput').click();
});
box.on('drop', function (e, files) {
if (typeof files !== 'undefined') {
e.originalEvent = {
dataTransfer: {
files: files.currentTarget.files
}
};
}
e.preventDefault();
$.each(e.originalEvent.dataTransfer.files, function(index, value) {
var file = e.originalEvent.dataTransfer.files[index];
var identifier = Math.random().toString(36).slice(2);
$('#file_progress').append('<div class="well well-sm" id="file-upload-' + identifier +'"> \
<div class="row"> \
<div class="col-md-12"> \
<h6>Uploading ' + file.name + '</h6> \
<span class="prog-bar-text-' + identifier +'" style="font-size: 10px;position: absolute;margin: 3px 0 0 15px;">Waiting...</span> \
<div class="progress progress-striped active"> \
<div class="progress-bar progress-bar-info prog-bar-' + identifier +'" style="width: 0%"></div> \
</div> \
</div> \
</div> \
</div>');
// Add to list of uploaded files
var stream = client.send(file, {
token: "{{ $server->daemonSecret }}",
server: "{{ $server->uuid }}",
path: $("#u_file_name").val(),
name: file.name,
size: file.size
});
var tx = 0;
stream.on('data', function(data) {
if(data.error) {
$("#upload_error").html(data.error).show();
$("#file-upload-" + identifier).hide();
} else {
tx += data.rx;
if(tx >= 0.999) {
$('.prog-bar-text-' + identifier).text('Upload Complete');
$('.prog-bar-' + identifier).css('width', '100%').parent().removeClass('active').removeClass('progress-striped');
} else {
$('.prog-bar-text-' + identifier).text(Math.round(tx * 100) + '%');
$('.prog-bar-' + identifier).css('width', tx * 100 + '%');
}
}
});
stream.on('close', function(data) {
$("#upload_error").html("The BinaryJS data stream was closed by the server. Please refresh the page and try again.").show();
$("#file-upload-" + identifier).hide();
});
stream.on('error', function(data) {
console.error("An error was encountered with the BinaryJS upload stream.");
});
});
});
});
// listen for a file being chosen
$('#fileinput').change(function (event) {
$('#uploader_box').trigger('drop', [event, event.currentTarget]);
$('#fileinput').val('');
});
// Deal with DOM quirks
function doNothing (e){
e.preventDefault();
e.stopPropagation();
}
@endcan
$('textarea').keydown(function (e) {
if (e.keyCode === 9) {
var start = this.selectionStart;
var end = this.selectionEnd;
var value = $(this).val();
$(this).val(value.substring(0, start) + '\t' + value.substring(end));
this.selectionStart = this.selectionEnd = start + 1;
e.preventDefault();
}
});
$("#create_file").click(function(e) {
e.preventDefault();
$("#create_file").append(' <i class="fa fa-spinner fa fa-spin"></i>').addClass("disabled");
$.ajax({
type: 'POST',
url: '/server/{{ $server->uuidShort }}/ajax/files/save',
headers: { 'X-CSRF-Token': '{{ csrf_token() }}' },
data: {
file: '{{ $directory }}' + $('#file_name').val(),
contents: $('#fileContents').val()
}
}).done(function (data) {
window.location.replace('/server/{{ $server->uuidShort }}/files/edit/{{ $directory }}' + $('#file_name').val());
}).fail(function (jqXHR) {
$('#write_status').html('<div class="alert alert-danger">' + jqXHR.responseText + '</div>').show();
$('#create_file').html('{{ trans('strings.save') }}').removeClass('disabled');
});
});
});
</script>
@endsection

View file

@ -1,109 +0,0 @@
{{-- 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.master')
@section('title')
Managing Files for: {{ $server->name }}
@endsection
@section('content')
<div class="col-md-12">
<h3 class="nopad"><small>Editing File: /home/container/{{ $file }}</small></h3>
<form method="post" id="editing_file">
<div class="form-group">
<div>
@if (in_array($extension, ['yaml', 'yml']))
<div class="alert alert-info">
{!! trans('server.files.yaml_notice', [
'dropdown' => '<select id="space_yaml">
<option value="2">2</option>
<option value="4" selected="selected">4</option>
<option value="8">8</option>
</select>'
]) !!}
</div>
@endif
<textarea name="file_contents" id="fileContent" style="border: 1px solid #dddddd;height:500px;" class="form-control console">{{ $contents }}</textarea>
</div>
</div>
@can('save-files', $server)
<div class="form-group">
<div>
<input type="hidden" name="file" value="{{ $file }}" />
{!! csrf_field() !!}
<button class="btn btn-primary btn-sm" id="save_file" type="submit">{{ trans('strings.save') }}</button>
<a href="/server/{{ $server->uuidShort }}/files?dir={{ rawurlencode($directory) }}" class="text-muted pull-right"><small>{{ trans('server.files.back') }}</small></a>
</div>
</div>
@endcan
</form>
</div>
<script>
$(document).ready(function () {
$('.server-files').addClass('active');
$('textarea').keydown(function (e) {
if (e.keyCode === 9) {
var start = this.selectionStart;
var end = this.selectionEnd;
var value = $(this).val();
var joinYML = '\t';
var yamlSpaces = 1;
@if (in_array($extension, ['yaml', 'yml']))
yamlSpaces = parseInt($("#space_yaml").val());
joinYML = Array(yamlSpaces + 1).join(" ");
@endif
$(this).val(value.substring(0, start) + joinYML + value.substring(end));
this.selectionStart = this.selectionEnd = start + yamlSpaces;
e.preventDefault();
}
});
@can('save-files', $server)
$('#save_file').click(function (e) {
e.preventDefault();
var fileName = $('input[name="file"]').val();
var fileContents = $('#fileContent').val();
$('#save_file').append(' <i class="fa fa-spinner fa fa-spin"></i>').addClass('disabled');
$.ajax({
type: 'POST',
url: '{{ route('server.files.save', $server->uuidShort) }}',
headers: { 'X-CSRF-Token': '{{ csrf_token() }}' },
data: {
file: fileName,
contents: fileContents
}
}).done(function (data) {
$('#tpl_messages').html('<div class="alert alert-success">{{ trans('server.files.saved') }}</div>').show().delay(3000).slideUp();
}).fail(function (jqXHR) {
$('#tpl_messages').html('<div class="alert alert-danger">' + jqXHR.responseText + '</div>');
}).always(function () {
$('#save_file').html('{{ trans('strings.save') }}').removeClass('disabled');
});
});
@endcan
});
</script>
@endsection

View file

@ -1,175 +0,0 @@
{{-- 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.master')
@section('title')
Managing Files for: {{ $server->name }}
@endsection
@section('content')
<div class="col-md-12">
<div class="row">
<div class="col-md-12" id="internal_alert">
<div class="alert alert-info">
<i class="fa fa-spinner fa-spin"></i> {{ trans('server.files.loading') }}
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="ajax_loading_box"><i class="fa fa-refresh fa-spin" id="position_me"></i></div>
</div>
</div>
<div class="row">
<div class="col-md-12" id="load_files"></div>
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">File Path Information</h3>
</div>
<div class="panel-body">
When configuring any file paths in your server plugins or settings you should use <code>/home/container</code> as your base path. While your SFTP client sees the files as <code>/public</code> this is not true for the server process.
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('.server-files').addClass('active');
});
$(window).load(function(){
var doneLoad = false;
// Show Loading Animation
function handleLoader (show) {
// Hide animation if no files displayed.
if ($('#load_files').height() < 5) { return; }
// Show Animation
if (show === true){
var height = $('#load_files').height();
var width = $('.ajax_loading_box').width();
var center_height = (height / 2) - 30;
var center_width = (width / 2) - 30;
$('#position_me').css({
'top': center_height,
'left': center_width,
'font-size': '60px'
});
$(".ajax_loading_box").css('height', (height + 5)).fadeIn();
} else {
$('.ajax_loading_box').fadeOut(100);
}
}
function reloadActions () {
reloadActionClick();
reloadActionDelete();
}
// Handle folder clicking to load new contents
function reloadActionClick () {
$('a.load_new').click(function (e) {
e.preventDefault();
window.history.pushState(null, null, $(this).attr('href'));
loadDirectoryContents($.urlParam('dir', $(this).attr('href')));
});
}
// Handle Deleting Files
function reloadActionDelete () {
$('a.delete_file').click(function (e) {
e.preventDefault();
var clicked = $(this);
var deleteItemPath = $(this).attr('href');
swal({
type: 'warning',
title: 'Really Delete this File?',
showCancelButton: true,
showConfirmButton: true,
closeOnConfirm: false,
showLoaderOnConfirm: true
}, function () {
$.ajax({
type: 'DELETE',
url: '{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/server/file/' + deleteItemPath,
headers: {
'X-Access-Token': '{{ $server->daemonSecret }}',
'X-Access-Server': '{{ $server->uuid }}'
}
}).done(function (data) {
clicked.parent().parent().parent().parent().fadeOut();
swal({
type: 'success',
title: 'File Deleted'
});
}).fail(function (jqXHR) {
console.error(jqXHR);
swal({
type: 'error',
title: 'Whoops!',
html: true,
text: 'An error occured while attempting to delete this file. Please try again.',
});
});
});
});
}
// Handle Loading Contents
function loadDirectoryContents (dir) {
handleLoader(true);
var outputContent;
var urlDirectory = (dir === null) ? '/' : dir;
$.ajax({
type: 'POST',
url: '{{ route('server.files.directory-list', $server->uuidShort) }}',
headers: { 'X-CSRF-Token': '{{ csrf_token() }}' },
data: { directory: urlDirectory }
}).done(function (data) {
handleLoader(false);
$("#load_files").slideUp(function () {
$("#load_files").html(data).slideDown();
$('[data-toggle="tooltip"]').tooltip();
$('#internal_alert').slideUp();
// Run Actions Again
reloadActions();
});
}).fail(function (jqXHR) {
$("#internal_alert").html('<div class="alert alert-danger">An error occured while attempting to process this request. Please try again.</div>').show();
console.log(jqXHR);
});
}
// Load on Initial Page Load
loadDirectoryContents($.urlParam('dir'));
});
</script>
@endsection

View file

@ -1,105 +0,0 @@
{{-- 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. --}}
<h4 class="nopad">/home/container{{ $directory['header'] }} &nbsp;<small><a href="/server/{{ $server->uuidShort }}/files/add/@if($directory['header'] !== '')?dir={{ $directory['header'] }}@endif" class="text-muted"><i class="fa fa-plus" data-toggle="tooltip" data-placement="top" title="Add New File(s)"></i></a></small></h4>
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th style="width:2%;text-align:center;"></th>
<th style="width:45%">File Name</th>
<th style="width:15%">Size</th>
<th style="width:20%">Last Modified</th>
<th style="width:20%;text-align:center;">Options</th>
</tr>
</thead>
<tbody>
@if (isset($directory['first']) && $directory['first'] === true)
<tr>
<td><i class="fa fa-folder-open" style="margin-left: 0.859px;"></i></td>
<td><a href="/server/{{ $server->uuidShort }}/files" class="load_new">&larr;</a></a></td>
<td></td>
<td></td>
<td></td>
</tr>
@endif
@if (isset($directory['show']) && $directory['show'] === true)
<tr>
<td><i class="fa fa-folder-open" style="margin-left: 0.859px;"></i></td>
<td><a href="/server/{{ $server->uuidShort }}/files?dir={{ rawurlencode($directory['link']) }}" class="load_new">&larr; {{ $directory['link_show'] }}</a></a></td>
<td></td>
<td></td>
<td></td>
</tr>
@endif
@foreach ($folders as $folder)
<tr>
<td><i class="fa fa-folder-open" style="margin-left: 0.859px;"></i></td>
<td><a href="/server/{{ $server->uuidShort }}/files?dir=/@if($folder['directory'] !== ''){{ rawurlencode($folder['directory']) }}/@endif{{ rawurlencode($folder['entry']) }}" class="load_new">{{ $folder['entry'] }}</a></td>
<td>{{ $folder['size'] }}</td>
<td>{{ date('m/d/y H:i:s', $folder['date']) }}</td>
<td style="text-align:center;">
<div class="row" style="text-align:center;">
<div class="col-md-3 hidden-xs hidden-sm"></div>
<div class="col-md-3 hidden-xs hidden-sm">
</div>
<div class="col-md-3">
@can('delete-files', $server)
<a href="@if($folder['directory'] !== ''){{ rawurlencode($folder['directory']) }}/@endif{{ rawurlencode($folder['entry']) }}" class="delete_file"><span class="badge label-danger"><i class="fa fa-trash-o"></i></span></a>
@endcan
</div>
</div>
</td>
</tr>
@endforeach
@foreach ($files as $file)
<tr>
<td><i class="fa fa-file-text" style="margin-left: 2px;"></i></td>
<td>
@if(in_array($file['extension'], $extensions))
@can('edit-files', $server)
<a href="/server/{{ $server->uuidShort }}/files/edit/@if($file['directory'] !== ''){{ rawurlencode($file['directory']) }}/@endif{{ rawurlencode($file['entry']) }}" class="edit_file">{{ $file['entry'] }}</a>
@else
{{ $file['entry'] }}
@endcan
@else
{{ $file['entry'] }}
@endif
</td>
<td>{{ $file['size'] }}</td>
<td>{{ date('m/d/y H:i:s', $file['date']) }}</td>
<td style="text-align:center;">
<div class="row" style="text-align:center;">
<div class="col-md-3 hidden-xs hidden-sm">
</div>
<div class="col-md-3 hidden-xs hidden-sm">
@can('download-files', $server)
<a href="/server/{{ $server->uuidShort }}/files/download/@if($file['directory'] !== ''){{ rawurlencode($file['directory']) }}/@endif{{ rawurlencode($file['entry']) }}"><span class="badge"><i class="fa fa-download"></i></span></a>
@endcan
</div>
<div class="col-md-3">
@can('delete-files', $server)
<a href="@if($file['directory'] !== ''){{ rawurlencode($file['directory']) }}/@endif{{ rawurlencode($file['entry']) }}" class="delete_file"><span class="badge label-danger"><i class="fa fa-trash-o"></i></span>
@endcan
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>

View file

@ -1,589 +0,0 @@
{{-- 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.master')
@section('title')
Viewing Server: {{ $server->name }}
@endsection
@section('scripts')
@parent
<script src="//cdnjs.cloudflare.com/ajax/libs/highcharts/4.2.1/highcharts.js"></script>
@endsection
@section('content')
<div class="col-md-12">
<ul class="nav nav-tabs tabs_with_panel" id="config_tabs">
<li id="triggerConsoleView" class="active"><a href="#console" data-toggle="tab">{{ trans('server.index.control') }}</a></li>
<li><a href="#stats" data-toggle="tab">{{ trans('server.index.usage') }}</a></li>
@can('view-allocation', $server)<li><a href="#allocation" data-toggle="tab">{{ trans('server.index.allocation') }}</a></li>@endcan
</ul>
<div class="tab-content">
<div class="tab-pane active" id="console">
<div class="panel panel-default">
<div class="panel-heading"></div>
<div class="panel-body">
<div class="row">
<div class="col-md-12">
<textarea id="live_console" class="form-control console" readonly="readonly">Loading Previous Content...</textarea>
</div>
<div class="col-md-6">
<hr />
@can('command', $server)
<form action="#" method="post" id="console_command" style="display:none;">
<fieldset>
<div class="input-group">
<input type="text" class="form-control" name="command" id="ccmd" placeholder="{{ trans('server.index.command') }}" />
<span class="input-group-btn">
<button id="sending_command" class="btn btn-primary btn-sm">&rarr;</button>
</span>
</div>
</fieldset>
</form>
<div class="alert alert-danger" id="sc_resp" style="display:none;margin-top: 15px;"></div>
@endcan
</div>
<div class="col-md-6" style="text-align:center;">
<hr />
@can('power-start', $server)<button class="btn btn-success btn-sm disabled" data-attr="power" data-action="start">Start</button>@endcan
@can('power-restart', $server)<button class="btn btn-primary btn-sm disabled" data-attr="power" data-action="restart">Restart</button>@endcan
@can('power-stop', $server)<button class="btn btn-danger btn-sm disabled" data-attr="power" data-action="stop">Stop</button>@endcan
@can('power-kill', $server)<button class="btn btn-danger btn-sm disabled" data-attr="power" data-action="kill"><i class="fa fa-ban" data-toggle="tooltip" data-placement="top" title="Kill Running Process"></i></button>@endcan
<button class="btn btn-primary btn-sm" data-toggle="modal" data-target="#pauseConsole" id="pause_console"><small><i class="fa fa-pause fa-fw"></i></small></button>
<div id="pw_resp" style="display:none;margin-top: 15px;"></div>
</div>
</div>
<div class="row">
<div class="col-md-12" id="stats_players">
<h3>Active Players</h3><hr />
<div id="players_notice" class="alert alert-info">
<i class="fa fa-spinner fa-spin"></i> Waiting for response from server...
</div>
<span id="toggle_players" style="display:none;">
<p class="text-muted">No players are online.</p>
</span>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="stats">
<div class="panel panel-default">
<div class="panel-heading"></div>
<div class="panel-body">
<div class="row">
<div class="col-xs-11 text-center" id="chart_memory" style="height:250px;"></div>
<div class="col-xs-11 text-center" id="chart_cpu" style="height:250px;"></div>
</div>
</div>
</div>
</div>
@can('view-allocation', $server)
<div class="tab-pane" id="allocation">
<div class="panel panel-default">
<div class="panel-heading"></div>
<div class="panel-body">
<div class="alert alert-info">Below is a listing of all avaliable IPs and Ports for your service. To change the default connection address for your server, simply click on the one you would like to make default below.</div>
<ul class="nav nav-pills nav-stacked" id="conn_options">
@foreach ($allocations as $allocation)
<li role="presentation" @if($allocation->ip === $server->ip && $allocation->port === $server->port) class="active" @endif><a href="#/set-connnection/{{ $allocation->ip }}:{{ $allocation->port }}" data-action="set-connection" data-connection="{{ $allocation->ip }}:{{ $allocation->port }}">{{ $allocation->ip }} <span class="badge">{{ $allocation->port }}</span></a></li>
@endforeach
</ul>
</div>
</div>
</div>
@endcan
</div>
<div class="row">
<div class="col-xs-11" id="col11_setter"></div>
</div>
</div>
<div class="modal fade" id="pauseConsole" tabindex="-1" role="dialog" aria-labelledby="PauseConsole" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="PauseConsole">{{ trans('server.index.scrollstop') }}</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<textarea id="paused_console" class="form-control console" readonly="readonly"></textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('strings.close') }}</button>
</div>
</div>
</div>
</div>
@if($server->a_serviceFile === 'minecraft')
<script src="{{ route('server.js', [$server->uuidShort, 'minecraft/eula.js']) }}"></script>
@endif
<script>
$(window).load(function () {
$('[data-toggle="tooltip"]').tooltip();
// -----------------+
// Charting Methods |
// -----------------+
$(window).resize(function() {
$('#chart_memory').highcharts().setSize($('#col11_setter').width(), 250);
$('#chart_cpu').highcharts().setSize($('#col11_setter').width(), 250);
});
$('#chart_memory').highcharts({
chart: {
type: 'area',
animation: Highcharts.svg,
marginRight: 10,
renderTo: 'container',
width: $('#col11_setter').width()
},
colors: [
'#113F8C',
'#00A1CB',
'#01A4A4',
'#61AE24',
'#D0D102',
'#D70060',
'#E54028',
'#F18D05',
'#616161',
'#32742C',
],
credits: {
enabled: false,
},
title: {
text: 'Live Memory Usage',
},
tooltip: {
shared: true,
crosshairs: true,
formatter: function () {
var s = '<b>Memory Usage</b>';
$.each(this.points, function () {
s += '<br/>' + this.series.name + ': ' +
this.y + 'MB';
});
return s;
},
},
xAxis: {
visible: false,
},
yAxis: {
title: {
text: 'Memory Usage (MB)',
},
plotLines: [{
value: 0,
width: 1,
}],
},
plotOptions: {
area: {
fillOpacity: 0.10,
marker: {
enabled: false,
},
},
},
legend: {
enabled: false
},
series: [{
name: 'Total Memory',
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}]
});
$('#chart_cpu').highcharts({
chart: {
type: 'area',
animation: Highcharts.svg,
marginRight: 10,
renderTo: 'container',
width: $('#col11_setter').width()
},
colors: [
'#00A1CB',
'#01A4A4',
'#61AE24',
'#D0D102',
'#D70060',
'#E54028',
'#F18D05',
'#616161',
'#32742C',
],
credits: {
enabled: false,
},
title: {
text: 'Live CPU Usage',
},
tooltip: {
shared: true,
crosshairs: true,
formatter: function () {
var s = '<b>CPU Usage</b>';
var i = 0;
var t = 0;
$.each(this.points, function () {
t = t + this.y;
i++;
s += '<br/>' + this.series.name + ': ' +
this.y + '%';
});
t = parseFloat(t).toFixed(3).toString();
if (i > 1) {
return s + '<br />Combined: ' + t;
} else {
return s;
}
},
},
xAxis: {
visible: false,
},
yAxis: {
title: {
text: 'CPU Usage (%)',
},
plotLines: [{
value: 0,
width: 1,
}],
},
plotOptions: {
area: {
fillOpacity: 0.10,
stacking: 'normal',
lineWidth: 1,
marker: {
enabled: false,
},
},
},
legend: {
enabled: true
},
series: [{
name: 'Core 0',
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}]
});
// Socket Recieves New Server Stats
var activeChartArrays = [];
socket.on('proc', function (proc) {
var MemoryChart = $('#chart_memory').highcharts();
MemoryChart.series[0].addPoint(parseInt(proc.data.memory.total / (1024 * 1024)), true, true);
var CPUChart = $('#chart_cpu').highcharts();
// Remove blank values from listing
var activeCores = [];
for (i = 0, length = proc.data.cpu.cores.length; i < length; i++) {
if (proc.data.cpu.cores[i] > 0) {
activeCores.push(proc.data.cpu.cores[i]);
}
}
var modifedActiveCores = { '0': 0 };
for (i = 0, length = activeCores.length; i < length; i++) {
if (i > 7) {
modifedActiveCores['0'] = modifedActiveCores['0'] + activeCores[i];
} else {
if (activeChartArrays.indexOf(i) < 0) {
activeChartArrays.push(i);
}
modifedActiveCores[i] = activeCores[i];
}
}
console.log(activeChartArrays);
console.log(modifedActiveCores);
for (i = 0, length = activeChartArrays.length; i < length; i++) {
if (typeof CPUChart.series[i] === 'undefined') {
CPUChart.addSeries({
name: 'Core ' + i,
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
});
}
if({{ $server->cpu }} > 0) {
CPUChart.series[i].addPoint(parseFloat((((modifedActiveCores[i] || 0)/ {{ $server->cpu }}) * 100).toFixed(3).toString()), true, true);
} else {
CPUChart.series[i].addPoint(modifedActiveCores[i] || 0, true, true);
}
}
});
// Socket Recieves New Query
socket.on('query', function (data){
if($('#players_notice').is(':visible')){
$('#players_notice').hide();
$('#toggle_players').show();
}
if(data['data'].players != undefined && data['data'].players.length !== 0){
$('#toggle_players').html('');
$.each(data['data'].players, function(id, d) {
$('#toggle_players').append('<code>' + d.name + '</code>,');
});
}else{
$('#toggle_players').html('<p class=\'text-muted\'>No players are currently online.</p>');
}
});
// New Console Data Recieved
socket.on('console', function (data) {
$('#live_console').val($('#live_console').val() + data.line);
$('#live_console').scrollTop($('#live_console')[0].scrollHeight);
});
// Update Listings on Initial Status
socket.on('initial_status', function (data) {
if (data.status !== 0) {
$.ajax({
type: 'GET',
headers: {
'X-Access-Token': '{{ $server->daemonSecret }}',
'X-Access-Server': '{{ $server->uuid }}'
},
url: '{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/server/log',
timeout: 10000
}).done(function(data) {
$('#live_console').val(data);
$('#live_console').scrollTop($('#live_console')[0].scrollHeight);
}).fail(function(jqXHR, textStatus, errorThrown) {
alert('Unable to load initial server log, try reloading the page.');
});
} else {
$('#live_console').val('Server is currently off.');
}
updateServerPowerControls(data.status);
updatePlayerListVisibility(data.status);
});
// Update Listings on Status
socket.on('status', function (data) {
updateServerPowerControls(data.status);
updatePlayerListVisibility(data.status);
});
// Scroll to the top of the Console when switching to that tab.
$('#triggerConsoleView').click(function () {
$('#live_console').scrollTop($('#live_console')[0].scrollHeight);
});
if($('triggerConsoleView').is(':visible')) {
$('#live_console').scrollTop($('#live_console')[0].scrollHeight);
}
$('a[data-toggle=\'tab\']').on('shown.bs.tab', function (e) {
$('#live_console').scrollTop($('#live_console')[0].scrollHeight);
});
// Load Paused Console with Live Console Data
$('#pause_console').click(function(){
$('#paused_console').val($('#live_console').val());
});
function updatePlayerListVisibility(data) {
// Server is On or Starting
if(data !== 0) {
$('#stats_players').show();
} else {
$('#stats_players').hide();
}
}
@can('set-allocation', $server)
// Send Request
$('[data-action="set-connection"]').click(function (event) {
event.preventDefault();
var element = $(this);
if (element.hasClass('active')) {
return;
}
$.ajax({
method: 'POST',
url: '/server/{{ $server->uuidShort }}/ajax/set-connection',
data: {
connection: element.data('connection')
},
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
}
}).done(function (data) {
swal({
type: 'success',
title: '',
text: data
});
$('#conn_options').find('li.active').removeClass('active');
element.parent().addClass('active');
}).fail(function (jqXHR) {
console.error(jqXHR);
var respError;
if (typeof jqXHR.responseJSON.error === 'undefined' || jqXHR.responseJSON.error === '') {
respError = 'An error occured while attempting to perform this action.';
} else {
respError = jqXHR.responseJSON.error;
}
swal({
type: 'error',
title: 'Whoops!',
text: respError
});
});
});
@endcan
@can('command', $server)
// Send Command to Server
$('#console_command').submit(function (event) {
event.preventDefault();
var ccmd = $('#ccmd').val();
if (ccmd == '') {
return;
}
$('#sending_command').html('<i class=\'fa fa-refresh fa-spin\'></i>').addClass('disabled');
$.ajax({
type: 'POST',
headers: {
'X-Access-Token': '{{ $server->daemonSecret }}',
'X-Access-Server': '{{ $server->uuid }}'
},
contentType: 'application/json; charset=utf-8',
url: '{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/server/command',
timeout: 10000,
data: JSON.stringify({ command: ccmd })
}).fail(function (jqXHR) {
console.error(jqXHR);
var error = 'An error occured while trying to process this request.';
if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {
error = jqXHR.responseJSON.error;
}
swal({
type: 'error',
title: 'Whoops!',
text: error
});
}).done(function () {
$('#ccmd').val('');
}).always(function () {
$('#sending_command').html('&rarr;').removeClass('disabled');
});
});
@endcan
var can_run = true;
function updateServerPowerControls (data) {
// Reset Console Data
if (data === 2) {
$('#live_console').val($('#live_console').val() + '\n --+ Server Detected as Booting + --\n');
$('#live_console').scrollTop($('#live_console')[0].scrollHeight);
}
// Server is On or Starting
if(data == 1 || data == 2) {
$("#console_command").slideDown();
$('[data-attr="power"][data-action="start"]').addClass('disabled');
$('[data-attr="power"][data-action="stop"], [data-attr="power"][data-action="restart"]').removeClass('disabled');
} else {
$("#console_command").slideUp();
$('[data-attr="power"][data-action="start"]').removeClass('disabled');
$('[data-attr="power"][data-action="stop"], [data-attr="power"][data-action="restart"]').addClass('disabled');
}
if(data !== 0) {
$('[data-attr="power"][data-action="kill"]').removeClass('disabled');
} else {
$('[data-attr="power"][data-action="kill"]').addClass('disabled');
}
}
$('[data-attr="power"]').click(function (event) {
event.preventDefault();
var action = $(this).data('action');
var killConfirm = false;
if (action === 'kill') {
swal({
type: 'warning',
title: '',
text: 'This operation will not save your server data gracefully. You should only use this if your server is failing to respond to normal stop commands.',
showCancelButton: true,
allowOutsideClick: true,
closeOnConfirm: true,
confirmButtonText: 'Kill Server',
confirmButtonColor: '#d9534f'
}, function () {
setTimeout(function() {
powerToggleServer('kill');
}, 100);
});
} else {
powerToggleServer(action);
}
});
function powerToggleServer(action) {
$.ajax({
type: 'PUT',
headers: {
'X-Access-Token': '{{ $server->daemonSecret }}',
'X-Access-Server': '{{ $server->uuid }}'
},
contentType: 'application/json; charset=utf-8',
data: JSON.stringify({
action: action
}),
url: '{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/server/power',
timeout: 10000
}).fail(function(jqXHR) {
var error = 'An error occured while trying to process this request.';
if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {
error = jqXHR.responseJSON.error;
}
swal({
type: 'error',
title: 'Whoops!',
text: error
});
});
}
});
$(document).ready(function () {
$('.server-index').addClass('active');
});
</script>
@endsection

View file

@ -1,61 +0,0 @@
{{-- 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. --}}
$(window).load(function () {
socket.on('console', function (data) {
if (data.line.indexOf('You need to agree to the EULA in order to run the server') > -1) {
swal({
title: 'EULA Acceptance',
text: 'By pressing \'I Accept\' below you are indicating your agreement to the <a href="https://account.mojang.com/documents/minecraft_eula" target="_blank">Mojang EULA</a>.',
type: 'info',
html: true,
showCancelButton: true,
showConfirmButton: true,
cancelButtonText: 'I do not Accept',
confirmButtonText: 'I Accept',
closeOnConfirm: false,
showLoaderOnConfirm: true
}, function () {
$.ajax({
type: 'POST',
url: '{{ route('server.files.save', $server->uuidShort) }}',
headers: { 'X-CSRF-Token': '{{ csrf_token() }}' },
data: {
file: 'eula.txt',
contents: 'eula=true'
}
}).done(function (data) {
$('[data-attr="power"][data-action="start"]').trigger('click');
swal({
type: 'success',
title: '',
text: 'The EULA for this server has been accepted, restarting server now.',
});
}).fail(function (jqXHR) {
console.error(jqXHR);
swal({
title: 'Whoops!',
text: 'An error occured while attempting to set the EULA as accepted: ' . jqXHR.responseJSON.error,
type: 'error'
})
});
});
}
});
});

View file

@ -1,150 +0,0 @@
{{-- 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.master')
@section('title')
Server Settings
@endsection
@section('content')
<div class="col-md-12">
<h3 class="nopad">Server Settings</h3><hr />
<ul class="nav nav-tabs tabs_with_panel" id="config_tabs">
@can('view-sftp', $server)<li class="active"><a href="#tab_sftp" data-toggle="tab">SFTP Settings</a></li>@endcan
@can('view-startup', $server)<li><a href="#tab_startup" data-toggle="tab">Startup Configuration</a></li>@endcan
</ul>
<div class="tab-content">
@can('view-sftp', $server)
<div class="tab-pane active" id="tab_sftp">
<div class="panel panel-default">
<div class="panel-heading"></div>
<div class="panel-body">
<div class="row">
<div class="form-group col-md-6">
<label class="control-label">SFTP Connection Address:</label>
<div>
<input type="text" readonly="readonly" class="form-control" value="{{ $node->fqdn }}:{{ $node->daemonSFTP }}" />
</div>
</div>
<div class="form-group col-md-6">
<label class="control-label">SFTP Username:</label>
<div>
<input type="text" readonly="readonly" class="form-control" value="{{ $server->username }}" />
</div>
</div>
</div>
@can('reset-sftp', $server)
<form action="{{ route('server.settings.sftp', $server->uuidShort) }}" method="POST">
<div class="row">
<div class="form-group col-md-6">
<label class="control-label">New SFTP Password:</label>
<div>
<input type="password" name="sftp_pass" class="form-control" />
<p class="text-muted"><small>Passwords must meet the following requirements: at least one uppercase character, one lowercase character, one digit, and be at least 8 characters in length. <a href="#" data-action="generate-password">Click here</a> to generate one to use.</small></p>
</div>
</div>
<div class="form-group col-md-6">
<label class="control-label">&nbsp;</label>
<div>
{!! csrf_field() !!}
<input type="submit" class="btn btn-sm btn-primary" value="Update Password" />
</div>
</div>
</div>
</form>
@endcan
</div>
</div>
</div>
@endcan
@can('view-startup', $server)
<div class="tab-pane" id="tab_startup">
<form action="{{ route('server.settings.startup', $server->uuidShort) }}" method="POST">
<div class="panel panel-default">
<div class="panel-heading"></div>
<div class="panel-body">
<div class="row">
<div class="form-group col-md-12">
<label class="control-label">Startup Command:</label>
<div class="input-group">
<span class="input-group-addon">{{ $service->executable }}</span>
<input type="text" class="form-control" readonly="readonly" value="{{ $processedStartup }}" />
</div>
</div>
</div>
</div>
@can('edit-startup', $server)
<div class="panel-heading" style="border-top: 1px solid #ddd;"></div>
<div class="panel-body">
<div class="row">
@foreach($variables as $item)
<div class="form-group col-md-6">
<label class="control-label">
@if($item->required === 1)<span class="label label-primary">Required</span> @endif
{{ $item->name }}
</label>
<div>
<input type="text"
@if($item->user_editable === 1)
name="{{ $item->env_variable }}"
@else
readonly="readonly"
@endif
class="form-control" value="{{ old($item->env_variable, $item->a_serverValue) }}" data-action="matchRegex" data-regex="{{ $item->regex }}" />
</div>
<p class="text-muted"><small>{{ $item->description }}<br />Regex: <code>{{ $item->regex }}</code><br />Access as: <code>&#123;&#123;{{$item->env_variable}}&#125;&#125;</code></small></p>
</div>
@endforeach
</div>
</div>
<div class="panel-heading" style="border-top: 1px solid #ddd;"></div>
<div class="panel-body">
<div class="row">
<div class="col-md-12">
{!! csrf_field() !!}
<input type="submit" class="btn btn-primary btn-sm" value="Update Startup Arguments" />
</div>
</div>
</div>
@endcan
</div>
</form>
</div>
@endcan
</div>
</div>
<script>
$(document).ready(function () {
$('.server-settings').addClass('active');
$('[data-action="matchRegex"]').keyup(function (event) {
if (!$(this).data('regex')) return;
var input = $(this).val();
console.log(escapeRegExp($(this).data('regex')));
var regex = new RegExp(escapeRegExp($(this).data('regex')));
console.log(regex);
if (!regex.test(input)) {
$(this).parent().parent().removeClass('has-success').addClass('has-error');
} else {
$(this).parent().parent().removeClass('has-error').addClass('has-success');
}
});
});
</script>
@endsection

View file

@ -1,109 +0,0 @@
{{-- 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.master')
@section('title')
Viewing Subusers
@endsection
@section('content')
<div class="col-md-12">
<h3 class="nopad">Manage Sub-Users</h3><hr />
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Email</th>
<th>Created</th>
<th>Modified</th>
@can('view-subuser', $server)<th></th>@endcan
@can('delete-subuser', $server)<th></th>@endcan
</tr>
</thead>
<tbody>
@foreach($subusers as $user)
<tr>
<td><code>{{ $user->a_userEmail }}</code></td>
<td>{{ $user->created_at }}</td>
<td>{{ $user->updated_at }}</td>
@can('view-subuser', $server)
<td class="text-center"><a href="{{ route('server.subusers.view', ['server' => $server->uuidShort, 'id' => md5($user->id)]) }}" class="text-success"><i class="fa fa-wrench"></i></a></td>
@endcan
@can('delete-subuser', $server)
<td class="text-center"><a href="#/delete/{{ md5($user->id) }}" data-action="delete" data-id="{{ md5($user->id) }}" class="text-danger"><i class="fa fa-trash-o"></i></a></td>
@endcan
</tr>
@endforeach
</tbody>
</table>
@can('create-subuser', $server)
<div class="well">
<div class="row">
<div class="col-md-12">
<a href="{{ route('server.subusers.new', $server->uuidShort) }}"><button class="btn btn-sm btn-success">Add New Subuser</button></a>
</div>
</div>
</div>
@endcan
</div>
<script>
$(document).ready(function () {
$('.server-users').addClass('active');
$('[data-action="delete"]').click(function (event) {
event.preventDefault();
var self = $(this);
swal({
type: 'warning',
title: 'Delete Subuser',
text: 'This will immediately remove this user from this server and revoke all permissions.',
showCancelButton: true,
showConfirmButton: true,
closeOnConfirm: false,
showLoaderOnConfirm: true
}, function () {
$.ajax({
method: 'DELETE',
url: '{{ route('server.subusers', $server->uuidShort) }}/delete/' + self.data('id'),
headers: {
'X-CSRF-Token': '{{ csrf_token() }}'
}
}).done(function () {
self.parent().parent().slideUp();
swal({
type: 'success',
title: '',
text: 'Subuser was successfully deleted.'
});
}).fail(function (jqXHR) {
console.error(jqXHR);
var error = 'An error occured while trying to process this request.';
if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {
error = jqXHR.responseJSON.error;
}
swal({
type: 'error',
title: 'Whoops!',
text: error
});
});
});
});
});
</script>
@endsection

View file

@ -1,207 +0,0 @@
{{-- 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.master')
@section('title')
Create New Subuser
@endsection
@section('content')
<div class="col-md-12">
<h3 class="nopad">Create New Subuser<hr />
@can('edit-subuser', $server)
<form action="{{ route('server.subusers.new', $server->uuidShort) }}" method="POST">
@endcan
<?php $oldInput = array_flip(is_array(old('permissions')) ? old('permissions') : []) ?>
<div class="row">
<div class="form-group col-md-12">
<label class="control-label">User Email:</label>
<div>
<input type="text" name="email" autocomplete="off" value="{{ old('email') }}" class="form-control" />
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 fuelux">
<h4>Power Management</h4><hr />
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['power-start']))checked="checked"@endif value="power-start"> <strong>Start Server</strong>
<p class="text-muted"><small>Allows user to start server.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['power-stop']))checked="checked"@endif value="power-stop"> <strong>Stop Server</strong>
<p class="text-muted"><small>Allows user to stop server.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['power-restart']))checked="checked"@endif value="power-restart"> <strong>Restart Server</strong>
<p class="text-muted"><small>Allows user to restart server. A user with this permission can stop or start a server even without the above permissions.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['power-kill']))checked="checked"@endif value="power-kill"> <strong>Kill Server</strong>
<p class="text-muted"><small>Allows user to kill server process.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['send-command']))checked="checked"@endif value="send-command"> <strong>Send Console Command</strong>
<p class="text-muted"><small>Allows sending a command from the console. If the user does not have stop or restart permissions they cannot send the application's stop command.</small><p>
</label>
</div>
</div>
<div class="col-md-6 fuelux">
<h4>File Management</h4><hr />
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['list-files']))checked="checked"@endif value="list-files"> <strong>List Files</strong>
<p class="text-muted"><small>Allows user to list all files and folders on the server but not view file contents.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['edit-files']))checked="checked"@endif value="edit-files"> <strong>Edit Files</strong>
<p class="text-muted"><small>Allows user to open a file for <em>viewing only</em>.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['save-files']))checked="checked"@endif value="save-files"> <strong>Save Files</strong>
<p class="text-muted"><small>Allows user to save modified file contents.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['add-files']))checked="checked"@endif value="add-files"> <strong>Create Files</strong>
<p class="text-muted"><small>Allows user to create a new file within the panel.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['upload-files']))checked="checked"@endif value="upload-files"> <strong>Upload Files</strong>
<p class="text-muted"><small>Allows user to upload files.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['delete-files']))checked="checked"@endif value="delete-files"> <strong>Delete Files</strong>
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows user to delete files from the system.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['download-files']))checked="checked"@endif value="download-files"> <strong>Download Files</strong>
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows user to download files. If a user is given this permission they can download and view file contents.</small><p>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 fuelux">
<h4>Subuser Management</h4><hr />
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['list-subusers']))checked="checked"@endif value="list-subusers"> <strong>List Subusers</strong>
<p class="text-muted"><small>Allows user to view all subusers assigned to the server.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['view-subuser']))checked="checked"@endif value="view-subuser"> <strong>View Subuser</strong>
<p class="text-muted"><small>Allows user to view specific subuser permissions.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['edit-subuser']))checked="checked"@endif value="edit-subuser"> <strong>Edit Subuser</strong>
<p class="text-muted"><small>Allows user to modify permissions for a subuser. <em>They will not have permission to modify themselves.</em></small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['create-subuser']))checked="checked"@endif value="create-subuser"> <strong>Create Subuser</strong>
<p class="text-muted"><small>Allows a user to create a new subuser.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['delete-subuser']))checked="checked"@endif value="delete-subuser"> <strong>Delete Subuser</strong>
<p class="text-muted"><small>Allows a user to delete a subuser.</small><p>
</label>
</div>
</div>
<div class="col-md-6 fuelux">
<h4>Server Management</h4><hr />
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['set-connection']))checked="checked"@endif value="set-connection"> <strong>Set Default Connection</strong>
<p class="text-muted"><small>Allows user to set the default connection used for a server as well as view avaliable ports.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['view-startup']))checked="checked"@endif value="view-startup"> <strong>View Startup Command</strong>
<p class="text-muted"><small>Allows user to view the startup command and associated variables for a server.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['edit-startup']))checked="checked"@endif value="edit-startup"> <strong>Edit Startup Command</strong>
<p class="text-muted"><small>Allows a user to modify startup variables for a server.</small><p>
</label>
</div>
<h4>SFTP Management</h4><hr />
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['view-sftp']))checked="checked"@endif value="view-sftp"> <strong>View SFTP Details</strong>
<p class="text-muted"><small>Allows user to view the server's SFTP information (not the password).</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['reset-sftp']))checked="checked"@endif value="reset-sftp"> <strong>Reset SFTP Password</strong>
<p class="text-muted"><small>Allows user to change the SFTP password for the server.</small><p>
</label>
</div>
</div>
</div>
@can('edit-subuser', $server)
<div class="well">
<div class="row">
<div class="col-md-12">
{!! csrf_field() !!}
<input type="submit" class="btn btn-sm btn-primary" value="Add New Subuser" />
</div>
</div>
</div>
</form>
@endcan
</div>
<script>
$(document).ready(function () {
$('.server-users').addClass('active');
});
</script>
@endsection

View file

@ -1,198 +0,0 @@
{{-- 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.master')
@section('title')
Manage Subuser: {{ $subuser->a_userEmail }}
@endsection
@section('content')
<div class="col-md-12">
<h3 class="nopad">Manage Subuser <span class="label label-primary">{{ $subuser->a_userEmail }}</span></h3><hr />
@can('edit-subuser', $server)
<form action="{{ route('server.subusers.view', ['uuid' => $server->uuidShort, 'id' => md5($subuser->id) ])}}" method="POST">
@endcan
<div class="row">
<div class="col-md-6 fuelux">
<h4>Power Management</h4><hr />
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['power-start']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="power-start"> <strong>Start Server</strong>
<p class="text-muted"><small>Allows user to start server.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['power-stop']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="power-stop"> <strong>Stop Server</strong>
<p class="text-muted"><small>Allows user to stop server.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['power-restart']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="power-restart"> <strong>Restart Server</strong>
<p class="text-muted"><small>Allows user to restart server. A user with this permission can stop or start a server even without the above permissions.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['power-kill']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="power-kill"> <strong>Kill Server</strong>
<p class="text-muted"><small>Allows user to kill server process.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['send-command']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="send-command"> <strong>Send Console Command</strong>
<p class="text-muted"><small>Allows sending a command from the console. If the user does not have stop or restart permissions they cannot send the application's stop command.</small><p>
</label>
</div>
</div>
<div class="col-md-6 fuelux">
<h4>File Management</h4><hr />
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['list-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="list-files"> <strong>List Files</strong>
<p class="text-muted"><small>Allows user to list all files and folders on the server but not view file contents.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['edit-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="edit-files"> <strong>Edit Files</strong>
<p class="text-muted"><small>Allows user to open a file for <em>viewing only</em>.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['save-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="save-files"> <strong>Save Files</strong>
<p class="text-muted"><small>Allows user to save modified file contents.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['add-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="add-files"> <strong>Create Files</strong>
<p class="text-muted"><small>Allows user to create a new file within the panel.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['upload-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="upload-files"> <strong>Upload Files</strong>
<p class="text-muted"><small>Allows user to upload files.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['delete-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="delete-files"> <strong>Delete Files</strong>
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows user to delete files from the system.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['download-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="download-files"> <strong>Download Files</strong>
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows user to download files. If a user is given this permission they can download and view file contents.</small><p>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 fuelux">
<h4>Subuser Management</h4><hr />
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['list-subusers']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="list-subusers"> <strong>List Subusers</strong>
<p class="text-muted"><small>Allows user to view all subusers assigned to the server.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['view-subuser']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="view-subuser"> <strong>View Subuser</strong>
<p class="text-muted"><small>Allows user to view specific subuser permissions.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['edit-subuser']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="edit-subuser"> <strong>Edit Subuser</strong>
<p class="text-muted"><small>Allows user to modify permissions for a subuser. <em>They will not have permission to modify themselves.</em></small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['create-subuser']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="create-subuser"> <strong>Create Subuser</strong>
<p class="text-muted"><small>Allows a user to create a new subuser.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['delete-subuser']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="delete-subuser"> <strong>Delete Subuser</strong>
<p class="text-muted"><small>Allows a user to delete a subuser.</small><p>
</label>
</div>
</div>
<div class="col-md-6 fuelux">
<h4>Server Management</h4><hr />
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['set-connection']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="set-connection"> <strong>Set Default Connection</strong>
<p class="text-muted"><small>Allows user to set the default connection used for a server as well as view avaliable ports.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['view-startup']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="view-startup"> <strong>View Startup Command</strong>
<p class="text-muted"><small>Allows user to view the startup command and associated variables for a server.</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['edit-startup']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="edit-startup"> <strong>Edit Startup Command</strong>
<p class="text-muted"><small>Allows a user to modify startup variables for a server.</small><p>
</label>
</div>
<h4>SFTP Management</h4><hr />
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['view-sftp']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="view-sftp"> <strong>View SFTP Details</strong>
<p class="text-muted"><small>Allows user to view the server's SFTP information (not the password).</small><p>
</label>
</div>
<div class="checkbox highlight">
<label class="checkbox-custom highlight" data-initialize="checkbox">
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['reset-sftp']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="reset-sftp"> <strong>Reset SFTP Password</strong>
<p class="text-muted"><small>Allows user to change the SFTP password for the server.</small><p>
</label>
</div>
</div>
</div>
@can('edit-subuser', $server)
<div class="well">
<div class="row">
<div class="col-md-12">
{!! csrf_field() !!}
<input type="submit" class="btn btn-sm btn-primary" value="Modify Subuser" />
</div>
</div>
</div>
</form>
@endcan
</div>
<script>
$(document).ready(function () {
$('.server-users').addClass('active');
});
</script>
@endsection