Update views, remove old theme views
This commit is contained in:
parent
fa0f32584e
commit
19da4eda04
23 changed files with 7 additions and 3949 deletions
|
@ -1,290 +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
|
||||
{!! Theme::js('js/vendor/upload/client.min.js') !!}
|
||||
{!! Theme::js('js/vendor/lodash/lodash.js') !!}
|
||||
@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 class="row" style="margin: 15px 0 0;">
|
||||
<div class="col-md-8" style="padding-left:0;">
|
||||
<div class="input-group" style="margin-bottom:5px;">
|
||||
<span class="input-group-addon">Save As:</span>
|
||||
<input type="text" class="form-control" id="file_name" placeholder="filename.json" value="{{ $directory}}">
|
||||
</div>
|
||||
<small><p class="text-muted">All files are saved relative to <code>/home/container</code>. You can enter more of the path into the Save As field to save the file into a specific folder.</p></small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<div id="fileContents" style="height:500px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<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 class="col-md-4 pull-right">
|
||||
<select name="aceMode" id="aceMode" class="form-control">
|
||||
<option value="assembly_x86">Assembly x86</option>
|
||||
<option value="c_cpp">C/C++</option>
|
||||
<option value="coffee">CoffeeScript</option>
|
||||
<option value="csharp">C#</option>
|
||||
<option value="css">CSS</option>
|
||||
<option value="golang">Go</option>
|
||||
<option value="haml">HAML</option>
|
||||
<option value="html">HTML</option>
|
||||
<option value="ini">INI</option>
|
||||
<option value="java">Java</option>
|
||||
<option value="javascript">JavaScript</option>
|
||||
<option value="json">JSON</option>
|
||||
<option value="lua">Lua</option>
|
||||
<option value="markdown">Markdown</option>
|
||||
<option value="mysql">MySQL</option>
|
||||
<option value="objectivec">Objective-C</option>
|
||||
<option value="perl">Perl</option>
|
||||
<option value="php">PHP</option>
|
||||
<option value="properties">Properties</option>
|
||||
<option value="python">Python</option>
|
||||
<option value="ruby">Ruby</option>
|
||||
<option value="rust">Rust</option>
|
||||
<option value="smarty">Smarty</option>
|
||||
<option value="textile" selected="selected">Plain Text</option>
|
||||
<option value="xml">XML</option>
|
||||
<option value="yaml">YAML</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@can('upload-files', $server)
|
||||
<div class="tab-pane" id="upload">
|
||||
<div class="row" style="margin: 15px 0 0;">
|
||||
<div class="col-md-8" style="padding-left:0;">
|
||||
<div class="input-group" style="margin-bottom:5px;">
|
||||
<span class="input-group-addon">Upload Directory:</span>
|
||||
<input type="text" class="form-control" id="u_file_name" placeholder="logs/" value="{{ $directory}}">
|
||||
</div>
|
||||
<small><p class="text-muted">All files are saved relative to <code>/home/container</code>. You can enter more of the path into the Save As field to save the file into a specific folder.</p></small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-warning">Edit the path location above <strong>before you upload files</strong>. They will automatically be placed in the directory you specify above. You can change this each time you upload a new file without having to press anything else. <em>The directory must exist before performing an upload.</em></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="upload_box" class="well well-sm" style="cursor:pointer;">
|
||||
<center>
|
||||
<h2 style="margin-bottom: 25px;">Drag and Drop File(s) Here</h2>
|
||||
<p class="text-muted">The maximum size for web-based file uploads is currently <code>{{ $node->upload_size }} MB</code>.</p>
|
||||
</center>
|
||||
</div>
|
||||
<span id="file_progress"></span>
|
||||
</div>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
{!! Theme::js('js/vendor/ace/ace.js') !!}
|
||||
{!! Theme::js('js/vendor/ace/ext-modelist.js') !!}
|
||||
<script>
|
||||
$(window).load(function () {
|
||||
|
||||
$('.server-files').addClass('active');
|
||||
|
||||
var newFilePath;
|
||||
var newFileContents;
|
||||
|
||||
@can('upload-files', $server)
|
||||
var notifyUploadSocketError = false;
|
||||
var uploadSocket = io('{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/upload/{{ $server->uuid }}', {
|
||||
'query': 'token={{ $server->daemonSecret }}'
|
||||
});
|
||||
|
||||
socket.io.on('connect_error', function (err) {
|
||||
siofu.destroy();
|
||||
$('#applyUpdate').removeClass('fa-circle-o-notch fa-spinner fa-spin').addClass('fa-question-circle').css({ color: '#FF9900' });
|
||||
if(typeof notifyUploadSocketError !== 'object') {
|
||||
notifyUploadSocketError = $.notify({
|
||||
message: 'There was an error connecting to the Upload Socket for this server.'
|
||||
}, {
|
||||
type: 'danger',
|
||||
delay: 0
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
uploadSocket.on('error', err => {
|
||||
siofu.destroy();
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
uploadSocket.on('connect', function () {
|
||||
if (notifyUploadSocketError !== false) {
|
||||
notifyUploadSocketError.close();
|
||||
notifyUploadSocketError = false;
|
||||
}
|
||||
});
|
||||
|
||||
var dropCounter = 0;
|
||||
$('#upload_box').bind({
|
||||
dragenter: function (event) {
|
||||
event.preventDefault();
|
||||
dropCounter++;
|
||||
$(this).addClass('hasFileHover');
|
||||
},
|
||||
dragleave: function (event) {
|
||||
dropCounter--;
|
||||
if (dropCounter === 0) {
|
||||
$(this).removeClass('hasFileHover');
|
||||
}
|
||||
},
|
||||
drop: function (event) {
|
||||
dropCounter = 0;
|
||||
$(this).removeClass('hasFileHover');
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('error', function (err) {
|
||||
console.error('There was an error while attemping to connect to the websocket: ' + err + '\n\nPlease try loading this page again.');
|
||||
});
|
||||
|
||||
var siofu = new SocketIOFileUpload(uploadSocket);
|
||||
|
||||
document.getElementById("upload_box").addEventListener("click", siofu.prompt, false);
|
||||
siofu.listenOnDrop(document.getElementById("upload_box"));
|
||||
|
||||
siofu.addEventListener('start', function (event) {
|
||||
event.file.meta.path = $("#u_file_name").val();
|
||||
event.file.meta.identifier = Math.random().toString(36).slice(2);
|
||||
|
||||
$('#file_progress').append('<div class="well well-sm" id="file-upload-' + event.file.meta.identifier +'"> \
|
||||
<div class="row"> \
|
||||
<div class="col-md-12"> \
|
||||
<h6>Uploading ' + event.file.name + '</h6> \
|
||||
<span class="prog-bar-text-' + event.file.meta.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-' + event.file.meta.identifier +'" style="width: 0%"></div> \
|
||||
</div> \
|
||||
</div> \
|
||||
</div> \
|
||||
</div>');
|
||||
});
|
||||
|
||||
siofu.addEventListener('progress', function(event) {
|
||||
var percent = event.bytesLoaded / event.file.size * 100;
|
||||
if (percent >= 100) {
|
||||
$('.prog-bar-text-' + event.file.meta.identifier).text('Upload Complete');
|
||||
$('.prog-bar-' + event.file.meta.identifier).css('width', '100%').removeClass('progress-bar-info').addClass('progress-bar-success').parent().removeClass('active progress-striped');
|
||||
$('.prog-bar-text-' + event.file.meta.identifier).parents().eq(2).delay(5000).slideUp();
|
||||
} else {
|
||||
$('.prog-bar-text-' + event.file.meta.identifier).text(Math.round(percent) + '%');
|
||||
$('.prog-bar-' + event.file.meta.identifier).css('width', percent + '%');
|
||||
}
|
||||
});
|
||||
|
||||
// Do something when a file is uploaded:
|
||||
siofu.addEventListener('complete', function(event){
|
||||
if (!event.success) {
|
||||
$("#upload_error").html('An error was encountered while attempting to upload this file: <strong>' + event.message + '.</strong>').show();
|
||||
$("#file-upload-" + event.file.meta.identifier).hide();
|
||||
}
|
||||
});
|
||||
|
||||
siofu.addEventListener('error', function(event){
|
||||
$("#upload_error").html('An error was encountered while attempting to upload this file: <strong>' + event.message + '.</strong>').show();
|
||||
$("#file-upload-" + event.file.meta.identifier).hide();
|
||||
});
|
||||
|
||||
@endcan
|
||||
|
||||
const Editor = ace.edit('fileContents');
|
||||
|
||||
Editor.setTheme('ace/theme/chrome');
|
||||
Editor.getSession().setUseWrapMode(true);
|
||||
Editor.setShowPrintMargin(false);
|
||||
|
||||
$('#aceMode').on('change', event => {
|
||||
Editor.getSession().setMode(`ace/mode/${$('#aceMode').val()}`);
|
||||
});
|
||||
|
||||
Editor.commands.addCommand({
|
||||
name: 'save',
|
||||
bindKey: {win: 'Ctrl-S', mac: 'Command-S'},
|
||||
exec: function(editor) {
|
||||
save();
|
||||
},
|
||||
readOnly: false
|
||||
});
|
||||
|
||||
$('#create_file').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
save();
|
||||
});
|
||||
|
||||
function save() {
|
||||
if (_.isEmpty($('#file_name').val())) {
|
||||
$.notify({
|
||||
message: 'No filename was passed.'
|
||||
}, {
|
||||
type: 'danger'
|
||||
});
|
||||
return;
|
||||
}
|
||||
$('#create_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: $('#file_name').val(),
|
||||
contents: Editor.getValue()
|
||||
}
|
||||
}).done(function (data) {
|
||||
window.location.replace('/server/{{ $server->uuidShort }}/files/edit/{{ $directory }}' + $('#file_name').val());
|
||||
}).fail(function (jqXHR) {
|
||||
$.notify({
|
||||
message: jqXHR.responseText
|
||||
}, {
|
||||
type: 'danger'
|
||||
});
|
||||
}).always(function () {
|
||||
$('#save_file').html('{{ trans('strings.save') }}').removeClass('disabled');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,103 +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>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="editor" style="height:500px;">{{ $contents }}</div>
|
||||
</div>
|
||||
</div>
|
||||
@can('save-files', $server)
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<hr />
|
||||
<input type="hidden" name="file" value="{{ $file }}" />
|
||||
<button class="btn btn-primary btn-sm" id="save_file" type="submit">{{ trans('strings.save') }}</button>
|
||||
<a href="/server/{{ $server->uuidShort }}/files#{{ rawurlencode($directory) }}" class="text-muted pull-right"><small>{{ trans('server.files.back') }}</small></a>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
</div>
|
||||
{!! Theme::js('js/vendor/ace/ace.js') !!}
|
||||
{!! Theme::js('js/vendor/ace/ext-modelist.js') !!}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('.server-files').addClass('active');
|
||||
const Editor = ace.edit('editor');
|
||||
const Modelist = ace.require('ace/ext/modelist')
|
||||
|
||||
Editor.setTheme('ace/theme/chrome');
|
||||
Editor.getSession().setMode(Modelist.getModeForPath('{{ $stat->name }}').mode);
|
||||
Editor.getSession().setUseWrapMode(true);
|
||||
Editor.setShowPrintMargin(false);
|
||||
|
||||
@can('save-files', $server)
|
||||
Editor.commands.addCommand({
|
||||
name: 'save',
|
||||
bindKey: {win: 'Ctrl-S', mac: 'Command-S'},
|
||||
exec: function(editor) {
|
||||
save();
|
||||
},
|
||||
readOnly: false
|
||||
});
|
||||
|
||||
$('#save_file').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
save();
|
||||
});
|
||||
|
||||
function save() {
|
||||
var fileName = $('input[name="file"]').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: Editor.getValue()
|
||||
}
|
||||
}).done(function (data) {
|
||||
$.notify({
|
||||
message: '{{ trans('server.files.saved') }}'
|
||||
}, {
|
||||
type: 'success'
|
||||
});
|
||||
}).fail(function (jqXHR) {
|
||||
$.notify({
|
||||
message: jqXHR.responseText
|
||||
}, {
|
||||
type: 'danger'
|
||||
});
|
||||
}).always(function () {
|
||||
$('#save_file').html('{{ trans('strings.save') }}').removeClass('disabled');
|
||||
});
|
||||
}
|
||||
@endcan
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,190 +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('scripts')
|
||||
@parent
|
||||
{!! Theme::js('js/vendor/async/async.min.js') !!}
|
||||
{!! Theme::js('js/vendor/lodash/lodash.js') !!}
|
||||
{!! Theme::js('js/vendor/upload/client.min.js') !!}
|
||||
@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" id="upload_box">
|
||||
<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. The maximum size for web-based file uploads is currently <code>{{ $node->upload_size }} MB</code>.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(App::environment('production'))
|
||||
{!! Theme::js('js/filemanager.min.js') !!}
|
||||
@else
|
||||
{!! Theme::js('js/files/index.js') !!}
|
||||
{!! Theme::js('js/files/contextmenu.js') !!}
|
||||
{!! Theme::js('js/files/actions.js') !!}
|
||||
@endif
|
||||
<script>
|
||||
$(window).load(function () {
|
||||
$('.server-files').addClass('active');
|
||||
@can('upload-files', $server)
|
||||
var notifyUploadSocketError = false;
|
||||
var uploadSocket = io('{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/upload/{{ $server->uuid }}', {
|
||||
'query': 'token={{ $server->daemonSecret }}'
|
||||
});
|
||||
|
||||
socket.io.on('connect_error', function (err) {
|
||||
siofu.destroy();
|
||||
$('#applyUpdate').removeClass('fa-circle-o-notch fa-spinner fa-spin').addClass('fa-question-circle').css({ color: '#FF9900' });
|
||||
if(typeof notifyUploadSocketError !== 'object') {
|
||||
notifyUploadSocketError = $.notify({
|
||||
message: 'There was an error connecting to the Upload Socket for this server.'
|
||||
}, {
|
||||
type: 'danger',
|
||||
delay: 0
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
uploadSocket.on('error', err => {
|
||||
siofu.destroy();
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
uploadSocket.on('connect', function () {
|
||||
if (notifyUploadSocketError !== false) {
|
||||
notifyUploadSocketError.close();
|
||||
notifyUploadSocketError = false;
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('error', function (err) {
|
||||
console.error('There was an error while attemping to connect to the websocket: ' + err + '\n\nPlease try loading this page again.');
|
||||
});
|
||||
|
||||
|
||||
var siofu = new SocketIOFileUpload(uploadSocket);
|
||||
siofu.listenOnDrop(document.getElementById("upload_box"));
|
||||
|
||||
window.addEventListener('dragover', function (event) {
|
||||
event.preventDefault();
|
||||
}, false);
|
||||
|
||||
window.addEventListener('drop', function (event) {
|
||||
event.preventDefault();
|
||||
}, false);
|
||||
|
||||
var dropCounter = 0;
|
||||
$('#upload_box').bind({
|
||||
dragenter: function (event) {
|
||||
event.preventDefault();
|
||||
dropCounter++;
|
||||
$(this).addClass('hasFileHover');
|
||||
},
|
||||
dragleave: function (event) {
|
||||
dropCounter--;
|
||||
if (dropCounter === 0) {
|
||||
$(this).removeClass('hasFileHover');
|
||||
}
|
||||
},
|
||||
drop: function (event) {
|
||||
dropCounter = 0;
|
||||
$(this).removeClass('hasFileHover');
|
||||
}
|
||||
});
|
||||
|
||||
siofu.addEventListener('start', function (event) {
|
||||
event.file.meta.path = $('#headerTableRow').attr('data-currentdir');
|
||||
event.file.meta.identifier = Math.random().toString(36).slice(2);
|
||||
|
||||
$('#append_files_to').append('<tr id="file-upload-' + event.file.meta.identifier +'"> \
|
||||
<td><i class="fa fa-file-text-o" style="margin-left: 2px;"></i></td> \
|
||||
<td>' + event.file.name + '</td> \
|
||||
<td colspan=2"> </td> \
|
||||
</tr><tr> \
|
||||
<td colspan="4" class="has-progress"> \
|
||||
<div class="progress progress-table-bottom active"> \
|
||||
<div class="progress-bar progress-bar-info prog-bar-' + event.file.meta.identifier +'" style="width: 0%"></div> \
|
||||
</div> \
|
||||
</td> \
|
||||
</tr>\
|
||||
');
|
||||
});
|
||||
|
||||
siofu.addEventListener('progress', function(event) {
|
||||
var percent = event.bytesLoaded / event.file.size * 100;
|
||||
if (percent >= 100) {
|
||||
$('.prog-bar-' + event.file.meta.identifier).css('width', '100%').removeClass('progress-bar-info').addClass('progress-bar-success').parent().removeClass('active');
|
||||
} else {
|
||||
$('.prog-bar-' + event.file.meta.identifier).css('width', percent + '%');
|
||||
}
|
||||
});
|
||||
|
||||
// Do something when a file is uploaded:
|
||||
siofu.addEventListener('complete', function(event){
|
||||
if (!event.success) {
|
||||
$('.prog-bar-' + event.file.meta.identifier).css('width', '100%').removeClass('progress-bar-info').addClass('progress-bar-danger');
|
||||
$.notify({
|
||||
message: 'An error was encountered while attempting to upload this file.'
|
||||
}, {
|
||||
type: 'danger',
|
||||
delay: 5000
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
siofu.addEventListener('error', function(event){
|
||||
console.error(event);
|
||||
$('.prog-bar-' + event.file.meta.identifier).css('width', '100%').removeClass('progress-bar-info').addClass('progress-bar-danger');
|
||||
$.notify({
|
||||
message: 'An error was encountered while attempting to upload this file: <strong>' + event.message + '.</strong>',
|
||||
}, {
|
||||
type: 'danger',
|
||||
delay: 8000
|
||||
});
|
||||
});
|
||||
@endcan
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,160 +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. --}}
|
||||
<table class="table table-hover" id="file_listing">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:2%;text-align:center;"><i class="fa fa-refresh muted muted-hover use-pointer" data-action="reload-files"></i></th>
|
||||
<th style="width:55%">File Name</th>
|
||||
<th style="width:15%">Size</th>
|
||||
<th style="width:20%">Last Modified</th>
|
||||
<th style="width:8%"></th>
|
||||
</tr>
|
||||
<tr id="headerTableRow" data-currentdir="{{ $directory['header'] }}">
|
||||
<th><i class="fa fa-folder-open"></i></th>
|
||||
<th colspan="4">
|
||||
<code>/home/container{{ $directory['header'] }}</code>
|
||||
<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>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="append_files_to">
|
||||
@if (isset($directory['first']) && $directory['first'] === true)
|
||||
<tr data-type="disabled">
|
||||
<td><i class="fa fa-folder" style="margin-left: 0.859px;"></i></td>
|
||||
<td><a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">←</a></a></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@endif
|
||||
@if (isset($directory['show']) && $directory['show'] === true)
|
||||
<tr data-type="disabled">
|
||||
<td><i class="fa fa-folder" style="margin-left: 0.859px;"></i></td>
|
||||
<td data-name="{{ rawurlencode($directory['link']) }}">
|
||||
<a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">← {{ $directory['link_show'] }}</a>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@endif
|
||||
@foreach ($folders as $folder)
|
||||
<tr class="align-middle" data-type="folder">
|
||||
<td data-identifier="type"><i class="fa fa-folder" style="margin-left: 0.859px;"></i></td>
|
||||
<td data-identifier="name" data-name="{{ rawurlencode($folder['entry']) }}" data-path="@if($folder['directory'] !== ''){{ rawurlencode($folder['directory']) }}@endif/">
|
||||
<a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">{{ $folder['entry'] }}</a>
|
||||
</td>
|
||||
<td data-identifier="size">{{ $folder['size'] }}</td>
|
||||
<td data-identifier="modified">
|
||||
<?php $carbon = Carbon::createFromTimestamp($folder['date'])->timezone(env('APP_TIMEZONE', 'America/New_York')); ?>
|
||||
@if($carbon->diffInMinutes(Carbon::now()) > 60)
|
||||
{{ $carbon->format('m/d/y H:i:s') }}
|
||||
@elseif($carbon->diffInSeconds(Carbon::now()) < 5 || $carbon->isFuture())
|
||||
<em>seconds ago</em>
|
||||
@else
|
||||
{{ $carbon->diffForHumans() }}
|
||||
@endif
|
||||
</td>
|
||||
<td><button class="btn btn-xxs btn-default" data-action="toggleMenu" style="padding:2px 6px 0px;"><i class="fa fa-ellipsis-h"></i></button></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@foreach ($files as $file)
|
||||
<tr class="align-middle" data-type="file" data-mime="{{ $file['mime'] }}">
|
||||
<td data-identifier="type">
|
||||
{{-- oh boy --}}
|
||||
@if(in_array($file['mime'], [
|
||||
'application/x-7z-compressed',
|
||||
'application/zip',
|
||||
'application/x-compressed-zip',
|
||||
'application/x-tar',
|
||||
'application/x-gzip',
|
||||
'application/x-bzip',
|
||||
'application/x-bzip2',
|
||||
'application/java-archive'
|
||||
]))
|
||||
<i class="fa fa-file-archive-o" style="margin-left: 2px;"></i>
|
||||
@elseif(in_array($file['mime'], [
|
||||
'application/json',
|
||||
'application/javascript',
|
||||
'application/xml',
|
||||
'application/xhtml+xml',
|
||||
'text/xml',
|
||||
'text/css',
|
||||
'text/html',
|
||||
'text/x-perl',
|
||||
'text/x-shellscript'
|
||||
]))
|
||||
<i class="fa fa-file-code-o" style="margin-left: 2px;"></i>
|
||||
@elseif(starts_with($file['mime'], 'image'))
|
||||
<i class="fa fa-file-image-o" style="margin-left: 2px;"></i>
|
||||
@elseif(starts_with($file['mime'], 'video'))
|
||||
<i class="fa fa-file-video-o" style="margin-left: 2px;"></i>
|
||||
@elseif(starts_with($file['mime'], 'video'))
|
||||
<i class="fa fa-file-audio-o" style="margin-left: 2px;"></i>
|
||||
@elseif(starts_with($file['mime'], 'application/vnd.ms-powerpoint'))
|
||||
<i class="fa fa-file-powerpoint-o" style="margin-left: 2px;"></i>
|
||||
@elseif(in_array($file['mime'], [
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
|
||||
'application/msword'
|
||||
]) || starts_with($file['mime'], 'application/vnd.ms-word'))
|
||||
<i class="fa fa-file-word-o" style="margin-left: 2px;"></i>
|
||||
@elseif(in_array($file['mime'], [
|
||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
|
||||
]) || starts_with($file['mime'], 'application/vnd.ms-excel'))
|
||||
<i class="fa fa-file-excel-o" style="margin-left: 2px;"></i>
|
||||
@elseif($file['mime'] === 'application/pdf')
|
||||
<i class="fa fa-file-pdf-o" style="margin-left: 2px;"></i>
|
||||
@else
|
||||
<i class="fa fa-file-text-o" style="margin-left: 2px;"></i>
|
||||
@endif
|
||||
</td>
|
||||
<td data-identifier="name" data-name="{{ rawurlencode($file['entry']) }}" data-path="@if($file['directory'] !== ''){{ rawurlencode($file['directory']) }}@endif/">
|
||||
@if(in_array($file['mime'], $editableMime))
|
||||
@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 data-identifier="size">{{ $file['size'] }}</td>
|
||||
<td data-identifier="modified">
|
||||
<?php $carbon = Carbon::createFromTimestamp($file['date'])->timezone(env('APP_TIMEZONE', 'America/New_York')); ?>
|
||||
@if($carbon->diffInMinutes(Carbon::now()) > 60)
|
||||
{{ $carbon->format('m/d/y H:i:s') }}
|
||||
@elseif($carbon->diffInSeconds(Carbon::now()) < 5 || $carbon->isFuture())
|
||||
<em>seconds ago</em>
|
||||
@else
|
||||
{{ $carbon->diffForHumans() }}
|
||||
@endif
|
||||
</td>
|
||||
<td><button class="btn btn-xxs btn-default" data-action="toggleMenu" style="padding:2px 6px 0px;"><i class="fa fa-ellipsis-h"></i></button></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
|
@ -1,522 +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
|
||||
{!! Theme::css('css/jquery.terminal.css') !!}
|
||||
{!! Theme::js('js/jquery.mousewheel-min.js') !!}
|
||||
{!! Theme::js('js/jquery.terminal-0.11.23.min.js') !!}
|
||||
{!! Theme::js('js/unix_formatting.js') !!}
|
||||
{!! Theme::js('js/vendor/chartjs/chart.min.js') !!}
|
||||
{!! Theme::js('js/vendor/jquery/jquery-dateFormat.min.js') !!}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="nav nav-tabs tabs_with_panel" id="config_tabs">
|
||||
<li class="active"><a href="#console" data-toggle="tab">{{ trans('server.index.control') }}</a></li>
|
||||
<li><a href="#resources" data-toggle="tab">Resource Use</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">
|
||||
<div class="alert alert-info hidden" id="consoleThrottled">
|
||||
The console is currently being throttled due to the speed at which data is being sent. Messages are being queued and will appear as the queue is worked through.
|
||||
</div>
|
||||
<div id="consoleNotify" class="hidden">
|
||||
<i class="fa fa-bell"></i>
|
||||
</div>
|
||||
<div id="terminal">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12" 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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="resources">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<canvas id="chart_memory" style="max-height:300px;"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top:15px;">
|
||||
<div class="col-md-12">
|
||||
<canvas id="chart_cpu" style="max-height:300px;"></canvas>
|
||||
</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>
|
||||
<table class="table table-hover">
|
||||
<tr>
|
||||
<th>IP Address</th>
|
||||
<th>Alias</th>
|
||||
<th>Port</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
@foreach ($allocations as $allocation)
|
||||
<tr>
|
||||
<td>
|
||||
<code>{{ $allocation->ip }}</code>
|
||||
</td>
|
||||
<td @if(is_null($allocation->ip_alias))class="muted"@endif>
|
||||
@if(is_null($allocation->ip_alias))
|
||||
<span class="label label-default">none</span>
|
||||
@else
|
||||
<code>{{ $allocation->ip_alias }}</code>
|
||||
@endif
|
||||
</td>
|
||||
<td><code>{{ $allocation->port }}</code></td>
|
||||
<td class="col-xs-2">
|
||||
@if($allocation->id === $server->allocation)
|
||||
<span class="label label-primary is-primary" data-allocation="{{ $allocation->id }}">Primary</span>
|
||||
@else
|
||||
<span class="label label-success muted muted-hover use-pointer" data-action="set-connection" data-allocation="{{ $allocation->id }}">Make Primary</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
</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">×</button>
|
||||
<h4 class="modal-title" id="PauseConsole">ScrollStop™</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="paused_console" style="height: 300px; overflow-x: scroll;"></div>
|
||||
</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')
|
||||
{!! Theme::js('js/plugins/minecraft/eula.js') !!}
|
||||
@endif
|
||||
<script>
|
||||
$(window).load(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
var initialStatusSent = false;
|
||||
var currentStatus = 0;
|
||||
|
||||
var terminal = $('#terminal').terminal(function (command, term) {
|
||||
@can('power-start', $server)
|
||||
if (currentStatus === 0 && (command === 'start' || command === 'boot')) {
|
||||
powerToggleServer('start');
|
||||
}
|
||||
@endcan
|
||||
@can('send-command', $server)
|
||||
if (currentStatus === 0 && !(command === 'start' || command === 'boot')) {
|
||||
term.error('Server is currently off, type `start` or `boot` to start server.');
|
||||
}
|
||||
if (currentStatus !== 0 && command !== '') {
|
||||
$.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: command })
|
||||
}).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;
|
||||
}
|
||||
term.error(error);
|
||||
});
|
||||
}
|
||||
@else
|
||||
term.error('You do not have permission to send commands to this server.');
|
||||
@endcan
|
||||
}, {
|
||||
greetings: '',
|
||||
name: '{{ $server->uuid }}',
|
||||
height: 400,
|
||||
exit: false,
|
||||
prompt: '{{ $server->username }}:~$ ',
|
||||
scrollOnEcho: false,
|
||||
scrollBottomOffset: 5,
|
||||
onBlur: function (terminal) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
const $consoleNotify = $('#consoleNotify');
|
||||
$consoleNotify.on('click', function () {
|
||||
terminal.scroll_to_bottom();
|
||||
$consoleNotify.removeClass('hidden');
|
||||
});
|
||||
|
||||
terminal.on('scroll', function() {
|
||||
if (terminal.is_bottom()) {
|
||||
$consoleNotify.addClass('hidden');
|
||||
}
|
||||
})
|
||||
|
||||
function terminalNotifyOutput() {
|
||||
if (!terminal.is_bottom()) {
|
||||
$consoleNotify.removeClass('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
var ctc = $('#chart_cpu');
|
||||
var timeLabels = [];
|
||||
var cpuData = [];
|
||||
var CPUChart = new Chart(ctc, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: timeLabels,
|
||||
datasets: [
|
||||
{
|
||||
label: "Percent Use",
|
||||
fill: false,
|
||||
lineTension: 0.03,
|
||||
backgroundColor: "#00A1CB",
|
||||
borderColor: "#00A1CB",
|
||||
borderCapStyle: 'butt',
|
||||
borderDash: [],
|
||||
borderDashOffset: 0.0,
|
||||
borderJoinStyle: 'miter',
|
||||
pointBorderColor: "rgba(75,192,192,1)",
|
||||
pointBackgroundColor: "#fff",
|
||||
pointBorderWidth: 1,
|
||||
pointHoverRadius: 5,
|
||||
pointHoverBackgroundColor: "rgba(75,192,192,1)",
|
||||
pointHoverBorderColor: "rgba(220,220,220,1)",
|
||||
pointHoverBorderWidth: 2,
|
||||
pointRadius: 1,
|
||||
pointHitRadius: 10,
|
||||
data: cpuData,
|
||||
spanGaps: false,
|
||||
}
|
||||
]
|
||||
},
|
||||
options: {
|
||||
title: {
|
||||
display: true,
|
||||
text: 'CPU Usage (as Percent Total)'
|
||||
},
|
||||
legend: {
|
||||
display: false,
|
||||
},
|
||||
animation: {
|
||||
duration: 1,
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var ctm = $('#chart_memory');
|
||||
var memoryData = [];
|
||||
var MemoryChart = new Chart(ctm, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: timeLabels,
|
||||
datasets: [
|
||||
{
|
||||
label: "Memory Use",
|
||||
fill: false,
|
||||
lineTension: 0.03,
|
||||
backgroundColor: "#01A4A4",
|
||||
borderColor: "#01A4A4",
|
||||
borderCapStyle: 'butt',
|
||||
borderDash: [],
|
||||
borderDashOffset: 0.0,
|
||||
borderJoinStyle: 'miter',
|
||||
pointBorderColor: "rgba(75,192,192,1)",
|
||||
pointBackgroundColor: "#fff",
|
||||
pointBorderWidth: 1,
|
||||
pointHoverRadius: 5,
|
||||
pointHoverBackgroundColor: "rgba(75,192,192,1)",
|
||||
pointHoverBorderColor: "rgba(220,220,220,1)",
|
||||
pointHoverBorderWidth: 2,
|
||||
pointRadius: 1,
|
||||
pointHitRadius: 10,
|
||||
data: memoryData,
|
||||
spanGaps: false,
|
||||
}
|
||||
]
|
||||
},
|
||||
options: {
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Memory Usage (in Megabytes)'
|
||||
},
|
||||
legend: {
|
||||
display: false,
|
||||
},
|
||||
animation: {
|
||||
duration: 1,
|
||||
}
|
||||
}
|
||||
});
|
||||
socket.on('proc', function (proc) {
|
||||
if (cpuData.length > 10) {
|
||||
cpuData.shift();
|
||||
memoryData.shift();
|
||||
timeLabels.shift();
|
||||
}
|
||||
|
||||
var cpuUse = ({{ $server->cpu }} > 0) ? parseFloat(((proc.data.cpu.total / {{ $server->cpu }}) * 100).toFixed(3).toString()) : proc.data.cpu.total;
|
||||
cpuData.push(cpuUse);
|
||||
memoryData.push(parseInt(proc.data.memory.total / (1024 * 1024)));
|
||||
|
||||
var m = new Date();
|
||||
timeLabels.push($.format.date(new Date(), 'HH:mm:ss'));
|
||||
|
||||
CPUChart.update();
|
||||
MemoryChart.update();
|
||||
});
|
||||
|
||||
// New Console Data Recieved
|
||||
var outputQueue = [];
|
||||
socket.on('console', function (data) {
|
||||
outputQueue.push(data.line);
|
||||
});
|
||||
|
||||
window.setInterval(pushOutputQueue, {{ env('CONSOLE_PUSH_FREQ', 250) }});
|
||||
function pushOutputQueue()
|
||||
{
|
||||
if (outputQueue.length > {{ env('CONSOLE_PUSH_COUNT', 10) }}) {
|
||||
$('#consoleThrottled').removeClass('hidden');
|
||||
} else {
|
||||
$('#consoleThrottled').addClass('hidden');
|
||||
}
|
||||
|
||||
if (outputQueue.length > 0) {
|
||||
for (var i = 0; i < {{ env('CONSOLE_PUSH_COUNT', 10) }} && outputQueue.length > 0; i++)
|
||||
{
|
||||
terminal.echo(outputQueue[0]);
|
||||
outputQueue.shift();
|
||||
}
|
||||
terminalNotifyOutput();
|
||||
}
|
||||
}
|
||||
|
||||
// Update Listings on Initial Status
|
||||
socket.on('initial_status', function (data) {
|
||||
currentStatus = data.status;
|
||||
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) {
|
||||
terminal.echo(data);
|
||||
terminalNotifyOutput();
|
||||
}).fail(function() {
|
||||
terminal.error('Unable to load initial server log, try reloading the page.');
|
||||
terminalNotifyOutput();
|
||||
});
|
||||
}
|
||||
updateServerPowerControls(data.status);
|
||||
updatePlayerListVisibility(data.status);
|
||||
});
|
||||
|
||||
// Update Listings on Status
|
||||
socket.on('status', function (data) {
|
||||
currentStatus = data.status;
|
||||
updateServerPowerControls(data.status);
|
||||
updatePlayerListVisibility(data.status);
|
||||
});
|
||||
|
||||
// Load Paused Console with Live Console Data
|
||||
$('#pause_console').click(function(){
|
||||
$('#paused_console').html($('#terminal').html());
|
||||
});
|
||||
|
||||
function updatePlayerListVisibility(data) {
|
||||
// Server is On or Starting
|
||||
if(data !== 0) {
|
||||
$('#stats_players').show();
|
||||
} else {
|
||||
$('#stats_players').hide();
|
||||
}
|
||||
}
|
||||
|
||||
@can('set-allocation', $server)
|
||||
// Send Request
|
||||
function handleChange() {
|
||||
$('[data-action="set-connection"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
var element = $(this);
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/server/{{ $server->uuidShort }}/ajax/set-primary',
|
||||
data: {
|
||||
allocation: element.data('allocation')
|
||||
},
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
}).done(function (data) {
|
||||
swal({
|
||||
type: 'success',
|
||||
title: '',
|
||||
text: data
|
||||
});
|
||||
element.parents().eq(2).find('.is-primary').addClass('muted muted-hover label-success use-pointer').attr('data-action', 'set-connection').data('action', 'set-connection').removeClass('label-primary is-primary').html('Make Primary');
|
||||
element.removeClass('muted muted-hover label-success use-pointer').attr('data-action', 'do-nothing').data('action', 'do-nothing').addClass('label-primary is-primary').html('Primary');
|
||||
handleChange();
|
||||
}).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
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
handleChange();
|
||||
@endcan
|
||||
|
||||
var can_run = true;
|
||||
function updateServerPowerControls (data) {
|
||||
// Server is On or Starting
|
||||
if(data == 1 || data == 2) {
|
||||
$('[data-attr="power"][data-action="start"]').addClass('disabled');
|
||||
$('[data-attr="power"][data-action="stop"], [data-attr="power"][data-action="restart"]').removeClass('disabled');
|
||||
} else {
|
||||
if (data == 0) {
|
||||
$('[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
|
|
@ -1,246 +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
|
||||
@can('view-databases', $server)<li><a href="#tab_databases" data-toggle="tab">Databases</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>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="gen_pass" class=" alert alert-success" style="display:none;margin-bottom: 10px;"></div>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
@can('reset-sftp', $server)
|
||||
<form action="{{ route('server.settings.sftp', $server->uuidShort) }}" method="POST">
|
||||
<label class="control-label">New SFTP Password:</label>
|
||||
<div class="input-group">
|
||||
<input type="password" class="form-control" name="sftp_pass" />
|
||||
<span class="input-group-btn">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-primary btn-sm" value="Reset" />
|
||||
</span>
|
||||
</div>
|
||||
<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>
|
||||
</form>
|
||||
@endcan
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
@can('view-sftp-password', $server)
|
||||
<label class="control-label">Current Password:</label>
|
||||
<div>
|
||||
<input type="text" readonly="readonly" class="form-control" value="@if(!is_null($server->sftp_password)){{ Crypt::decrypt($server->sftp_password) }}@endif" />
|
||||
</div>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</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 !!}</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
|
||||
@can('view-databases', $server)
|
||||
<div class="tab-pane" id="tab_databases">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
@if(count($databases) > 0)
|
||||
<table class="table table-bordered table-hover" style="margin-bottom:0;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Database</th>
|
||||
<th>Username</th>
|
||||
<th>Password</th>
|
||||
<th>DB Server</th>
|
||||
</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($databases as $database)
|
||||
<tr>
|
||||
<td>{{ $database->database }}</td>
|
||||
<td>{{ $database->username }}</td>
|
||||
<td><code>{{ Crypt::decrypt($database->password) }}</code> @can('reset-db-password', $server)<a href="#" data-action="reset-database-password" data-id="{{ $database->id }}"><i class="fa fa-refresh pull-right"></i></a>@endcan</td>
|
||||
<td><code>{{ $database->a_host }}:{{ $database->a_port }}</code></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<div class="alert alert-info" style="margin-bottom:0;">
|
||||
There are no databases configured for this server.
|
||||
@if(Auth::user()->root_admin === 1)
|
||||
<a href="{{ route('admin.servers.view', [
|
||||
'id' => $server->id,
|
||||
'tab' => 'tab_database'
|
||||
]) }}" target="_blank">Add a new database.</a>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</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');
|
||||
}
|
||||
});
|
||||
$('[data-action="generate-password"]').click(function(e){
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/password-gen/12",
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(data) {
|
||||
$("#gen_pass").html('<strong>Generated Password:</strong> ' + data).slideDown();
|
||||
$('input[name="sftp_pass"]').val(data);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
$('[data-action="reset-database-password"]').click(function (e) {
|
||||
e.preventDefault();
|
||||
var block = $(this);
|
||||
$(this).find('i').addClass('fa-spin');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '{{ route('server.ajax.reset-database-password', $server->uuidShort) }}',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
data: {
|
||||
'database': $(this).data('id')
|
||||
}
|
||||
}).done(function (data) {
|
||||
block.parent().find('code').html(data);
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
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
|
||||
});
|
||||
}).always(function () {
|
||||
block.find('i').removeClass('fa-spin');
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,156 +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')
|
||||
Scheduled Tasks
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<h3 class="nopad">Manage Scheduled Tasks</h3><hr />
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Action</th>
|
||||
<th>Data</th>
|
||||
<th>Last Run</th>
|
||||
<th>Next Run</th>
|
||||
@can('delete-task', $server)<th></th>@endcan
|
||||
@can('toggle-task', $server)<th></th>@endcan
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($tasks as $task)
|
||||
<tr @if($task->active === 0)class="text-disabled"@endif>
|
||||
{{-- <td><a href="{{ route('server.tasks.view', [ $server->uuidShort, $task->id ]) }}">{{ $actions[$task->action] }}</a></td> --}}
|
||||
<td>{{ $actions[$task->action] }}</td>
|
||||
<td><code>{{ $task->data }}</code></td>
|
||||
<td>{{ Carbon::parse($task->last_run)->toDayDateTimeString() }} <p class="text-muted"><small>({{ Carbon::parse($task->last_run)->diffForHumans() }})</small></p></td>
|
||||
<td>
|
||||
@if($task->active !== 0)
|
||||
{{ Carbon::parse($task->next_run)->toDayDateTimeString() }} <p class="text-muted"><small>({{ Carbon::parse($task->next_run)->diffForHumans() }})</small></p>
|
||||
@else
|
||||
<em>n/a</em>
|
||||
@endif
|
||||
</td>
|
||||
@can('delete-task', $server)
|
||||
<td class="text-center align-middle"><a href="#" data-action="delete-task" data-id="{{ $task->id }}"><i class="fa fa-fw fa-trash-o text-danger" data-toggle="tooltip" data-placement="top" title="Delete"></i></a></td>
|
||||
@endcan
|
||||
@can('toggle-task', $server)
|
||||
<td class="text-center align-middle"><a href="#" data-action="toggle-task" data-active="{{ $task->active }}" data-id="{{ $task->id }}"><i class="fa fa-fw fa-eye-slash text-primary" data-toggle="tooltip" data-placement="top" title="Toggle Status"></i></a></td>
|
||||
@endcan
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@can('create-task', $server)
|
||||
<a href="{{ route('server.tasks.new', $server->uuidShort) }}"><button class="btn btn-sm btn-primary">Add Scheduled Task</button></a>
|
||||
@endcan
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('.server-tasks').addClass('active');
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
|
||||
@can('delete-task', $server)
|
||||
$('[data-action="delete-task"]').click(function (event) {
|
||||
var self = $(this);
|
||||
swal({
|
||||
type: 'error',
|
||||
title: 'Delete Task?',
|
||||
text: 'Are you sure you want to delete this task? There is no undo.',
|
||||
showCancelButton: true,
|
||||
allowOutsideClick: true,
|
||||
closeOnConfirm: false,
|
||||
confirmButtonText: 'Delete Task',
|
||||
confirmButtonColor: '#d9534f',
|
||||
showLoaderOnConfirm: true
|
||||
}, function () {
|
||||
$.ajax({
|
||||
method: 'DELETE',
|
||||
url: '{{ route('server.tasks', $server->uuidShort) }}/delete/' + self.data('id'),
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
}).done(function (data) {
|
||||
swal({
|
||||
type: 'success',
|
||||
title: '',
|
||||
text: 'Task has been deleted.'
|
||||
});
|
||||
self.parent().parent().slideUp();
|
||||
}).fail(function (jqXHR) {
|
||||
console.error(jqXHR);
|
||||
swal({
|
||||
type: 'error',
|
||||
title: 'Whoops!',
|
||||
text: 'An error occured while attempting to delete this task.'
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@endcan
|
||||
@can('toggle-task', $server)
|
||||
$('[data-action="toggle-task"]').click(function (event) {
|
||||
var self = $(this);
|
||||
swal({
|
||||
type: 'info',
|
||||
title: 'Toggle Task',
|
||||
text: 'This will toggle the selected task.',
|
||||
showCancelButton: true,
|
||||
allowOutsideClick: true,
|
||||
closeOnConfirm: false,
|
||||
confirmButtonText: 'Continue',
|
||||
showLoaderOnConfirm: true
|
||||
}, function () {
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '{{ route('server.tasks', $server->uuidShort) }}/toggle/' + self.data('id'),
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
}).done(function (data) {
|
||||
swal({
|
||||
type: 'success',
|
||||
title: '',
|
||||
text: 'Task has been toggled.'
|
||||
});
|
||||
if (data.status !== 1) {
|
||||
self.parent().parent().addClass('text-disabled');
|
||||
} else {
|
||||
self.parent().parent().removeClass('text-disabled');
|
||||
}
|
||||
}).fail(function (jqXHR) {
|
||||
console.error(jqXHR);
|
||||
swal({
|
||||
type: 'error',
|
||||
title: 'Whoops!',
|
||||
text: 'An error occured while attempting to toggle this task.'
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@endcan
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,172 +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')
|
||||
Scheduled Tasks
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<h3 class="nopad">Create Scheduled Task<br /><small>Current System Time: {{ Carbon::now()->toDayDateTimeString() }}</small></h3><hr />
|
||||
<form action="{{ route('server.tasks.new', $server->uuidShort) }}" method="POST">
|
||||
<div class="alert alert-info">You may use either the dropdown selection boxes or enter custom <code>cron</code> variables into the fields below.</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<label class="control-label">Day of Week:</label>
|
||||
<div>
|
||||
<select data-action="update-field" data-field="day_of_week" class="form-control" multiple>
|
||||
<option value="0">Sunday</option>
|
||||
<option value="1">Monday</option>
|
||||
<option value="2">Tuesday</option>
|
||||
<option value="3">Wednesday</option>
|
||||
<option value="4">Thursday</option>
|
||||
<option value="5">Friday</option>
|
||||
<option value="6">Saturday</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label class="control-label">Custom Value:</label>
|
||||
<div>
|
||||
<input type="text" class="form-control" name="day_of_week" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<label class="control-label">Day of Month:</label>
|
||||
<div>
|
||||
<select data-action="update-field" data-field="day_of_month" class="form-control" multiple>
|
||||
@foreach(range(1, 31) as $i)
|
||||
<option value="{{ $i }}">{{ $i }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label class="control-label">Custom Value:</label>
|
||||
<div>
|
||||
<input type="text" class="form-control" name="day_of_month" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<label class="control-label">Hour:</label>
|
||||
<div>
|
||||
<select data-action="update-field" data-field="hour" class="form-control" multiple>
|
||||
@foreach(range(0, 23) as $i)
|
||||
<option value="{{ $i }}">{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}:00</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label class="control-label">Custom Value:</label>
|
||||
<div>
|
||||
<input type="text" class="form-control" name="hour" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<label class="control-label">Minute:</label>
|
||||
<div>
|
||||
<select data-action="update-field" data-field="minute" class="form-control" multiple>
|
||||
@foreach(range(0, 55) as $i)
|
||||
@if($i % 5 === 0)
|
||||
<option value="{{ $i }}">_ _:{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label class="control-label">Custom Value:</label>
|
||||
<div>
|
||||
<input type="text" class="form-control" name="minute" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-4">
|
||||
<label class="control-label">Task Type:</label>
|
||||
<div>
|
||||
<select name="action" class="form-control">
|
||||
<option value="command">Send Command</option>
|
||||
<option value="power">Send Power Action</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-8">
|
||||
<label class="control-label">Task Payload:</label>
|
||||
<div>
|
||||
<input type="text" name="data" class="form-control" value="{{ old('data') }}">
|
||||
<p class="text-muted"><small>For example, if you selected <code>Send Command</code> enter the command here. If you selected <code>Send Power Option</code> put the power action here (e.g. <code>restart</code>).</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-success btn-sm" value="Schedule Task" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('.server-tasks').addClass('active');
|
||||
$('[data-action="update-field"]').on('change', function (event) {
|
||||
event.preventDefault();
|
||||
var updateField = $(this).data('field');
|
||||
var selected = $(this).map(function (i, opt) {
|
||||
return $(opt).val();
|
||||
}).toArray();
|
||||
if (selected.length === $(this).find('option').length) {
|
||||
$('input[name=' + updateField + ']').val('*');
|
||||
} else {
|
||||
$('input[name=' + updateField + ']').val(selected.join(','));
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,107 +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>
|
||||
@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>
|
||||
@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
|
|
@ -1,301 +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">
|
||||
<div class="well" style="padding: 0 19px 19px;margin-bottom:0;">
|
||||
<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>
|
||||
<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['move-files']))checked="checked"@endif value="move-files"> <strong>Rename & Move Files</strong>
|
||||
<p class="text-muted"><small>Allows user to move and rename files and folders on the filesystem.</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['copy-files']))checked="checked"@endif value="copy-files"> <strong>Copy Files</strong>
|
||||
<p class="text-muted"><small>Allows user to copy files and folders on the filesystem.</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['compress-files']))checked="checked"@endif value="compress-files"> <strong>Compress Files</strong>
|
||||
<p class="text-muted"><small>Allows user to make archives of files and folders on 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['decompress-files']))checked="checked"@endif value="decompress-files"> <strong>Decompress Files</strong>
|
||||
<p class="text-muted"><small>Allows user to decompress <code>.zip</code> and <code>.tar / .tar.gz</code> archives.</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-files']))checked="checked"@endif value="create-files"> <strong>Create Files & Folders</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 even if that permission is not assigned on the panel.</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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 fuelux">
|
||||
<h4>Database 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-databases']))checked="checked"@endif value="view-databases"> <strong>View Database Details</strong>
|
||||
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows user to view all databases associated with this server (including usernames and password for the databases).</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-db-password']))checked="checked"@endif value="reset-db-password"> <strong>Reset Database Password</strong>
|
||||
<p class="text-muted"><small>Allows a user to reset passwords for databases.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 fuelux">
|
||||
<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['view-sftp-password']))checked="checked"@endif value="view-sftp-password"> <strong>View SFTP Password</strong>
|
||||
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows user to view the SFTP password for 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['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>
|
||||
<div class="row">
|
||||
<div class="col-md-6 fuelux">
|
||||
<h4>Task 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-tasks']))checked="checked"@endif value="list-tasks"> <strong>List Tasks</strong>
|
||||
<p class="text-muted"><small>Allows a user to list all tasks (enabled and disabled) on 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['view-task']))checked="checked"@endif value="view-task"> <strong>View Task</strong>
|
||||
<p class="text-muted"><small>Allows a user to view a specific task's details.</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['toggle-task']))checked="checked"@endif value="toggle-task"> <strong>Toggle Task</strong>
|
||||
<p class="text-muted"><small>Allows a user to toggle a task on or off.</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['queue-task']))checked="checked"@endif value="queue-task"> <strong>Queue Task</strong>
|
||||
<p class="text-muted"><small>Allows a user to queue a task to run on next cycle.</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-task']))checked="checked"@endif value="create-task"> <strong>Create Task</strong>
|
||||
<p class="text-muted"><small>Allows a user to create new tasks.</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-task']))checked="checked"@endif value="delete-task"> <strong>Delete Task</strong>
|
||||
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows a user to delete a task.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 fuelux">
|
||||
</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
|
|
@ -1,290 +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['move-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="move-files"> <strong>Rename & Move Files</strong>
|
||||
<p class="text-muted"><small>Allows user to move and rename files and folders on the filesystem.</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['copy-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="copy-files"> <strong>Copy Files</strong>
|
||||
<p class="text-muted"><small>Allows user to copy files and folders on the filesystem.</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['compress-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="compress-files"> <strong>Compress Files</strong>
|
||||
<p class="text-muted"><small>Allows user to make archives of files and folders on 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['decompress-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="decompress-files"> <strong>Decompress Files</strong>
|
||||
<p class="text-muted"><small>Allows user to decompress <code>.zip</code> and <code>.tar / .tar.gz</code> archives.</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-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="create-files"> <strong>Create Files & Folders</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 even if that permission is not assigned on the panel.</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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 fuelux">
|
||||
<h4>Database 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-databases']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="view-databases"> <strong>View Database Details</strong>
|
||||
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows user to view all databases associated with this server (including usernames and password for the databases).</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-db-password']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="reset-db-password"> <strong>Reset Database Password</strong>
|
||||
<p class="text-muted"><small>Allows a user to reset passwords for databases.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 fuelux">
|
||||
<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['view-sftp-password']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="view-sftp-password"> <strong>View SFTP Password</strong>
|
||||
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows user to view the SFTP password for 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['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>
|
||||
<div class="row">
|
||||
<div class="col-md-6 fuelux">
|
||||
<h4>Task 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-tasks']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="list-tasks"> <strong>List Tasks</strong>
|
||||
<p class="text-muted"><small>Allows a user to list all tasks (enabled and disabled) on 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['view-task']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="view-task"> <strong>View Task</strong>
|
||||
<p class="text-muted"><small>Allows a user to view a specific task's details.</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['toggle-task']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="toggle-task"> <strong>Toggle Task</strong>
|
||||
<p class="text-muted"><small>Allows a user to toggle a task on or off.</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['queue-task']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="queue-task"> <strong>Queue Task</strong>
|
||||
<p class="text-muted"><small>Allows a user to queue a task to run on next cycle.</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-task']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="create-task"> <strong>Create Task</strong>
|
||||
<p class="text-muted"><small>Allows a user to create new tasks.</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-task']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="delete-task"> <strong>Delete Task</strong>
|
||||
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows a user to delete a task.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 fuelux">
|
||||
</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
|
Loading…
Add table
Add a link
Reference in a new issue