Internal Themes
This commit is contained in:
parent
9a07cc83d1
commit
192498e51a
80 changed files with 20 additions and 1 deletions
|
@ -1,61 +0,0 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
{{-- Some Modifications (c) 2015 Dylan Seidt <dylan.seidt@gmail.com> --}}
|
||||
|
||||
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
||||
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
||||
{{-- in the Software without restriction, including without limitation the rights --}}
|
||||
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
||||
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
||||
{{-- furnished to do so, subject to the following conditions: --}}
|
||||
|
||||
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
||||
{{-- copies or substantial portions of the Software. --}}
|
||||
|
||||
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
||||
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
||||
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
||||
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
||||
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
||||
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
||||
{{-- SOFTWARE. --}}
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title')
|
||||
Account List
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/admin">Admin Control</a></li>
|
||||
<li class="active">Accounts</li>
|
||||
</ul>
|
||||
<h3>All Registered Users</h3><hr />
|
||||
<table class="table table-striped table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Email</th>
|
||||
<th>Account Created</th>
|
||||
<th>Account Updated</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($users as $user)
|
||||
<tr>
|
||||
<td><a href="/admin/accounts/view/{{ $user->id }}"><code>{{ $user->email }}</code></a> @if($user->root_admin === 1)<span class="badge">Administrator</span>@endif</td>
|
||||
<td>{{ $user->created_at }}</td>
|
||||
<td>{{ $user->updated_at }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">{!! $users->render() !!}</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find("a[href='/admin/accounts']").addClass('active');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,94 +0,0 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
{{-- Some Modifications (c) 2015 Dylan Seidt <dylan.seidt@gmail.com> --}}
|
||||
|
||||
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
||||
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
||||
{{-- in the Software without restriction, including without limitation the rights --}}
|
||||
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
||||
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
||||
{{-- furnished to do so, subject to the following conditions: --}}
|
||||
|
||||
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
||||
{{-- copies or substantial portions of the Software. --}}
|
||||
|
||||
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
||||
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
||||
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
||||
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
||||
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
||||
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
||||
{{-- SOFTWARE. --}}
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title')
|
||||
New Account
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/admin">Admin Controls</a></li>
|
||||
<li><a href="/admin/accounts">Accounts</a></li>
|
||||
<li class="active">Add New Account</li>
|
||||
</ul>
|
||||
<h3>Create New Account</h3><hr />
|
||||
<form action="new" method="post">
|
||||
<fieldset>
|
||||
<div class="form-group">
|
||||
<label for="email" class="control-label">Email</label>
|
||||
<div>
|
||||
<input type="text" autocomplete="off" name="email" class="form-control" />
|
||||
</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">
|
||||
<label for="pass" class="control-label">Password</label>
|
||||
<div>
|
||||
<input type="password" name="password" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="pass_2" class="control-label">Password Again</label>
|
||||
<div>
|
||||
<input type="password" name="password_confirmation" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
{!! csrf_field() !!}
|
||||
<button class="btn btn-primary btn-sm" type="submit">Create Account</button>
|
||||
<button class="btn btn-default btn-sm" id="gen_pass_bttn" type="button">Generate Password</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#sidebar_links").find("a[href='/admin/account/new']").addClass('active');
|
||||
$("#gen_pass_bttn").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="password"], input[name="password_confirmation"]').val(data);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find("a[href='/admin/accounts/new']").addClass('active');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,173 +0,0 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
{{-- Some Modifications (c) 2015 Dylan Seidt <dylan.seidt@gmail.com> --}}
|
||||
|
||||
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
||||
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
||||
{{-- in the Software without restriction, including without limitation the rights --}}
|
||||
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
||||
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
||||
{{-- furnished to do so, subject to the following conditions: --}}
|
||||
|
||||
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
||||
{{-- copies or substantial portions of the Software. --}}
|
||||
|
||||
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
||||
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
||||
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
||||
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
||||
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
||||
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
||||
{{-- SOFTWARE. --}}
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title')
|
||||
Viewing User
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/admin">Admin Controls</a></li>
|
||||
<li><a href="/admin/accounts">Accounts</a></li>
|
||||
<li class="active">{{ $user->email }}</li>
|
||||
</ul>
|
||||
<h3>Viewing User: {{ $user->email }}</h3><hr />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<form action="/admin/accounts/update" method="post">
|
||||
<div class="col-md-6">
|
||||
<fieldset>
|
||||
<div class="form-group">
|
||||
<label for="email" class="control-label">{{ trans('strings.email') }}</label>
|
||||
<div>
|
||||
<input type="text" name="email" value="{{ $user->email }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="registered" class="control-label">{{ trans('strings.registered') }}</label>
|
||||
<div>
|
||||
<input type="text" name="registered" value="{{ $user->created_at }}" readonly="readonly" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="root_admin" class="control-label">{{ trans('strings.root_administrator') }}</label>
|
||||
<div>
|
||||
<select name="root_admin" class="form-control">
|
||||
<option value="0">{{ trans('strings.no') }}</option>
|
||||
<option value="1" @if($user->root_admin)selected="selected"@endif>{{ trans('strings.yes') }}</option>
|
||||
</select>
|
||||
<p><small class="text-muted"><em><strong><i class="fa fa-warning"></i></strong> {{ trans('base.root_administrator') }}</em></small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" name="user" value="{{ $user->id }}">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" value="{{ trans('base.account.update_user') }}" class="btn btn-primary btn-sm">
|
||||
<a href="#">
|
||||
<button type="button" class="btn btn-sm btn-danger" data-action="deleteUser" value="{{ trans('base.account.delete_user') }}">{{ trans('base.account.delete_user') }}</button>
|
||||
</a>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="well" style="padding-bottom: 0;">
|
||||
<h4 class="nopad">{{ trans('base.account.update_pass') }}</h5><hr>
|
||||
<div class="alert alert-success" style="display:none;margin-bottom:10px;" id="gen_pass"></div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="control-label">{{ trans('strings.password') }}</label>
|
||||
<div>
|
||||
<input type="password" id="password" name="password" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password_confirmation" class="control-label">{{ trans('auth.confirmpassword') }}</label>
|
||||
<div>
|
||||
<input type="password" id="password_confirmation" name="password_confirmation" class="form-control">
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="email_user" value="1">{{ trans('base.account.email_password') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-default btn-sm" id="gen_pass_bttn" type="button">Generate Password</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h3>Associated Servers</h3><hr>
|
||||
@if($servers)
|
||||
<table class="table table-striped table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:2%;"></th>
|
||||
<th>Server Name</th>
|
||||
<th>Node</th>
|
||||
<th>Connection</th>
|
||||
<th style="width:10%;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($servers as $server)
|
||||
<tr>
|
||||
<td><a href="/server/{{ $server->uuidShort }}/"><i class="fa fa-tachometer"></i></a></td>
|
||||
<td><a href="/admin/servers/view/{{ $server->id }}">{{ $server->name }}</a></td>
|
||||
<td>{{ $server->nodeName }}</td>
|
||||
<td><code>{{ $server->ip }}:{{ $server->port }}</code></td>
|
||||
<td>@if($server->active)<span class="label label-success">Enabled</span>@else<span class="label label-danger">Disabled</span>@endif</td>
|
||||
</td>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<div class="alert alert-info">There are no servers associated with this account.</div>
|
||||
@endif
|
||||
<a href="/admin/servers/new?email={{ $user->email }}"><button type="button" class="btn btn-success btn-sm">{{ trans('server.index.add_new') }}</button></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#sidebar_links").find("a[href='/admin/accounts']").addClass('active');
|
||||
$('#delete').click(function() {
|
||||
if(confirm('{{ trans('base.confirm') }}')) {
|
||||
$('#delete').load($(this).attr('href'));
|
||||
}
|
||||
});
|
||||
$("#gen_pass_bttn").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="password"], input[name="password_confirmation"]').val(data);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
$('button[data-action="deleteUser"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
method: 'DELETE',
|
||||
url: '/admin/accounts/view/{{ $user->id }}',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
}).done(function (data) {
|
||||
alert('Account was successfully deleted from the system.');
|
||||
window.location = '/admin/accounts';
|
||||
}).fail(function (jqXHR) {
|
||||
console.error(jqXHR);
|
||||
alert('An error occured: ' + jqXHR.JSONResponse.error);
|
||||
})
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,113 +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.admin')
|
||||
|
||||
@section('title')
|
||||
API Management
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/admin">Admin Control</a></li>
|
||||
<li class="active">API Management</li>
|
||||
</ul>
|
||||
<h3>API Key Information</h3><hr />
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>API Public Key</th>
|
||||
<th>Allowed IPs</th>
|
||||
<th>Permissions</th>
|
||||
<th class="text-center">Created</th>
|
||||
<th class="text-center"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($keys as $key)
|
||||
<tr>
|
||||
<td><code>{{ $key->public }}</code></td>
|
||||
<td>
|
||||
@if (is_null($key->allowed_ips))
|
||||
<code>*</code>
|
||||
@else
|
||||
@foreach(json_decode($key->allowed_ips) as $ip)
|
||||
<code style="line-height:2;">{{ $ip }}</code><br />
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@foreach(json_decode($key->permissions) as &$perm)
|
||||
<code style="line-height:2;">{{ $perm->permission }}</code><br />
|
||||
@endforeach
|
||||
</td>
|
||||
<td class="text-center">{{ $key->created_at }}</td>
|
||||
<td class="text-center"><a href="#delete" class="text-danger" data-action="delete" data-attr="{{ $key->public }}"><i class="fa fa-trash"></i></a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="well">
|
||||
<a href="{{ route('admin.api.new') }}"><button class="btn btn-success btn-sm">Create New API Key</button></a>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find("a[href='/admin/api']").addClass('active');
|
||||
$('[data-action="delete"]').click(function (event) {
|
||||
var self = $(this);
|
||||
event.preventDefault();
|
||||
swal({
|
||||
type: 'error',
|
||||
title: 'Revoke API Key',
|
||||
text: 'Once this API key is revoked any applications currently using it will stop working.',
|
||||
showCancelButton: true,
|
||||
allowOutsideClick: true,
|
||||
closeOnConfirm: false,
|
||||
confirmButtonText: 'Revoke',
|
||||
confirmButtonColor: '#d9534f',
|
||||
showLoaderOnConfirm: true
|
||||
}, function () {
|
||||
$.ajax({
|
||||
method: 'DELETE',
|
||||
url: '{{ route('admin.api.revoke') }}/' + self.data('attr'),
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
}).done(function (data) {
|
||||
swal({
|
||||
type: 'success',
|
||||
title: '',
|
||||
text: 'API Key has been revoked.'
|
||||
});
|
||||
self.parent().parent().slideUp();
|
||||
}).fail(function (jqXHR) {
|
||||
console.error(jqXHR);
|
||||
swal({
|
||||
type: 'error',
|
||||
title: 'Whoops!',
|
||||
text: 'An error occured while attempting to revoke this key.'
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,201 +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.admin')
|
||||
|
||||
@section('title')
|
||||
API Management
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/admin">Admin Control</a></li>
|
||||
<li><a href="/admin/api">API Management</a></li>
|
||||
<li class="active">New</li>
|
||||
</ul>
|
||||
<h3>Add New API Key</h3><hr />
|
||||
<form action="{{ route('admin.api.new') }}" method="POST">
|
||||
<div class="row">
|
||||
<div class="col-md-12 fuelux">
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" value="*"> <strong>*</strong>
|
||||
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows performing any action aganist the API.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 fuelux">
|
||||
<h4>User Management</h4><hr />
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" value="api.users"> <strong>GET /users</strong>
|
||||
<p class="text-muted"><small>Allows listing of all users currently 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" value="api.users.post"> <strong>POST /users</strong>
|
||||
<p class="text-muted"><small>Allows creating a new user 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" value="api.users.view"> <strong>GET /users/{id}</strong>
|
||||
<p class="text-muted"><small>Allows viewing details about a specific user including active services.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" value="api.users.patch"> <strong>PATCH /users/{id}</strong>
|
||||
<p class="text-muted"><small>Allows modifying user details (email, password, TOTP information).</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" value="api.users.delete"> <strong>DELETE /users/{id}</strong>
|
||||
<p class="text-muted"><small>Allows deleting a user.</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" value="api.servers"> <strong>GET /servers</strong>
|
||||
<p class="text-muted"><small>Allows listing of all servers currently 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" value="api.servers.post"> <strong>POST /servers</strong>
|
||||
<p class="text-muted"><small>Allows creating a new server 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" value="api.servers.view"> <strong>GET /servers/{id}</strong>
|
||||
<p class="text-muted"><small>Allows viewing details about a specific 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" value="api.servers.suspend"> <strong>POST /servers/{id}/suspend</strong>
|
||||
<p class="text-muted"><small>Allows suspending a server instance.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" value="api.servers.unsuspend"> <strong>POST /servers/{id}/unsuspend</strong>
|
||||
<p class="text-muted"><small>Allows unsuspending a server instance.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" value="api.servers.delete"> <strong>DELETE /servers/{id}</strong>
|
||||
<p class="text-muted"><small>Allows deleting a server.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 fuelux">
|
||||
<h4>Node Management</h4><hr />
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" value="api.nodes"> <strong>GET /nodes</strong>
|
||||
<p class="text-muted"><small>Allows listing of all nodes currently 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" value="api.nodes.post"> <strong>POST /nodes</strong>
|
||||
<p class="text-muted"><small>Allows creating a new node 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" value="api.nodes.view"> <strong>GET /nodes/{id}</strong>
|
||||
<p class="text-muted"><small>Allows viewing details about a specific node including active services.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" value="api.nodes.view_allocations"> <strong>GET /nodes/{id}/allocations</strong>
|
||||
<p class="text-muted"><small>Allows viewing details about a specific node including active services.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" value="api.nodes.delete"> <strong>DELETE /nodes/{id}</strong>
|
||||
<p class="text-muted"><small>Allows deleting a node.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 fuelux">
|
||||
<h4>Service Management</h4><hr />
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" value="api.services"> <strong>GET /services</strong>
|
||||
<p class="text-muted"><small>Allows listing of all services configured 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" value="api.services.view"> <strong>GET /services/{id}</strong>
|
||||
<p class="text-muted"><small>Allows listing details about each service on the system including service options and variables.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<h4>Location Management</h4><hr />
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" value="api.locations"> <strong>GET /locations</strong>
|
||||
<p class="text-muted"><small>Allows listing all locations and thier associated nodes.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="allowed_ips" class="control-label">Allowed IPs</label>
|
||||
<div>
|
||||
<textarea name="allowed_ips" class="form-control" rows="5">{{ old('allowed_ips') }}</textarea>
|
||||
<p class="text-muted"><small>Enter a line delimitated list of IPs that are allowed to access the API using this key. CIDR notation is allowed. Leave blank to allow any IP.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-sm btn-primary" value="Create New Key" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find("a[href='/admin/api']").addClass('active');
|
||||
$('[data-initialize="checkbox"]').checkbox();
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,40 +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.admin')
|
||||
|
||||
@section('title')
|
||||
Administration
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li class="active">Admin Control</li>
|
||||
</ul>
|
||||
<h3 class="nopad">Pterodactyl Admin Control Panel</h3><hr />
|
||||
<p>Welcome to the most advanced, lightweight, and user-friendly open source game server control panel.</p>
|
||||
<p>You are running version <code>{{ config('app.version') }}</code>.</p>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find("a[href='/admin']").addClass('active');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,211 +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.admin')
|
||||
|
||||
@section('title')
|
||||
Location List
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/admin">Admin Control</a></li>
|
||||
<li class="active">Locations</li>
|
||||
</ul>
|
||||
<h3>All Locations</h3><hr />
|
||||
<table class="table table-bordered table-hover table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Location</th>
|
||||
<th>Description</th>
|
||||
<th class="text-center">Nodes</th>
|
||||
<th class="text-center">Servers</th>
|
||||
<th class="text-center"></th>
|
||||
<th class="text-center"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($locations as $location)
|
||||
<tr>
|
||||
<td><code>{{ $location->short }}</code></td>
|
||||
<td>{{ $location->long }}</td>
|
||||
<td class="text-center">{{ $location->a_nodeCount }}</td>
|
||||
<td class="text-center">{{ $location->a_serverCount }}</td>
|
||||
<td class="text-center"><a href="#edit"><i class="fa fa-wrench" data-toggle="modal" data-target="#editModal" data-action="edit" data-id="{{ $location->id }}" data-short="{{ $location->short }}" data-long="{{ $location->long }}"></i></a></td>
|
||||
<td class="text-center"><a href="#delete" class="text-danger" data-action="delete" data-id="{{ $location->id }}"><i class="fa fa-trash-o"></i></a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">{!! $locations->render() !!}</div>
|
||||
</div>
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-sm btn-success" data-toggle="modal" data-target="#addModal">Add New Location</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">Editing Location</h4>
|
||||
</div>
|
||||
<form action="{{ route('admin.locations') }}" method="POST" id="editLocationForm">
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="location-short" class="control-label">Location Code:</label>
|
||||
<input type="text" class="form-control" id="location-short">
|
||||
<p class="text-muted"><small>This should be a short identifier for this location (e.g. <code>ny1</code>). This field is limited to a maximum of 10 characters from the following list: <code>a-zA-Z0-9_-.</code></small></p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="location-long" class="control-label">Description:</label>
|
||||
<input type="text" class="form-control" id="location-long">
|
||||
<p class="text-muted"><small>This should be a longer description of the location for internal reference.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<input type="hidden" id="location-id">
|
||||
<button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Close</button>
|
||||
<button type="submit" class="btn btn-sm btn-primary">Edit Location</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">Add New Location</h4>
|
||||
</div>
|
||||
<form action="{{ route('admin.locations') }}" method="POST" id="addLocationForm">
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="short" class="control-label">Location Code:</label>
|
||||
<div>
|
||||
<input type="text" class="form-control" name="short" value="{{ old('short') }}">
|
||||
<p class="text-muted"><small>This should be a short identifier for this location (e.g. <code>ny1</code>). This field is limited to a maximum of 10 characters from the following list: <code>a-zA-Z0-9_-.</code></small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="long" class="control-label">Description:</label>
|
||||
<div>
|
||||
<input type="text" class="form-control" name="long" value="{{ old('long') }}">
|
||||
<p class="text-muted"><small>This should be a longer description of the location for internal reference.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
{!! csrf_field() !!}
|
||||
<button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Close</button>
|
||||
<button type="submit" class="btn btn-sm btn-primary">Add Location</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find("a[href='/admin/locations']").addClass('active');
|
||||
$('#editModal').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget);
|
||||
var short = button.data('short');
|
||||
var long = button.data('long');
|
||||
var id = button.data('id');
|
||||
var modal = $(this);
|
||||
|
||||
modal.find('#location-id').val(id);
|
||||
modal.find('#location-short').val(short);
|
||||
modal.find('#location-long').val(long);
|
||||
});
|
||||
$('#editLocationForm').submit(function (event) {
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
method: 'PATCH',
|
||||
url: '{{ route('admin.locations') }}/' + $('#location-id').val(),
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
data: {
|
||||
short: $('#location-short').val(),
|
||||
long: $('#location-long').val()
|
||||
}
|
||||
}).done(function (data) {
|
||||
swal({
|
||||
type: 'success',
|
||||
title: '',
|
||||
text: 'Successfully updated location information.',
|
||||
closeOnConfirm: false,
|
||||
showLoaderOnConfirm: true
|
||||
}, function () {
|
||||
window.location = '{{ route('admin.locations') }}';
|
||||
});
|
||||
}).fail(function (jqXHR) {
|
||||
console.error(jqXHR);
|
||||
swal({
|
||||
type: 'error',
|
||||
title: 'Whoops!',
|
||||
text: (typeof jqXHR.responseJSON.error !== 'undefined') ? jqXHR.responseJSON.error : 'An error occured while processing this request.'
|
||||
});
|
||||
});
|
||||
});
|
||||
$('[data-action="delete"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
var self = $(this);
|
||||
swal({
|
||||
type: 'warning',
|
||||
title: '',
|
||||
text: 'Do you really want to delete this location?',
|
||||
showCancelButton: true,
|
||||
closeOnConfirm: false,
|
||||
showLoaderOnConfirm: true
|
||||
}, function () {
|
||||
$.ajax({
|
||||
method: 'DELETE',
|
||||
url: '{{ route('admin.locations') }}/' + self.data('id'),
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
}).done(function () {
|
||||
swal({
|
||||
type: 'success',
|
||||
title: '',
|
||||
text: 'Location was successfully deleted.'
|
||||
});
|
||||
self.parent().parent().slideUp();
|
||||
}).fail(function (jqXHR) {
|
||||
console.error(jqXHR);
|
||||
swal({
|
||||
type: 'error',
|
||||
title: 'Whoops!',
|
||||
text: (typeof jqXHR.responseJSON.error !== 'undefined') ? jqXHR.responseJSON.error : 'An error occured while processing this request.'
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,70 +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.admin')
|
||||
|
||||
@section('title')
|
||||
Node List
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/admin">Admin Control</a></li>
|
||||
<li class="active">Nodes</li>
|
||||
</ul>
|
||||
<h3>All Nodes</h3><hr />
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th class="visible-lg">Location</th>
|
||||
<th>FQDN</th>
|
||||
<th class="hidden-xs">Memory</th>
|
||||
<th class="hidden-xs">Disk</th>
|
||||
<th class="text-center hidden-xs">Servers</th>
|
||||
<th class="text-center">HTTPS</th>
|
||||
<th class="text-center">Public</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($nodes as $node)
|
||||
<tr>
|
||||
<td><a href="/admin/nodes/view/{{ $node->id }}">{{ $node->name }}</td>
|
||||
<td class="visible-lg">{{ $node->a_locationName }}</td>
|
||||
<td><code>{{ $node->fqdn }}</code></td>
|
||||
<td class="hidden-xs">{{ $node->memory }} MB</td>
|
||||
<td class="hidden-xs">{{ $node->disk }} MB</td>
|
||||
<td class="text-center hidden-xs">{{ $node->a_serverCount }}</td>
|
||||
<td class="text-center" style="color:{{ ($node->scheme === 'https') ? '#50af51' : '#d9534f' }}"><i class="fa fa-{{ ($node->scheme === 'https') ? 'lock' : 'unlock' }}"></i></td>
|
||||
<td class="text-center"><i class="fa fa-{{ ($node->public === 1) ? 'check' : 'times' }}"></i></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">{!! $nodes->render() !!}</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find("a[href='/admin/nodes']").addClass('active');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,187 +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.admin')
|
||||
|
||||
@section('title')
|
||||
Create Node
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/admin">Admin Control</a></li>
|
||||
<li><a href="/admin/nodes">Nodes</a></li>
|
||||
<li class="active">Create New Node</li>
|
||||
</ul>
|
||||
<h3>Create New Node</h3><hr />
|
||||
<form action="/admin/nodes/new" method="POST">
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="name" class="control-label">Node Name</label>
|
||||
<div>
|
||||
<input type="text" autocomplete="off" name="name" class="form-control" value="{{ old('name') }}" />
|
||||
<p class="text-muted"><small>Character limits: <code>a-zA-Z0-9_.-</code> and <code>[Space]</code> (min 1, max 100 characters).</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="name" class="control-label">Location</label>
|
||||
<div>
|
||||
<select name="location" class="form-control">
|
||||
@foreach($locations as $location)
|
||||
<option value="{{ $location->id }}" {{ (old('location') === $location->id) ? 'checked' : '' }}>{{ $location->long }} ({{ $location->short }})</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label for="public" class="control-label">Public <sup><a data-toggle="tooltip" data-placement="top" title="Allow automatic allocation to this Node?">?</a></sup></label>
|
||||
<div>
|
||||
<input type="radio" name="public" value="1" {{ (old('public') === '1') ? 'checked' : '' }} id="public_1" checked> <label for="public_1" style="padding-left:5px;">Yes</label><br />
|
||||
<input type="radio" name="public" value="0" {{ (old('public') === '0') ? 'checked' : '' }} id="public_0"> <label for="public_0" style="padding-left:5px;">No</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="fqdn" class="control-label">Fully Qualified Domain Name</label>
|
||||
<div>
|
||||
<input type="text" autocomplete="off" name="fqdn" class="form-control" value="{{ old('fqdn') }}" />
|
||||
</div>
|
||||
<p class="text-muted"><small>This <strong>must</strong> be a fully qualified domain name, you may not enter an IP address or a domain that does not exist.
|
||||
<a tabindex="0" data-toggle="popover" data-trigger="focus" title="Why do I need a FQDN?" data-content="In order to secure communications between your server and this node we use SSL. We cannot generate a SSL certificate for IP Addresses, and as such you will need to provide a FQDN.">Why?</a>
|
||||
</small></p>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="scheme" class="control-label">Secure Socket Layer</label>
|
||||
<div class="row" style="padding: 7px 0;">
|
||||
<div class="col-xs-6">
|
||||
<input type="radio" name="scheme" value="https" id="scheme_ssl" checked /> <label for="scheme_ssl" style="padding-left: 5px;">Enable HTTPS/SSL</label>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<input type="radio" name="scheme" value="http" id="scheme_nossl" /> <label for="scheme_nossl" style="padding-left: 5px;">Disable HTTPS/SSL</label>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-muted"><small>You should always leave SSL enabled for nodes. Disabling SSL could allow a malicious user to intercept traffic between the panel and the daemon potentially exposing sensitive information.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6 col-xs-6">
|
||||
<label for="memory" class="control-label">Total Memory</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="memory" class="form-control" value="{{ old('memory') }}"/>
|
||||
<span class="input-group-addon">MB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-6 col-xs-6">
|
||||
<label for="memory_overallocate" class="control-label">Overallocate</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="memory_overallocate" class="form-control" value="{{ old('memory_overallocate') }}"/>
|
||||
<span class="input-group-addon">%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p class="text-muted"><small>Enter the total amount of memory avaliable for new servers. If you would like to allow overallocation of memory enter the percentage that you want to allow. To disable checking for overallocation enter <code>-1</code> into the field. Entering <code>0</code> will prevent creating new servers if it would put the node over the limit.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6 col-xs-6">
|
||||
<label for="disk" class="control-label">Disk Space</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="disk" class="form-control" value="{{ old('disk') }}"/>
|
||||
<span class="input-group-addon">MB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-6 col-xs-6">
|
||||
<label for="disk_overallocate" class="control-label">Overallocate</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="disk_overallocate" class="form-control" value="{{ old('disk_overallocate') }}"/>
|
||||
<span class="input-group-addon">%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p class="text-muted"><small>Enter the total amount of disk space avaliable for new servers. If you would like to allow overallocation of disk space enter the percentage that you want to allow. To disable checking for overallocation enter <code>-1</code> into the field. Entering <code>0</code> will prevent creating new servers if it would put the node over the limit.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="daemonBase" class="control-label">Daemon Server File Location</label>
|
||||
<div>
|
||||
<input type="text" name="daemonBase" class="form-control" value="{{ old('daemonBase', '/srv/daemon-data') }}"/>
|
||||
</div>
|
||||
<p class="text-muted"><small>The location at which your server files will be stored. Most users do not need to change this.</small></p>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="daemonListen" class="control-label">Daemon Listening Port</label>
|
||||
<div>
|
||||
<input type="text" name="daemonListen" class="form-control" value="{{ old('daemonListen', '8080') }}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="daemonSFTP" class="control-label">Daemon SFTP Port</label>
|
||||
<div>
|
||||
<input type="text" name="daemonSFTP" class="form-control" value="{{ old('daemonSFTP', '2022') }}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-muted"><small>The daemon runs its own SFTP management container and does not use the SSHd process on the main physical server. <Strong>Do not use the same port that you have assigned for your physcial server's SSH process.</strong></small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-sm btn-primary" value="Create Node" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find("a[href='/admin/nodes/new']").addClass('active');
|
||||
$('[data-toggle="popover"]').popover({
|
||||
placement: 'auto'
|
||||
});
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,823 +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.admin')
|
||||
|
||||
@section('title')
|
||||
Managing Node: {{ $node->name }}
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
@parent
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highcharts/4.2.1/highcharts.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.7/socket.io.min.js"></script>
|
||||
<script src="{{ asset('js/bootstrap-notify.min.js') }}"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$.notifyDefaults({
|
||||
placement: {
|
||||
from: 'bottom',
|
||||
align: 'right'
|
||||
},
|
||||
newest_on_top: true,
|
||||
delay: 2000,
|
||||
animate: {
|
||||
enter: 'animated fadeInUp',
|
||||
exit: 'animated fadeOutDown'
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/admin">Admin Control</a></li>
|
||||
<li><a href="/admin/nodes">Nodes</a></li>
|
||||
<li class="active">{{ $node->name }}</li>
|
||||
</ul>
|
||||
<ul class="nav nav-tabs tabs_with_panel" id="config_tabs">
|
||||
<li class="active"><a href="#tab_about" data-toggle="tab">About</a></li>
|
||||
<li><a href="#tab_settings" data-toggle="tab">Settings</a></li>
|
||||
<li><a href="#tab_configuration" data-toggle="tab">Configuration</a></li>
|
||||
<li><a href="#tab_allocation" data-toggle="tab">Allocation</a></li>
|
||||
<li><a href="#tab_servers" data-toggle="tab">Servers</a></li>
|
||||
@if(count($servers) === 0)<li><a href="#tab_delete" data-toggle="tab">Delete</a></li>@endif
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tab_about">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-striped" style="margin-bottom:0;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Total Servers</td>
|
||||
<td>{{ count($servers) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Memory Allocated</td>
|
||||
<td><strong class="{{ ($stats->memory < ($node->memory * .8)) ? 'text-success' : 'text-danger' }}">{{ is_numeric($stats->memory) ? $stats->memory : 0 }} MB</strong> of
|
||||
@if(!is_null($node->memory_overallocate))
|
||||
<abbr data-toggle="tooltip" data-placement="top" title="Allows up to {{ ($node->memory * (1 + ($node->memory_overallocate / 100)) - $node->memory) }} MB over">{{ $node->memory }}</abbr>
|
||||
@else
|
||||
{{ $node->memory }}
|
||||
@endif
|
||||
MB
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Disk Allocated</td>
|
||||
<td><strong class="{{ ($stats->disk < ($node->disk * .8)) ? 'text-success' : 'text-danger' }}">{{ is_numeric($stats->disk) ? $stats->disk : 0 }} MB</strong> of
|
||||
@if(!is_null($node->disk_overallocate))
|
||||
<abbr data-toggle="tooltip" data-placement="top" title="Allows up to {{ ($node->disk * (1 + ($node->disk_overallocate / 100)) - $node->disk) }} MB over">{{ $node->disk }}</abbr>
|
||||
@else
|
||||
{{ $node->disk }}
|
||||
@endif
|
||||
MB
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="panel-heading" style="border-top: 1px solid #ddd;"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-11 text-center" id="chart_memory" style="height:250px;"></div>
|
||||
<div class="col-xs-11 text-center" id="chart_cpu" style="height:250px;"></div>
|
||||
<div class="col-xs-11 text-center" id="chart_players" style="height:250px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tab_settings">
|
||||
<form method="POST" action="/admin/nodes/view/{{ $node->id }}">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-warning">
|
||||
Changing some details below may require that you change the configuration file on the node as well as restart the daemon. They have been marked with <span class="label label-warning"><i class="fa fa-power-off"></i></span> below.
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="name" class="control-label">Node Name</label>
|
||||
<div>
|
||||
<input type="text" autocomplete="off" name="name" class="form-control" value="{{ old('name', $node->name) }}" />
|
||||
<p class="text-muted"><small>Character limits: <code>a-zA-Z0-9_.-</code> and <code>[Space]</code> (min 1, max 100 characters).</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="name" class="control-label">Location</label>
|
||||
<div>
|
||||
<select name="location" class="form-control">
|
||||
@foreach($locations as $location)
|
||||
<option value="{{ $location->id }}" {{ (old('location', $node->location) === $location->id) ? 'checked' : '' }}>{{ $location->long }} ({{ $location->short }})</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label for="public" class="control-label">Public <sup><a data-toggle="tooltip" data-placement="top" title="Allow automatic allocation to this Node?">?</a></sup></label>
|
||||
<div>
|
||||
<input type="radio" name="public" value="1" {{ (old('public', $node->public) === '1') ? 'checked' : '' }} id="public_1" checked> <label for="public_1" style="padding-left:5px;">Yes</label><br />
|
||||
<input type="radio" name="public" value="0" {{ (old('public', $node->public) === '0') ? 'checked' : '' }} id="public_0"> <label for="public_0" style="padding-left:5px;">No</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="fqdn" class="control-label">Fully Qualified Domain Name</label>
|
||||
<div>
|
||||
<input type="text" autocomplete="off" name="fqdn" class="form-control" value="{{ old('fqdn', $node->fqdn) }}" />
|
||||
</div>
|
||||
<p class="text-muted"><small>This <strong>must</strong> be a fully qualified domain name, you may not enter an IP address or a domain that does not exist.
|
||||
<a tabindex="0" data-toggle="popover" data-trigger="focus" title="Why do I need a FQDN?" data-content="In order to secure communications between your server and this node we use SSL. We cannot generate a SSL certificate for IP Addresses, and as such you will need to provide a FQDN.">Why?</a>
|
||||
</small></p>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="scheme" class="control-label"><span class="label label-warning"><i class="fa fa-power-off"></i></span> Secure Socket Layer</label>
|
||||
<div class="row" style="padding: 7px 0;">
|
||||
<div class="col-xs-6">
|
||||
<input type="radio" name="scheme" value="https" id="scheme_ssl" {{ (old('scheme', $node->scheme) === 'https') ? 'checked' : '' }}/> <label for="scheme_ssl" style="padding-left: 5px;">Enable HTTPS/SSL</label>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<input type="radio" name="scheme" value="http" id="scheme_nossl" {{ (old('scheme', $node->scheme) === 'http') ? 'checked' : '' }}/> <label for="scheme_nossl" style="padding-left: 5px;">Disable HTTPS/SSL</label>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-muted"><small>You should always leave SSL enabled for nodes. Disabling SSL could allow a malicious user to intercept traffic between the panel and the daemon potentially exposing sensitive information.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-heading" style="border-top: 1px solid #ddd;"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-3 col-xs-6">
|
||||
<label for="memory" class="control-label">Total Memory</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="memory" class="form-control" value="{{ old('memory', $node->memory) }}"/>
|
||||
<span class="input-group-addon">MB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-3 col-xs-6">
|
||||
<label for="memory_overallocate" class="control-label">Overallocate</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="memory_overallocate" class="form-control" value="{{ old('memory_overallocate', $node->memory_overallocate) }}"/>
|
||||
<span class="input-group-addon">%</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-3 col-xs-6">
|
||||
<label for="disk" class="control-label">Disk Space</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="disk" class="form-control" value="{{ old('disk', $node->disk) }}"/>
|
||||
<span class="input-group-addon">MB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-3 col-xs-6">
|
||||
<label for="disk_overallocate" class="control-label">Overallocate</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="disk_overallocate" class="form-control" value="{{ old('disk_overallocate', $node->disk_overallocate) }}"/>
|
||||
<span class="input-group-addon">%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p class="text-muted"><small>Enter the total amount of disk space and memory avaliable for new servers. If you would like to allow overallocation of disk space or memory enter the percentage that you want to allow. To disable checking for overallocation enter <code>-1</code> into the field. Entering <code>0</code> will prevent creating new servers if it would put the node over the limit.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-heading" style="border-top: 1px solid #ddd;"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="daemonListen" class="control-label"><span class="label label-warning"><i class="fa fa-power-off"></i></span> Daemon Port</label>
|
||||
<div>
|
||||
<input type="text" name="daemonListen" class="form-control" value="{{ old('daemonListen', $node->daemonListen) }}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="daemonSFTP" class="control-label"><span class="label label-warning"><i class="fa fa-power-off"></i></span> Daemon SFTP Port</label>
|
||||
<div>
|
||||
<input type="text" name="daemonSFTP" class="form-control" value="{{ old('daemonSFTP', $node->daemonSFTP) }}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p class="text-muted"><small>The daemon runs its own SFTP management container and does not use the SSHd process on the main physical server. <Strong>Do not use the same port that you have assigned for your physcial server's SSH process.</strong></small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="reset_secret" class="control-label"><span class="label label-warning"><i class="fa fa-power-off"></i></span> Reset Daemon Key</label>
|
||||
<div style="padding: 7px 0;">
|
||||
<input type="checkbox" name="reset_secret" id="reset_secret" /> Reset Daemon Master Key
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<p class="text-muted"><small>Resetting the daemon master key will void any request coming from the old key. This key is used for all sensitive operations on the daemon including server creation and deletion. We suggest changing this key regularly for security.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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-sm btn-primary" value="Update Node Information" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane" id="tab_configuration">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-info">
|
||||
Below is the configuration file for your daemon on this node. We recommend <strong>not</strong> simply copy and pasting the code below unless you know what you are doing. You should run the <code>auto-installer</code> or <code>auto-updater</code> to setup the daemon.
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<pre><code>{
|
||||
"web": {
|
||||
"listen": {{ $node->daemonListen }},
|
||||
"ssl": {
|
||||
"enabled": {{ $node->sceheme === 'https' ? 'true' : 'false' }},
|
||||
"certificate": "/etc/letsencrypt/live/{{ $node->fqdn }}/fullchain.pem",
|
||||
"key": "/etc/letsencrypt/live/{{ $node->fqdn }}/privkey.pem"
|
||||
}
|
||||
},
|
||||
"docker": {
|
||||
"socket": "/var/run/docker.sock"
|
||||
},
|
||||
"sftp": {
|
||||
"path": "{{ $node->daemonBase }}",
|
||||
"port": {{ $node->daemonSFTP }},
|
||||
"container": "container_id"
|
||||
},
|
||||
"logger": {
|
||||
"path": "logs/",
|
||||
"src": false,
|
||||
"level": "info",
|
||||
"period": "1d",
|
||||
"count": 3
|
||||
},
|
||||
"remote": {
|
||||
"download": "{{ route('remote.download') }}",
|
||||
"installed": "{{ route('remote.install') }}"
|
||||
},
|
||||
"uploads": {
|
||||
"maximumSize": 100000000
|
||||
},
|
||||
"keys": [
|
||||
"{{ $node->daemonSecret }}"
|
||||
]
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tab_allocation">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-striped table-bordered table-hover" style="margin-bottom:0;">
|
||||
<thead>
|
||||
<td>IP Address</td>
|
||||
<td>Ports</td>
|
||||
<td></td>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($allocations as $ip => $ports)
|
||||
<tr>
|
||||
<td><span style="cursor:pointer" data-action="delete" data-ip="{{ $ip }}" data-total="{{ count($ports) }}" class="is-ipblock"><i class="fa fa-fw fa-square-o"></i></span> {{ $ip }}</td>
|
||||
<td>
|
||||
@foreach($ports as $id => $allocation)
|
||||
@if (($id % 2) === 0)
|
||||
@if($allocation->assigned_to === null)
|
||||
<span style="cursor:pointer" data-action="delete" data-ip="{{ $ip }}" data-port="{{ $allocation->port }}"><i class="fa fa-fw fa-square-o"></i> {{ $allocation->port }} <br /></span>
|
||||
@else
|
||||
<i class="fa fa-fw fa-check-square-o"></i> {{ $allocation->port }} <br />
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
</td>
|
||||
<td>
|
||||
@foreach($ports as $id => $allocation)
|
||||
@if (($id % 2) === 1)
|
||||
@if($allocation->assigned_to === null)
|
||||
<span style="cursor:pointer" data-action="delete" data-ip="{{ $ip }}" data-port="{{ $allocation->port }}"><i class="fa fa-fw fa-square-o"></i> {{ $allocation->port }} <br /></span>
|
||||
@else
|
||||
<i class="fa fa-fw fa-check-square-o"></i> {{ $allocation->port }} <br />
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="panel-heading" style="border-top: 1px solid #ddd;"></div>
|
||||
<div class="panel-body">
|
||||
<h4 style="margin-top:0;">Allocate Additional Ports</h4>
|
||||
<form action="{{ route('admin.nodes.post.allocations', $node->id) }}" method="POST">
|
||||
<div class="row" id="duplicate">
|
||||
<div class="col-md-4 fuelux">
|
||||
<label for="" class="control-label">IP Address</label>
|
||||
<div class="input-group input-append dropdown combobox allocationComboBox" data-initialize="combobox">
|
||||
<input type="text" name="allocate_ip[]" class="form-control pillbox_ip" style="border-right:0;">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
|
||||
<ul class="dropdown-menu dropdown-menu-right">
|
||||
@foreach($allocations as $ip => $ports)
|
||||
<li data-action="alloc_dropdown_val" data-value="{{ $ip }}"><a href="#">{{ $ip }}</a></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-7 col-xs-10 fuelux">
|
||||
<label for="" class="control-label">Ports</label>
|
||||
<div class="pillbox allocationPillbox" data-initialize="pillbox">
|
||||
<ul class="clearfix pill-group">
|
||||
<li class="pillbox-input-wrap btn-group">
|
||||
<input type="text" class="form-control dropdown-toggle pillbox-add-item" placeholder="add port">
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<input name="allocate_port[]" type="hidden" class="pillboxMain"/>
|
||||
</div>
|
||||
<div class="form-group col-md-1 col-xs-2" style="margin-left: -10px;">
|
||||
<label for="" class="control-label"> </label>
|
||||
<button class="btn btn-danger btn-allocate-delete removeClone disabled"><i class="fa fa-close"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<hr />
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-sm btn-primary" value="Add Ports" />
|
||||
<button class="btn btn-success btn-sm cloneElement">Add More Rows</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tab_servers">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-info">
|
||||
The data below is live output from the daemon. CPU usage is displayed relative to the assigned CPU allocation. For example, if a server is assigned <code>10%</code> and the CPU usage below displays <code>90%</code> that means the server is using <code>9%</code> of the total system CPU.
|
||||
</div>
|
||||
<table class="table table-striped" style="margin-bottom: 0;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Owner</th>
|
||||
<th>Service</th>
|
||||
<th class="text-center">Memory</th>
|
||||
<th class="text-center">Disk</th>
|
||||
<th class="text-center">CPU</th>
|
||||
<th class="text-center">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($servers as $server)
|
||||
<tr data-server="{{ $server->uuid }}">
|
||||
<td><a href="/admin/servers/view/{{ $server->id }}">{{ $server->name }}</a></td>
|
||||
<td><a href="/admin/users/view/{{ $server->owner }}"><code>{{ $server->a_ownerEmail }}</a></a></td>
|
||||
<td>{{ $server->a_serviceName }}</td>
|
||||
<td class="text-center"><span data-action="memory">--</span> / {{ $server->memory }} MB</td>
|
||||
<td class="text-center">{{ $server->disk }} MB</td>
|
||||
<td class="text-center"><span data-action="cpu" data-cpumax="{{ $server->cpu }}">--</span> %</td>
|
||||
<td class="text-center" data-action="status">--</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">{!! $servers->appends(['tab' => 'tab_servers'])->render() !!}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(count($servers) === 0)
|
||||
<div class="tab-pane" id="tab_delete">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-4 text-center">
|
||||
<form action="{{ route('admin.nodes.delete', $node->id) }}" method="POST" id="deleteNodeForm">
|
||||
{!! method_field('DELETE') !!}
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" name="doSomethingForFucksSake" value="Delete Node" class="btn btn-sm btn-danger" />
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
<div class="alert alert-danger" style="margin-bottom:0;">Deleting this node is a permanent action, it cannot be undone.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-11" id="col11_setter"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find("a[href='/admin/nodes']").addClass('active');
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$('[data-toggle="popover"]').popover({
|
||||
placement: 'auto'
|
||||
});
|
||||
|
||||
$('#deleteNodeForm').submit(function (event) {
|
||||
event.preventDefault();
|
||||
swal({
|
||||
type: 'warning',
|
||||
title: 'Are You Sure?',
|
||||
text: 'This will immediately delete this node, there is no undo.',
|
||||
showCancelButton: true,
|
||||
allowOutsideClick: true,
|
||||
confirmButtonText: 'Delete',
|
||||
confirmButtonColor: '#d9534f',
|
||||
}, function () {
|
||||
event.target.submit();
|
||||
});
|
||||
});
|
||||
|
||||
$('.cloneElement').on('click', function (event) {
|
||||
event.preventDefault();
|
||||
var cloned = $('#duplicate').clone();
|
||||
var rnd = randomKey(10);
|
||||
cloned.find('.allocationPillbox').removeClass('allocationPillbox').addClass('allocationPillbox_' + rnd);
|
||||
cloned.find('.pillboxMain').removeClass('pillboxMain').addClass('pillbox_' + rnd);
|
||||
cloned.find('.removeClone').removeClass('disabled');
|
||||
cloned.find('.pillbox_ip').removeClass('pillbox_ip').addClass('pillbox_ip_' + rnd);
|
||||
cloned.insertAfter('#duplicate');
|
||||
$('.allocationPillbox_' + rnd).pillbox();
|
||||
$('.allocationPillbox_' + rnd).on('added.fu.pillbox edited.fu.pillbox removed.fu.pillbox', function pillboxChanged() {
|
||||
$('.pillbox_' + rnd).val(JSON.stringify($('.allocationPillbox_' + rnd).pillbox('items')));
|
||||
});
|
||||
$('.removeClone').on('click', function (event) {
|
||||
event.preventDefault();
|
||||
var element = $(this);
|
||||
element.parent().parent().slideUp(function () {
|
||||
element.remove();
|
||||
$('.pillbox_' + rnd).remove();
|
||||
$('.pillbox_ip_' + rnd).remove();
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
$('.allocationPillbox').pillbox();
|
||||
$('.allocationComboBox').combobox();
|
||||
$('.allocationPillbox').on('added.fu.pillbox edited.fu.pillbox removed.fu.pillbox', function pillboxChanged() {
|
||||
$('.pillboxMain').val(JSON.stringify($('.allocationPillbox').pillbox('items')));
|
||||
});
|
||||
|
||||
var notifySocketError = false;
|
||||
var Status = {
|
||||
0: 'Off',
|
||||
1: 'On',
|
||||
2: 'Starting',
|
||||
3: 'Stopping'
|
||||
};
|
||||
|
||||
// -----------------+
|
||||
// Charting Methods |
|
||||
// -----------------+
|
||||
$(window).resize(function() {
|
||||
$('#chart_memory').highcharts().setSize($('#col11_setter').width(), 250);
|
||||
$('#chart_cpu').highcharts().setSize($('#col11_setter').width(), 250);
|
||||
$('#chart_players').highcharts().setSize($('#col11_setter').width(), 250);
|
||||
});
|
||||
$('#chart_memory').highcharts({
|
||||
chart: {
|
||||
type: 'area',
|
||||
animation: Highcharts.svg,
|
||||
marginRight: 10,
|
||||
renderTo: 'container',
|
||||
width: $('#col11_setter').width()
|
||||
},
|
||||
colors: [
|
||||
'#113F8C'
|
||||
],
|
||||
credits: {
|
||||
enabled: false,
|
||||
},
|
||||
title: {
|
||||
text: 'Memory Usage of All Servers',
|
||||
},
|
||||
tooltip: {
|
||||
shared: true,
|
||||
crosshairs: true,
|
||||
formatter: function () {
|
||||
var s = '<b>Memory Usage</b>';
|
||||
|
||||
$.each(this.points, function () {
|
||||
s += '<br/>' + this.series.name + ': ' +
|
||||
this.y + 'MB';
|
||||
});
|
||||
|
||||
return s;
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
visible: false,
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
text: 'Memory Usage (MB)',
|
||||
},
|
||||
plotLines: [{
|
||||
value: 0,
|
||||
width: 1,
|
||||
}],
|
||||
},
|
||||
plotOptions: {
|
||||
area: {
|
||||
fillOpacity: 0.10,
|
||||
marker: {
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
enabled: false
|
||||
},
|
||||
series: [{
|
||||
name: 'Total Memory',
|
||||
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
}]
|
||||
});
|
||||
|
||||
$('#chart_cpu').highcharts({
|
||||
chart: {
|
||||
type: 'area',
|
||||
animation: Highcharts.svg,
|
||||
marginRight: 10,
|
||||
renderTo: 'container',
|
||||
width: $('#col11_setter').width()
|
||||
},
|
||||
colors: [
|
||||
'#00A1CB',
|
||||
],
|
||||
credits: {
|
||||
enabled: false,
|
||||
},
|
||||
title: {
|
||||
text: 'CPU Usage of all Servers',
|
||||
},
|
||||
tooltip: {
|
||||
shared: true,
|
||||
crosshairs: true,
|
||||
formatter: function () {
|
||||
var s = '<b>CPU Usage</b>';
|
||||
|
||||
$.each(this.points, function () {
|
||||
s += '<br/>' + this.series.name + ': ' +
|
||||
this.y + '%';
|
||||
});
|
||||
|
||||
return s;
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
visible: false,
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
text: 'CPU Usage (%)',
|
||||
},
|
||||
plotLines: [{
|
||||
value: 0,
|
||||
width: 1,
|
||||
}],
|
||||
},
|
||||
plotOptions: {
|
||||
area: {
|
||||
fillOpacity: 0.10,
|
||||
marker: {
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
enabled: true
|
||||
},
|
||||
series: [{
|
||||
name: 'Total CPU',
|
||||
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
}]
|
||||
});
|
||||
|
||||
$('#chart_players').highcharts({
|
||||
chart: {
|
||||
type: 'area',
|
||||
animation: Highcharts.svg,
|
||||
marginRight: 10,
|
||||
renderTo: 'container',
|
||||
width: $('#col11_setter').width()
|
||||
},
|
||||
colors: [
|
||||
'#01A4A4',
|
||||
],
|
||||
credits: {
|
||||
enabled: false,
|
||||
},
|
||||
title: {
|
||||
text: 'Total Players on All Servers',
|
||||
},
|
||||
tooltip: {
|
||||
shared: true,
|
||||
crosshairs: true,
|
||||
formatter: function () {
|
||||
var s = '<b>Total Players</b>';
|
||||
|
||||
$.each(this.points, function () {
|
||||
s += '<br/>' + this.series.name + ': ' + this.y;
|
||||
});
|
||||
|
||||
return s;
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
visible: false,
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
text: 'Total Players',
|
||||
},
|
||||
plotLines: [{
|
||||
value: 0,
|
||||
width: 1,
|
||||
}],
|
||||
},
|
||||
plotOptions: {
|
||||
area: {
|
||||
fillOpacity: 0.10,
|
||||
marker: {
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
enabled: true
|
||||
},
|
||||
series: [{
|
||||
name: 'Total Players',
|
||||
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
}]
|
||||
});
|
||||
|
||||
// Main Socket Object
|
||||
var socket = io('{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/stats/', {
|
||||
'query': 'token={{ $node->daemonSecret }}'
|
||||
});
|
||||
|
||||
// Socket Failed to Connect
|
||||
socket.io.on('connect_error', function (err) {
|
||||
if(typeof notifySocketError !== 'object') {
|
||||
notifySocketError = $.notify({
|
||||
message: '{!! trans('server.ajax.socket_error') !!}'
|
||||
}, {
|
||||
type: 'danger',
|
||||
delay: 0
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Connected to Socket Successfully
|
||||
socket.on('connect', function () {
|
||||
if (notifySocketError !== false) {
|
||||
notifySocketError.close();
|
||||
notifySocketError = 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.');
|
||||
});
|
||||
|
||||
socket.on('live-stats', function (data) {
|
||||
var CPUChart = $('#chart_cpu').highcharts();
|
||||
var MemoryChart = $('#chart_memory').highcharts();
|
||||
var PlayerChart = $('#chart_players').highcharts();
|
||||
|
||||
CPUChart.series[0].addPoint(data.stats.cpu, true, true);
|
||||
MemoryChart.series[0].addPoint(parseInt(data.stats.memory / (1024 * 1024)), true, true);
|
||||
PlayerChart.series[0].addPoint(data.stats.players, true, true);
|
||||
|
||||
$.each(data.servers, function (uuid, info) {
|
||||
var element = $('tr[data-server="' + uuid + '"]');
|
||||
element.find('[data-action="status"]').html(Status[info.status]);
|
||||
if (info.status !== 0) {
|
||||
var cpuMax = element.find('[data-action="cpu"]').data('cpumax');
|
||||
var currentCpu = info.proc.cpu.total;
|
||||
if (cpuMax !== 0) {
|
||||
currentCpu = parseFloat(((info.proc.cpu.total / cpuMax) * 100).toFixed(2).toString());
|
||||
}
|
||||
element.find('[data-action="memory"]').html(parseInt(info.proc.memory.total / (1024 * 1024)));
|
||||
element.find('[data-action="cpu"]').html(currentCpu);
|
||||
} else {
|
||||
element.find('[data-action="memory"]').html('--');
|
||||
element.find('[data-action="cpu"]').html('--');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('span[data-action="delete"]').hover(function() {
|
||||
$(this).find('i').css('color', '#d9534f').removeClass('fa-square-o').addClass('fa-minus-square');
|
||||
}, function () {
|
||||
$(this).find('i').css('color', 'inherit').addClass('fa-square-o').removeClass('fa-minus-square');
|
||||
});
|
||||
|
||||
$('span[data-action="delete"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
var element = $(this);
|
||||
var deleteIp = $(this).data('ip');
|
||||
var deletePort = $(this).data('port');
|
||||
swal({
|
||||
title: '',
|
||||
text: 'Are you sure you want to delete this port?',
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
allowOutsideClick: true,
|
||||
closeOnConfirm: false,
|
||||
confirmButtonText: 'Delete',
|
||||
confirmButtonColor: '#d9534f',
|
||||
showLoaderOnConfirm: true
|
||||
}, function () {
|
||||
$.ajax({
|
||||
method: 'DELETE',
|
||||
url: '{{ route('admin.nodes.view', $node->id) }}/allocation/' + deleteIp + '/' + deletePort,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
}).done(function (data) {
|
||||
if (element.hasClass('is-ipblock')) {
|
||||
var tMatched = 0;
|
||||
element.parent().parent().find('*').each(function () {
|
||||
if ($(this).attr('data-port') && $(this).attr('data-ip')) {
|
||||
$(this).fadeOut();
|
||||
tMatched++;
|
||||
}
|
||||
});
|
||||
if (tMatched === element.data('total')) {
|
||||
element.fadeOut();
|
||||
$('li[data-action="alloc_dropdown_val"][data-value="' + deleteIp + '"]').remove();
|
||||
element.parent().parent().slideUp().remove();
|
||||
}
|
||||
} else {
|
||||
element.fadeOut();
|
||||
}
|
||||
swal({
|
||||
type: 'success',
|
||||
title: 'Port Deleted!',
|
||||
});
|
||||
}).fail(function (jqXHR) {
|
||||
console.error(jqXHR);
|
||||
swal({
|
||||
title: 'Whoops!',
|
||||
text: jqXHR.responseJSON.error,
|
||||
type: 'error'
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,64 +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.admin')
|
||||
|
||||
@section('title')
|
||||
Server List
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/admin">Admin Control</a></li>
|
||||
<li class="active">Servers</li>
|
||||
</ul>
|
||||
<h3>All Servers</h3><hr />
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Server Name</th>
|
||||
<th>Owner</th>
|
||||
<th class="hidden-xs">Node</th>
|
||||
<th>Default Connection</th>
|
||||
<th class="hidden-xs">SFTP Username</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($servers as $server)
|
||||
<tr class="dynUpdate @if($server->active !== 1)active @endif" id="{{ $server->uuidShort }}">
|
||||
<td><a href="/admin/servers/view/{{ $server->id }}">{{ $server->name }}</td>
|
||||
<td><a href="/admin/accounts/view/{{ $server->owner }}">{{ $server->a_ownerEmail }}</a></td>
|
||||
<td class="hidden-xs"><a href="/admin/nodes/view/{{ $server->node }}">{{ $server->a_nodeName }}</a></td>
|
||||
<td><code>{{ $server->ip }}:{{ $server->port }}</code></td>
|
||||
<td class="hidden-xs"><code>{{ $server->username }}</code></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">{!! $servers->render() !!}</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find("a[href='/admin/servers']").addClass('active');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,453 +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.admin')
|
||||
|
||||
@section('title')
|
||||
Create New Server
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/admin">Admin Control</a></li>
|
||||
<li><a href="/admin/servers">Servers</a></li>
|
||||
<li class="active">Create New Server</li>
|
||||
</ul>
|
||||
<h3>Create New Server</h3><hr />
|
||||
<form action="/admin/servers/new" method="POST">
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="name" class="control-label">Server Name</label>
|
||||
<div>
|
||||
<input type="text" autocomplete="off" name="name" class="form-control" value="{{ old('name') }}" />
|
||||
<p class="text-muted"><small><em>Character limits: <code>a-zA-Z0-9_-</code> and <code>[Space]</code> (max 35 characters)</em></small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="owner" class="control-label">Owner Email</label>
|
||||
<div>
|
||||
<input type="text" autocomplete="off" name="owner" class="form-control" value="{{ old('owner', Input::get('email')) }}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="load_settings">
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="ajax_loading_box" style="display:none;"><i class="fa fa-refresh fa-spin ajax_loading_position"></i></div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="location" class="control-label">Server Location</label>
|
||||
<div>
|
||||
<select name="location" id="getLocation" class="form-control">
|
||||
<option disabled selected> -- Select a Location</option>
|
||||
@foreach($locations as $location)
|
||||
<option value="{{ $location->id }}">{{ $location->long }} ({{ $location->short }})</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<p class="text-muted"><small>The location in which this server will be deployed.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-6 hidden">
|
||||
<label for="node" class="control-label">Server Node</label>
|
||||
<div>
|
||||
<select name="node" id="getNode" class="form-control">
|
||||
<option disabled selected> -- Select a Node</option>
|
||||
</select>
|
||||
<p class="text-muted"><small>The node which this server will be deployed to.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6 hidden">
|
||||
<label for="ip" class="control-label">Server IP</label>
|
||||
<div>
|
||||
<select name="ip" id="getIP" class="form-control">
|
||||
<option disabled selected> -- Select an IP</option>
|
||||
</select>
|
||||
<p class="text-muted"><small>Select the main IP that this server will be listening on. You can assign additional open IPs and ports below.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-6 hidden">
|
||||
<label for="port" class="control-label">Server Port</label>
|
||||
<div>
|
||||
<select name="port" id="getPort" class="form-control"></select>
|
||||
<p class="text-muted"><small>Select the main port that this server will be listening on.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-4 col-xs-4">
|
||||
<label for="memory" class="control-label">Memory</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="memory" class="form-control" value="{{ old('memory') }}"/>
|
||||
<span class="input-group-addon">MB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4 col-xs-4">
|
||||
<label for="memory" class="control-label">Swap</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="swap" class="form-control" value="{{ old('swap', 0) }}"/>
|
||||
<span class="input-group-addon">MB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4 col-xs-4">
|
||||
<label for="memory" class="control-label">OOM Killer</label>
|
||||
<div>
|
||||
<span class="input-group-addon" style="height:36px;">
|
||||
<input type="checkbox" name="oom_disabled"/>
|
||||
</span>
|
||||
<span class="input-group-addon" style="height:36px;">
|
||||
Disable OOM Killer
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p class="text-muted"><small>If you do not want to assign swap space to a server simply put <code>0</code> for the value. We suggest leaving OOM Killer enabled unless you know what you are doing, disabling it could cause your server to hang unexpectedly.</small><p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-4 col-xs-4">
|
||||
<label for="disk" class="control-label">Disk Space</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="disk" class="form-control" value="{{ old('disk') }}"/>
|
||||
<span class="input-group-addon">MB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4 col-xs-4">
|
||||
<label for="cpu" class="control-label">CPU Limit</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="cpu" class="form-control" value="{{ old('cpu', 0) }}"/>
|
||||
<span class="input-group-addon">%</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4 col-xs-4">
|
||||
<label for="io" class="control-label">Block I/O</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="io" class="form-control" value="{{ old('io', 500) }}"/>
|
||||
<span class="input-group-addon">I/O</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p class="text-muted"><small>If you do not want to limit CPU usage set the value to <code>0</code>. To determine a value, take the number <em>physical</em> cores and multiply it by 100. For example, on a quad core system <code>(4 * 100 = 400)</code> there is <code>400%</code> available. To limit a server to using half of a single core, you would set the value to <code>50</code>. To allow a server to use up to two physical cores, set the value to <code>200</code>. BlockIO should be a value between <code>10</code> and <code>1000</code>. Please see <a href="https://docs.docker.com/reference/run/#block-io-bandwidth-blkio-constraint" target="_blank">this documentation</a> for more information about it.</small><p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6" id="load_services">
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="ajax_loading_box" style="display:none;"><i class="fa fa-refresh fa-spin ajax_loading_position"></i></div>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="service" class="control-label">Service Type</label>
|
||||
<div>
|
||||
<select name="service" id="getService" class="form-control">
|
||||
<option disabled selected> -- Select a Service</option>
|
||||
@foreach($services as $service)
|
||||
<option value="{{ $service->id }}">{{ $service->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<p class="text-muted"><small>Select the type of service that this server will be running.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-12 hidden">
|
||||
<label for="option" class="control-label">Service Option</label>
|
||||
<div>
|
||||
<select name="option" id="getOption" class="form-control">
|
||||
<option disabled selected> -- Select a Service Option</option>
|
||||
</select>
|
||||
<p class="text-muted"><small>Select the type of service that this server will be running.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="use_custom_image" class="control-label">Use Custom Docker Image</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">
|
||||
<input @if(old('use_custom_image') === 'use_custom_image')checked="checked"@endif type="checkbox" name="use_custom_image"/>
|
||||
</span>
|
||||
<input type="text" class="form-control" name="custom_image_name" value="{{ old('custom_image_name') }}" disabled />
|
||||
</div>
|
||||
<p class="text-muted"><small>If you would like to use a custom docker image for this server please enter it here. Most users can ignore this option.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="well" id="serviceOptions" style="display:none;">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<h3 class="nopad">Service Setup & Options</h3>
|
||||
<hr />
|
||||
<label for="startup" class="control-label">Startup Command</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="startupExec"></span>
|
||||
<input type="text" class="form-control" name="startup" value="{{ old('startup') }}" />
|
||||
</div>
|
||||
<p class="text-muted"><small>The following data replacers are avaliable for the startup command: <code>@{{SERVER_MEMORY}}</code>, <code>@{{SERVER_IP}}</code>, and <code>@{{SERVER_PORT}}</code>. They will be replaced with the allocated memory, server ip, and server port respectively.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-info">Some service options have additional environment variables that you can define for a given instance. They will show up below when you select a service option. If none show up, chances are that none were defined, and there is nothing to worry about.</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="serverVariables"></div>
|
||||
</div>
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-primary btn-sm" value="Create New Server" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
$('#sidebar_links').find("a[href='/admin/servers/new']").addClass('active');
|
||||
|
||||
$('input[name="use_custom_image"]').change(function () {
|
||||
$('input[name="custom_image_name"]').val('').prop('disabled', !($(this).is(':checked')));
|
||||
});
|
||||
|
||||
var nodeData = null;
|
||||
var currentLocation = null;
|
||||
var currentNode = null;
|
||||
var currentService = null;
|
||||
$('#getLocation').on('change', function (event) {
|
||||
|
||||
if ($('#getLocation').val() === '' || $('#getLocation').val() === currentLocation) {
|
||||
return;
|
||||
}
|
||||
|
||||
currentLocation = $('#getLocation').val();
|
||||
currentNode = null;
|
||||
|
||||
// Hide Existing, and Reset contents
|
||||
$('#getNode').html('<option disabled selected> -- Select a Node</option>').parent().parent().addClass('hidden');
|
||||
$('#getIP').html('<option disabled selected> -- Select an IP</option>').parent().parent().addClass('hidden');
|
||||
$('#getPort').html('').parent().parent().addClass('hidden');
|
||||
|
||||
handleLoader('#load_settings', true);
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/admin/servers/new/get-nodes',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
data: {
|
||||
location: $('#getLocation').val()
|
||||
}
|
||||
}).done(function (data) {
|
||||
//var data = $.parseJSON(data);
|
||||
$.each(data, function (i, item) {
|
||||
var isPublic = (item.public !== 1) ? '(Private Node)' : '';
|
||||
$('#getNode').append('<option value="' + item.id + '">' + item.name + ' ' + isPublic + '</option>');
|
||||
});
|
||||
$('#getNode').parent().parent().removeClass('hidden')
|
||||
}).fail(function (jqXHR) {
|
||||
alert('An error occured while attempting to load a list of nodes in this location.');
|
||||
currentLocation = null;
|
||||
console.error(jqXHR);
|
||||
}).always(function () {
|
||||
handleLoader('#load_settings');
|
||||
})
|
||||
});
|
||||
$('#getNode').on('change', function (event) {
|
||||
|
||||
if ($('#getNode').val() === '' || $('#getNode').val() === currentNode) {
|
||||
return;
|
||||
}
|
||||
|
||||
currentNode = $('#getNode').val();
|
||||
|
||||
// Hide Existing, and Reset contents
|
||||
$('#getIP').html('<option disabled selected> -- Select an IP</option>').parent().parent().addClass('hidden');
|
||||
$('#getPort').html('').parent().parent().addClass('hidden');
|
||||
|
||||
handleLoader('#load_settings', true);
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/admin/servers/new/get-ips',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
data: {
|
||||
node: $('#getNode').val()
|
||||
}
|
||||
}).done(function (data) {
|
||||
nodeData = data;
|
||||
$.each(data, function (ip, ports) {
|
||||
$('#getIP').append('<option value="' + ip + '">' + ip + '</option>');
|
||||
});
|
||||
$('#getIP').parent().parent().removeClass('hidden');
|
||||
}).fail(function (jqXHR) {
|
||||
alert('An error occured while attempting to get IPs and Ports avaliable on this node.');
|
||||
currentNode = null;
|
||||
console.error(jqXHR);
|
||||
}).always(function () {
|
||||
handleLoader('#load_settings');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('#getIP').on('change', function (event) {
|
||||
|
||||
if ($('#getIP').val() === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$('#getPort').html('');
|
||||
|
||||
$.each(nodeData[$('#getIP').val()], function (i, port) {
|
||||
$('#getPort').append('<option value="' + port +'">' + port + '</option>');
|
||||
});
|
||||
|
||||
$('#getPort').parent().parent().removeClass('hidden');
|
||||
|
||||
});
|
||||
|
||||
$('#getService').on('change', function (event) {
|
||||
|
||||
if ($('#getService').val() === '' || $('#getService').val() === currentService) {
|
||||
return;
|
||||
}
|
||||
|
||||
currentService = $('#getService').val();
|
||||
handleLoader('#load_services', true);
|
||||
$('#serviceOptions').slideUp();
|
||||
$('#getOption').html('<option disabled selected> -- Select a Service Option</option>');
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/admin/servers/new/service-options',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
data: {
|
||||
service: $('#getService').val()
|
||||
}
|
||||
}).done(function (data) {
|
||||
$('#startupExec').html(data.exec);
|
||||
$('input[name="startup"]').val(data.startup);
|
||||
$.each(data.options, function (i, option) {
|
||||
$('#getOption').append('<option value="' + option.id + '" data-image="' + option.docker_image + '">' + option.name + '</option>');
|
||||
});
|
||||
$('#getOption').parent().parent().removeClass('hidden');
|
||||
}).fail(function (jqXHR) {
|
||||
alert('An error occured while attempting to list options for this service.');
|
||||
currentService = null;
|
||||
console.error(jqXHR);
|
||||
}).always(function () {
|
||||
handleLoader('#load_services');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('#getOption').on('change', function (event) {
|
||||
|
||||
handleLoader('#load_services', true);
|
||||
handleLoader('#serviceOptions', true);
|
||||
$('#serverVariables').html('');
|
||||
$('input[name="custom_image_name"]').val($(this).find(':selected').data('image'));
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/admin/servers/new/service-variables',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
data: {
|
||||
option: $('#getOption').val()
|
||||
}
|
||||
}).done(function (data) {
|
||||
$.each(data, function (i, item) {
|
||||
var isRequired = (item.required === 1) ? '<span class="label label-primary">Required</span> ' : '';
|
||||
var dataAppend = ' \
|
||||
<div class="form-group col-md-12">\
|
||||
<label for="var_ref_' + item.id + '" class="control-label">' + isRequired + item.name + '</label> \
|
||||
<div>\
|
||||
<input type="text" autocomplete="off" name="env_' + item.env_variable + '" class="form-control" value="' + item.default_value + '" />\
|
||||
<p class="text-muted"><small>' + item.description + '</small></p>\
|
||||
<p class="text-muted"><small>Regex Requirements for Input: <code>' + item.regex + '</code></small></p>\
|
||||
<p class="text-muted"><small>Access in Startup: <code>@{{' + item.env_variable + '}}</code></small></p>\
|
||||
</div>\
|
||||
</div>\
|
||||
';
|
||||
$('#serverVariables').append(dataAppend);
|
||||
});
|
||||
$('#serviceOptions').slideDown();
|
||||
}).fail(function (jqXHR) {
|
||||
console.error(jqXHR);
|
||||
}).always(function () {
|
||||
handleLoader('#load_services');
|
||||
handleLoader('#serviceOptions');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Show Loading Animation
|
||||
function handleLoader (element, show) {
|
||||
|
||||
var spinner = $(element).find('.ajax_loading_position');
|
||||
var popover = $(element).find('.ajax_loading_box');
|
||||
|
||||
// Show Animation
|
||||
if (typeof show !== 'undefined') {
|
||||
var height = $(element).height();
|
||||
var width = $(element).width();
|
||||
var center_height = (height / 2) - 16;
|
||||
var center_width = (width / 2) - 16;
|
||||
spinner.css({
|
||||
'top': center_height,
|
||||
'left': center_width,
|
||||
'font-size': '32px'
|
||||
});
|
||||
popover.css({
|
||||
'height': height,
|
||||
'margin': '-20px 0 0 -5px',
|
||||
'width': width
|
||||
}).fadeIn();
|
||||
} else {
|
||||
popover.hide();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,429 +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.admin')
|
||||
|
||||
@section('title')
|
||||
Managing Server: {{ $server->name }} ({{ $server->uuidShort}})
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/admin">Admin Control</a></li>
|
||||
<li><a href="/admin/servers">Servers</a></li>
|
||||
<li class="active">{{ $server->name }} ({{ $server->uuidShort}})</li>
|
||||
</ul>
|
||||
@if($server->installed === 0)
|
||||
<div class="alert alert-warning">
|
||||
This server is still running through the install process and is not avaliable for use just yet. This message will disappear once this process is completed.
|
||||
</div>
|
||||
@elseif($server->installed === 2)
|
||||
<div class="alert alert-danger">
|
||||
This server <strong>failed</strong> to install properly. You should delete it and try to create it again or check the daemon logs.
|
||||
</div>
|
||||
@endif
|
||||
<ul class="nav nav-tabs tabs_with_panel" id="config_tabs">
|
||||
<li class="active"><a href="#tab_about" data-toggle="tab">About</a></li>
|
||||
@if($server->installed === 1)
|
||||
<li><a href="#tab_details" data-toggle="tab">Details</a></li>
|
||||
<li><a href="#tab_build" data-toggle="tab">Build Configuration</a></li>
|
||||
<li><a href="#tab_startup" data-toggle="tab">Startup</a></li>
|
||||
@endif
|
||||
@if($server->installed !== 2)
|
||||
<li><a href="#tab_manage" data-toggle="tab">Manage</a></li>
|
||||
@endif
|
||||
<li><a href="#tab_delete" data-toggle="tab">Delete</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tab_about">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-striped" style="margin-bottom: 0;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>UUID</td>
|
||||
<td>{{ $server->uuid }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Owner</td>
|
||||
<td><a href="{{ route('admin.accounts.view', $server->owner) }}">{{ $server->a_ownerEmail }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Location</td>
|
||||
<td><a href="{{ route('admin.locations') }}">{{ $server->a_locationName }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Node</td>
|
||||
<td><a href="{{ route('admin.nodes.view', $server->node) }}">{{ $server->a_nodeName }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Service</td>
|
||||
<td>{{ $server->a_serviceName }} :: {{ $server->a_servceOptionName }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>{{ $server->name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Memory</td>
|
||||
<td><code>{{ $server->memory }}MB</code> (Swap: {{ $server->swap }}MB) (OOM Killer: <strong>{{ ($server->oom_disabled === 0) ? 'enabled' : 'disabled' }}</strong>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Disk Space</td>
|
||||
<td><code>{{ $server->disk }}MB</code> (Enforced: <strong>no</strong>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Block IO Weight</td>
|
||||
<td><code>{{ $server->io }}</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CPU Limit</td>
|
||||
<td><code>{{ $server->cpu }}%</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Default Connection</td>
|
||||
<td><code>{{ $server->ip }}:{{ $server->port }}</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Installed</td>
|
||||
<td>{{ ($server->installed === 1) ? 'Yes' : 'No' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if($server->installed === 1)
|
||||
<div class="tab-pane" id="tab_details">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
<form method="POST" action="/admin/servers/view/{{ $server->id }}/details">
|
||||
<div class="form-group {{ $errors->has('name') ? 'has-error' : '' }}">
|
||||
<label for="name" class="control-label">Server Name</label>
|
||||
<div>
|
||||
<input type="text" name="name" value="{{ old('name', $server->name) }}" class="form-control" />
|
||||
<p class="text-muted"><small>Character limits: <code>a-zA-Z0-9_-</code> and <code>[Space]</code> (max 35 characters).</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group {{ $errors->has('owner') ? 'has-error' : '' }}">
|
||||
<label for="name" class="control-label">Server Owner</label>
|
||||
<div>
|
||||
<input type="text" name="owner" value="{{ old('owner', $server->a_ownerEmail) }}" class="form-control" />
|
||||
<p class="text-muted"><small>You can change the owner of this server by changing this field to an email matching another use on this system. If you do this a new daemon security token will be generated automatically.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="name" class="control-label">Daemon Secret Token</label>
|
||||
<div>
|
||||
<input type="text" disabled value="{{ $server->daemonSecret }}" class="form-control" />
|
||||
<p class="text-muted"><small>This token should not be shared with anyone as it has full control over this server.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<input type="checkbox" name="reset_token"/> Yes, Reset Daemon Token
|
||||
<p class="text-muted"><small>Resetting this token will cause any requests using the old token to fail.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-sm btn-primary" value="Update Details" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tab_build">
|
||||
<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">
|
||||
After editing any of the options below you will need to restart the server for changes to take effect. If the server is currently off, you just need to start it and the container will be rebuilt with the new settings.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form action="/admin/servers/view/{{ $server->id }}/build" method="POST">
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group {{ $errors->has('memory') ? 'has-error' : '' }}">
|
||||
<label for="memory" class="control-label">Allocated Memory</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="memory" class="form-control" value="{{ old('memory', $server->memory) }}"/>
|
||||
<span class="input-group-addon">MB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 form-group {{ $errors->has('swap') ? 'has-error' : '' }}">
|
||||
<label for="swap" class="control-label">Allocated Swap</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="swap" class="form-control" value="{{ old('swap', $server->swap) }}"/>
|
||||
<span class="input-group-addon">MB</span>
|
||||
</div>
|
||||
<p class="text-muted"><small>Setting this to <code>0</code> will disable swap space on this server.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group {{ $errors->has('cpu') ? 'has-error' : '' }}">
|
||||
<label for="cpu" class="control-label">CPU Limit</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="cpu" class="form-control" value="{{ old('cpu', $server->cpu) }}"/>
|
||||
<span class="input-group-addon">%</span>
|
||||
</div>
|
||||
<p class="text-muted"><small>Each <em>physical</em> core on the system is considered to be <code>100%</code>. Setting this value to <code>0</code> will allow a server to use CPU time without restrictions.</small></p>
|
||||
</div>
|
||||
<div class="col-md-6 form-group {{ $errors->has('io') ? 'has-error' : '' }}">
|
||||
<label for="io" class="control-label">Block IO Proportion</label>
|
||||
<div>
|
||||
<input type="text" name="io" class="form-control" value="{{ old('io', $server->io) }}"/>
|
||||
</div>
|
||||
<p class="text-muted"><small>Changing this value can have negative effects on all containers on the system. We strongly recommend leaving this value as <code>500</code>.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-info">
|
||||
Additional IPs and Ports can be assigned to this server for use by plugins or other software. The game port is what will show up for the user to use to connect to thier server, and what their configuration files will be forced to use for binding.
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 form-group">
|
||||
<label for="default" class="control-label">Game Port</label>
|
||||
@foreach ($assigned as $assignment)
|
||||
<div class="input-group" style="margin:5px auto;">
|
||||
<span class="input-group-addon">
|
||||
<input type="radio" @if($assignment->ip == $server->ip && $assignment->port == $server->port) checked="checked" @endif name="default" value="{{ $assignment->ip }}:{{ $assignment->port }}"/>
|
||||
</span>
|
||||
<input type="text" class="form-control" value="{{ $assignment->ip }}:{{ $assignment->port }}" readonly />
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-md-12 form-group">
|
||||
<label for="add_additional" class="control-label">Assign Additional Ports</label>
|
||||
<div>
|
||||
<select name="add_additional[]" class="form-control" multiple>
|
||||
@foreach ($unassigned as $assignment)
|
||||
<option value="{{ $assignment->ip }}:{{ $assignment->port }}">{{ $assignment->ip }}:{{ $assignment->port }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<p class="text-muted"><small>Please note that due to software limitations you cannot assign identical ports on different IPs to the same server. For example, you <strong>cannot</strong> assign both <code>192.168.0.5:25565</code> and <code>192.168.10.5:25565</code> to the same server.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 form-group">
|
||||
<label for="remove_additional" class="control-label">Remove Additional Ports</label>
|
||||
<div>
|
||||
<select name="remove_additional[]" class="form-control" multiple>
|
||||
@foreach ($assigned as $assignment)
|
||||
<option value="{{ $assignment->ip }}:{{ $assignment->port }}" @if($assignment->ip == $server->ip && $assignment->port == $server->port) disabled @endif>{{ $assignment->ip }}:{{ $assignment->port }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<p class="text-muted"><small>Simply select which ports you would like to remove from the list above. If you want to assign a port on a different IP that is already in use you can select it above and delete it down here.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-sm btn-primary" value="Update Build Configuration" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tab_startup">
|
||||
<form action="{{ route('admin.servers.post.startup', $server->id) }}" method="POST">
|
||||
<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">Changing any of the values below will require a restart for them to take effect.</div>
|
||||
<label class="control-label">Server Startup Command</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{{ $server->a_serviceExecutable }}</span>
|
||||
<input type="text" class="form-control" name="startup" value="{{ old('startup', $server->startup) }}" />
|
||||
</div>
|
||||
<p class="text-muted"><small>The following data replacers are avaliable for the startup command: <code>@{{SERVER_MEMORY}}</code>, <code>@{{SERVER_IP}}</code>, and <code>@{{SERVER_PORT}}</code>. They will be replaced with the allocated memory, server ip, and server port respectively.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-heading" style="border-top: 1px solid #ddd;"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
@foreach($startup 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
|
||||
@if($item->user_viewable === 0)<span data-toggle="tooltip" data-placement="top" title="Not Visible to Users" class="label label-danger"><i class="fa fa-eye-slash"></i></span> @endif
|
||||
@if($item->user_editable === 0)<span data-toggle="tooltip" data-placement="top" title="Not Editable by Users" class="label label-danger"><i class="fa fa-edit"></i></span> @endif
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
<div>
|
||||
<input type="text" name="{{ $item->env_variable }}" class="form-control" value="{{ old($item->env_variable, $item->a_serverValue) }}" data-action="matchRegex" data-regex="{{ $item->regex }}" />
|
||||
</div>
|
||||
<p class="text-muted"><small>{{ $item->description }}<br />Regex: <code>{{ $item->regex }}</code><br />Access as: <code>{{{{$item->env_variable}}}}</code></small></p>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-heading" style="border-top: 1px solid #ddd;"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-primary btn-sm" value="Update Startup Arguments" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endif
|
||||
@if($server->installed !== 2)
|
||||
<div class="tab-pane" id="tab_manage">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-center">
|
||||
<a href="/server/{{ $server->uuidShort }}/" target="_blank">
|
||||
<button type="submit" class="btn btn-sm btn-primary">Manage Server</button>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<p>This will take you to the server management page that users normally see and allow you to manage server files as well as check the console and data usage.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-heading" style="border-top: 1px solid #ddd;"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-center">
|
||||
<form action="/admin/servers/view/{{ $server->id }}/installed" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<button type="submit" class="btn btn-sm btn-primary">Toggle Install Status</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<p>This will toggle the install status for the server.</p>
|
||||
<div class="alert alert-warning">If you have just created this server it is ill advised to perform this action as the daemon will contact the panel when finished which could cause the install status to be wrongly set.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if($server->installed === 1)
|
||||
<div class="panel-heading" style="border-top: 1px solid #ddd;"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-center">
|
||||
<form action="/admin/servers/view/{{ $server->id }}/rebuild" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<button type="submit" class="btn btn-sm btn-primary">Rebuild Server Container</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<p>This will trigger a rebuild of the server container when it next starts up. This is useful if you modified the server configuration file manually, or something just didn't work out correctly.</p>
|
||||
<div class="alert alert-info">A rebuild will automatically occur whenever you edit build configuration settings for the server.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="tab-pane" id="tab_delete">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-center">
|
||||
<form action="/admin/servers/view/{{ $server->id }}" method="POST" data-attr="deleteServer">
|
||||
{!! csrf_field() !!}
|
||||
{!! method_field('DELETE') !!}
|
||||
<button type="submit" class="btn btn-sm btn-danger">Delete Server</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="alert alert-danger">Deleting a server is an irreversible action. <strong>All data will be immediately removed relating to this server.</strong></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-heading" style="border-top: 1px solid #ddd;"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-center">
|
||||
<form action="/admin/servers/view/{{ $server->id }}/force" method="POST" data-attr="deleteServer">
|
||||
{!! csrf_field() !!}
|
||||
{!! method_field('DELETE') !!}
|
||||
<button type="submit" class="btn btn-sm btn-danger">Force Delete Server</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="alert alert-danger">This is the same as deleting a server, however, if an error is returned by the daemon it is ignored and the server is still removed from the panel.</strong></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$('#sidebar_links').find("a[href='/admin/servers']").addClass('active');
|
||||
$('input[name="default"]').on('change', function (event) {
|
||||
$('select[name="remove_additional[]"]').find('option:disabled').prop('disabled', false);
|
||||
$('select[name="remove_additional[]"]').find('option[value="' + $(this).val() + '"]').prop('disabled', true).prop('selected', false);
|
||||
});
|
||||
$('[data-action="matchRegex"]').keyup(function (event) {
|
||||
if (!$(this).data('regex')) return;
|
||||
var input = $(this).val();
|
||||
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');
|
||||
}
|
||||
});
|
||||
$('form[data-attr="deleteServer"]').submit(function (event) {
|
||||
event.preventDefault();
|
||||
swal({
|
||||
title: '',
|
||||
type: 'warning',
|
||||
text: 'Are you sure that you want to delete this server? There is no going back, all data will immediately be removed.',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
confirmButtonColor: '#d9534f',
|
||||
closeOnConfirm: false
|
||||
}, function () {
|
||||
event.target.submit();
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,97 +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.admin')
|
||||
|
||||
@section('title')
|
||||
Administration
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/admin">Admin Control</a></li>
|
||||
<li class="active">Settings</li>
|
||||
</ul>
|
||||
<h3 class="nopad">Panel Settings</h3><hr />
|
||||
<form action="{{ route('admin.settings') }}" method="POST">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label class="control-label">Company Name:</label>
|
||||
<div>
|
||||
<input type="text" class="form-control" name="company" value="{{ old('company', Settings::get('company')) }}" />
|
||||
<p class="text-muted"><small>This is the name that is used throughout the panel and in emails sent to clients.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label class="control-label">Default Language:</label>
|
||||
<div>
|
||||
<select name="default_language" class="form-control">
|
||||
<option value="de" @if(Settings::get('default_language') === 'de')selected @endif>Deutsch</option>
|
||||
<option value="en" @if(Settings::get('default_language') === 'en')selected @endif>English</option>
|
||||
<option value="es" @if(Settings::get('default_language') === 'es')selected @endif>Español</option>
|
||||
<option value="fr" @if(Settings::get('default_language') === 'fr')selected @endif>Français</option>
|
||||
<option value="it" @if(Settings::get('default_language') === 'it')selected @endif>Italiano</option>
|
||||
<option value="pl" @if(Settings::get('default_language') === 'pl')selected @endif>Polski</option>
|
||||
<option value="pt" @if(Settings::get('default_language') === 'pt')selected @endif>Português</option>
|
||||
<option value="ru" @if(Settings::get('default_language') === 'ru')selected @endif>русский</option>
|
||||
<option value="se" @if(Settings::get('default_language') === 'se')selected @endif>Svenska</option>
|
||||
<option value="zh" @if(Settings::get('default_language') === 'zh')selected @endif>中国的的</option>
|
||||
</select>
|
||||
<p class="text-muted"><small>This is the default language that all clients will use unless they manually change it.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-info">In order to modify your SMTP settings for sending mail you will need to edit the <code>.env</code> file in this project's root folder.</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label class="control-label">Send Emails From:</label>
|
||||
<div>
|
||||
<input type="text" class="form-control" name="email_from" value="{{ old('email_from', Settings::get('email_from', env('MAIL_FROM', 'you@example.com'))) }}" />
|
||||
<p class="text-muted"><small>The email address that panel emails will be sent from. Note that some SMTP services require this to match for a given API key.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label class="control-label">Email Sender Name:</label>
|
||||
<div>
|
||||
<input type="text" class="form-control" name="email_sender_name" value="{{ old('email_sender_name', Settings::get('email_sender_name', env('MAIL_FROM_NAME', 'Pterodactyl Panel'))) }}" />
|
||||
<p class="text-muted"><small>The name that emails will appear to come from.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="well well-sm">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-sm btn-primary" value="Modify Settings">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find("a[href='/admin/settings']").addClass('active');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,145 +0,0 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
{{-- Some Modifications (c) 2015 Dylan Seidt <dylan.seidt@gmail.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', 'Login')
|
||||
|
||||
|
||||
@section('right-nav')
|
||||
@endsection
|
||||
|
||||
@section('sidebar')
|
||||
@endsection
|
||||
|
||||
@section('resp-alerts')
|
||||
@endsection
|
||||
|
||||
@section('resp-errors')
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-8">
|
||||
@if (count($errors) > 0)
|
||||
<div class="alert alert-danger">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<strong>{{ trans('strings.whoops') }}!</strong> {{ trans('auth.errorencountered') }}<br><br>
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@foreach (Alert::getMessages() as $type => $messages)
|
||||
@foreach ($messages as $message)
|
||||
<div class="alert alert-{{ $type }} alert-dismissable" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
{!! $message !!}
|
||||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
<form action="/auth/login" method="POST" id="login-form">
|
||||
<legend>{{ trans('strings.login') }}</legend>
|
||||
<fieldset>
|
||||
<div class="form-group">
|
||||
<label for="email" class="control-label">{{ trans('strings.email') }}</label>
|
||||
<div>
|
||||
<input type="text" class="form-control" name="email" id="email" value="{{ old('email') }}" placeholder="{{ trans('strings.email') }}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="login-password" class="control-label">{{ trans('strings.password') }}</label>
|
||||
<div>
|
||||
<input type="password" class="form-control" name="password" id="password" placeholder="{{ trans('strings.password') }}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<label><input type="checkbox" name="remember" /> {{ trans('auth.remeberme') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-primary btn-sm" value="{{ trans('strings.login') }}" />
|
||||
<button class="btn btn-default btn-sm" onclick="window.location='/auth/password';return false;">{{ trans('auth.resetpassword') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal fade" id="openTOTP" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" style="width:400px;">
|
||||
<form action="/auth/login" method="POST" id="totp-form">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Two-Factor Authentication Checkpoint</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="modal_insert_content">
|
||||
<div class="form-group">
|
||||
<label for="totp_token" class="control-label">Two-Factor Authentication Token</label>
|
||||
<div>
|
||||
<input class="form-control" type="text" placeholder="000111" name="totp_token" id="totp_token" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<input type="submit" class="btn btn-default btn-sm" value="Continue" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3"></div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#login-form').one('submit', function (event) {
|
||||
event.preventDefault();
|
||||
var check_email = $('#email').val();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/auth/login/totp',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
data: {
|
||||
email: check_email
|
||||
}
|
||||
}).done(function (data) {
|
||||
if (typeof data.id !== 'undefined') {
|
||||
$('#openTOTP').modal('show');
|
||||
$('#openTOTP').on('shown.bs.modal', function() {
|
||||
$('#totp_token').focus();
|
||||
});
|
||||
} else {
|
||||
$('#login-form').submit();
|
||||
}
|
||||
}).fail(function (jqXHR) {
|
||||
alert('Unable to validate potential TOTP need.');
|
||||
console.error(jqXHR);
|
||||
});
|
||||
});
|
||||
$('#totp-form').submit(function () {
|
||||
return $('#login-form :input').not(':submit').clone().hide().appendTo('#totp-form');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,58 +0,0 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
{{-- Some Modifications (c) 2015 Dylan Seidt <dylan.seidt@gmail.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', 'Reset Password')
|
||||
|
||||
|
||||
@section('right-nav')
|
||||
@endsection
|
||||
|
||||
@section('sidebar')
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-8">
|
||||
<form action="/auth/password" method="POST">
|
||||
<legend>{{ trans('auth.resetpassword') }}</legend>
|
||||
<fieldset>
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
<strong>{{ trans('strings.success') }}!</strong> {{ trans('auth.emailsent') }}
|
||||
</div>
|
||||
@endif
|
||||
<div class="form-group">
|
||||
<label for="email" class="control-label">{{ trans('strings.email') }}</label>
|
||||
<div>
|
||||
<input type="text" class="form-control" name="email" id="email" value="{{ old('email') }}" placeholder="{{ trans('strings.email') }}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
{!! csrf_field() !!}
|
||||
<button class="btn btn-default btn-sm">{{ trans('auth.sendlink') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-3"></div>
|
||||
@endsection
|
|
@ -1,66 +0,0 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
{{-- Some Modifications (c) 2015 Dylan Seidt <dylan.seidt@gmail.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', 'Reset Password')
|
||||
|
||||
|
||||
@section('right-nav')
|
||||
@endsection
|
||||
|
||||
@section('sidebar')
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-8">
|
||||
<form action="/auth/password/reset" method="POST">
|
||||
<legend>{{ trans('auth.resetpassword') }}</legend>
|
||||
<fieldset>
|
||||
<input type="hidden" name="token" value="{{ $token }}">
|
||||
<div class="form-group">
|
||||
<label for="email" class="control-label">{{ trans('strings.email') }}</label>
|
||||
<div>
|
||||
<input type="text" class="form-control" name="email" id="email" value="{{ old('email') }}" placeholder="{{ trans('strings.email') }}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="control-label">{{ trans('strings.password') }}</label>
|
||||
<div>
|
||||
<input type="password" class="form-control" name="password" id="password" placeholder="{{ trans('strings.password') }}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password_confirmation" class="control-label">{{ trans('auth.confirmpassword') }}</label>
|
||||
<div>
|
||||
<input type="password" class="form-control" id="password_confirmation" name="password_confirmation" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
{!! csrf_field() !!}
|
||||
<button class="btn btn-primary btn-sm">{{ trans('auth.resetpassword') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-3"></div>
|
||||
@endsection
|
|
@ -1,90 +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', 'Your Account')
|
||||
|
||||
@section('sidebar-server')
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3 class="nopad">{{ trans('base.account.update_pass') }}</h3><hr />
|
||||
<form action="/account/password" method="post">
|
||||
<div class="form-group">
|
||||
<label for="current_password" class="control-label">{{ trans('strings.current_password') }}</label>
|
||||
<div>
|
||||
<input type="password" class="form-control" name="current_password" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="new_password" class="control-label">{{ trans('base.account.new_password') }}</label>
|
||||
<div>
|
||||
<input type="password" class="form-control" name="new_password" />
|
||||
<p class="text-muted"><small>{{ trans('base.password_req') }}</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="new_password_again" class="control-label">{{ trans('base.account.new_password') }} {{ trans('strings.again') }}</label>
|
||||
<div>
|
||||
<input type="password" class="form-control" name="new_password_confirmation" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-primary btn-sm" value="{{ trans('base.account.update_pass') }}" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h3 class="nopad">{{ trans('base.account.update_email') }}</h3><hr />
|
||||
<form action="/account/email" method="post">
|
||||
<div class="form-group">
|
||||
<label for="new_email" class="control-label">{{ trans('base.account.new_email') }}</label>
|
||||
<div>
|
||||
<input type="text" class="form-control" name="new_email" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="control-label">{{ trans('strings.current_password') }}</label>
|
||||
<div>
|
||||
<input type="password" class="form-control" name="password" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-primary btn-sm" value="{{ trans('base.account.update_email') }}" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find('a[href=\'/account\']').addClass('active');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,126 +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', 'Your Servers')
|
||||
|
||||
@section('sidebar-server')
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
@if (Auth::user()->root_admin == 1)
|
||||
<div class="alert alert-info">{{ trans('base.view_as_admin') }}</div>
|
||||
@endif
|
||||
@if (!$servers->isEmpty())
|
||||
<table class="table table-striped table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
@if (Auth::user()->root_admin == 1)
|
||||
<th></th>
|
||||
@endif
|
||||
<th>{{ trans('base.server_name') }}</th>
|
||||
<th>{{ trans('strings.node') }}</th>
|
||||
<th>{{ trans('strings.connection') }}</th>
|
||||
<th class="text-center">{{ trans('strings.players') }}</th>
|
||||
<th class="text-center">{{ trans('strings.memory') }}</th>
|
||||
<th class="text-center">{{ trans('strings.cpu') }}</th>
|
||||
<th class="text-center">{{ trans('strings.status') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($servers as $server)
|
||||
<tr class="dynUpdate" data-server="{{ $server->uuidShort }}">
|
||||
@if (Auth::user()->root_admin == 1)
|
||||
<td style="width:26px;">
|
||||
@if ($server->owner === Auth::user()->id)
|
||||
<i class="fa fa-circle" style="color:#008cba;"></i>
|
||||
@else
|
||||
<i class="fa fa-circle" style="color:#ddd;"></i>
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
<td><a href="/server/{{ $server->uuidShort }}">{{ $server->name }}</a></td>
|
||||
<td>{{ $server->nodeName }} ({{ $server->a_locationShort }})</td>
|
||||
<td><code>{{ $server->ip }}:{{ $server->port }}</code></td>
|
||||
<td class="text-center" data-action="players">--</td>
|
||||
<td class="text-center"><span data-action="memory">--</span> / {{ $server->memory }} MB</td>
|
||||
<td class="text-center"><span data-action="cpu" data-cpumax="{{ $server->cpu }}">--</span> %</td>
|
||||
<td class="text-center" data-action="status">--</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">{!! $servers->render() !!}</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-info">{{ trans('base.no_servers') }}</div>
|
||||
@endif
|
||||
</div>
|
||||
<script>
|
||||
$(window).load(function () {
|
||||
$('#sidebar_links').find('a[href=\'/\']').addClass('active');
|
||||
function updateServerStatus () {
|
||||
var Status = {
|
||||
0: 'Off',
|
||||
1: 'On',
|
||||
2: 'Starting',
|
||||
3: 'Stopping'
|
||||
};
|
||||
$('.dynUpdate').each(function (index, data) {
|
||||
var element = $(this);
|
||||
var serverShortUUID = $(this).data('server');
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/server/' + serverShortUUID + '/ajax/status',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
}).done(function (data) {
|
||||
if (typeof data.status === 'undefined') {
|
||||
return;
|
||||
}
|
||||
element.find('[data-action="status"]').html(Status[data.status]);
|
||||
if (data.status !== 0) {
|
||||
var cpuMax = element.find('[data-action="cpu"]').data('cpumax');
|
||||
var currentCpu = data.proc.cpu.total;
|
||||
if (cpuMax !== 0) {
|
||||
currentCpu = parseFloat(((data.proc.cpu.total / cpuMax) * 100).toFixed(2).toString());
|
||||
}
|
||||
element.find('[data-action="memory"]').html(parseInt(data.proc.memory.total / (1024 * 1024)));
|
||||
element.find('[data-action="cpu"]').html(currentCpu);
|
||||
element.find('[data-action="players"]').html(data.query.players.length);
|
||||
} else {
|
||||
element.find('[data-action="memory"]').html('--');
|
||||
element.find('[data-action="cpu"]').html('--');
|
||||
element.find('[data-action="players"]').html('--');
|
||||
}
|
||||
}).fail(function (jqXHR) {
|
||||
console.error(jqXHR);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
updateServerStatus();
|
||||
setInterval(updateServerStatus, 10000);
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,174 +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', 'Account TOTP Settings')
|
||||
|
||||
@section('sidebar-server')
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
@foreach (Alert::getMessages() as $type => $messages)
|
||||
@foreach ($messages as $message)
|
||||
<div class="alert alert-{{ $type }} alert-dismissable" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
{{ $message }}
|
||||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
<h3 style="margin-top:0;">{{ trans('base.account.totp_header') }} <small>@if (Auth::user()->use_totp === 1){{ trans('strings.enabled') }}@else{{ trans('strings.disabled') }}@endif</small></h3><hr />
|
||||
@if (Auth::user()->use_totp === 1)
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">{{ trans('base.account.totp_disable') }}</div>
|
||||
<div class="panel-body">
|
||||
<p>{{ trans('base.account.totp_disable_help') }}</p>
|
||||
<br />
|
||||
<form action="/account/totp" method="post">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{{ trans('base.account.totp_token') }}</span>
|
||||
<input type="text" name="token" class="form-control">
|
||||
<span class="input-group-btn">
|
||||
{!! csrf_field() !!}
|
||||
{{ method_field('DELETE') }}
|
||||
<button class="btn btn-danger btn-sm" type="submit">{{ trans('base.account.totp_disable') }}</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">{{ trans('base.account.totp_header') }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>{{ trans('base.account.totp_enable_help') }}</p>
|
||||
<div class="alert alert-info" style="margin-bottom: 0;">{{ trans('base.account.totp_apps') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<form action="#" id="do_totp" method="post">
|
||||
<div class="form-group">
|
||||
<div>
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" id="enable_totp" class="btn btn-success btn-sm" name="enable_totp" value="{{ trans('base.account.totp_enable') }}" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endif
|
||||
<div class="modal fade" id="openTOTP" tabindex="-1" role="dialog" aria-labelledby="openTOTP" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form action="#" method="post" id="totp_token_verify">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">{{ trans('base.account.totp_qr') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="modal_insert_content">
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="notice_box_totp" style="display:none;"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<center><span id="hide_img_load"><i class="fa fa-spinner fa-spin"></i> Loading QR Code...</span><img src="" id="qr_image_insert" style="display:none;"/><br /><code id="totp_secret_insert"></code></center>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="alert alert-info">{{ trans('base.account.totp_checkpoint_help') }}</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="totp_token">TOTP Token</label>
|
||||
{!! csrf_field() !!}
|
||||
<input class="form-control" type="text" id="totp_token" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-primary btn-sm" id="submit_action">{{ trans('strings.submit') }}</button>
|
||||
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal" id="close_reload">{{ trans('strings.close') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#sidebar_links').find('a[href=\'/account/totp\']').addClass('active');
|
||||
|
||||
$('#close_reload').click(function () {
|
||||
location.reload();
|
||||
});
|
||||
|
||||
$('#do_totp').submit(function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
$.ajax({
|
||||
type: 'PUT',
|
||||
url: '/account/totp',
|
||||
headers: { 'X-CSRF-Token': '{{ csrf_token() }}' }
|
||||
}).done(function (data) {
|
||||
var image = new Image();
|
||||
image.src = data.qrImage;
|
||||
$(image).load(function () {
|
||||
$('#hide_img_load').slideUp(function () {
|
||||
$('#qr_image_insert').attr('src', image.src).slideDown();
|
||||
});
|
||||
});
|
||||
$('#totp_secret_insert').html(data.secret);
|
||||
$('#openTOTP').modal('show');
|
||||
}).fail(function (jqXHR) {
|
||||
alert('An error occured while attempting to perform this action. Please try again.');
|
||||
console.log(jqXHR);
|
||||
});
|
||||
|
||||
});
|
||||
$('#totp_token_verify').submit(function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
$('#submit_action').html('<i class="fa fa-spinner fa-spin"></i> {{ trans('strings.submit') }}').addClass('disabled');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url:'/account/totp',
|
||||
headers: { 'X-CSRF-Token': '{{ csrf_token() }}' },
|
||||
data: {
|
||||
token: $('#totp_token').val()
|
||||
}
|
||||
}).done(function (data) {
|
||||
$('#notice_box_totp').hide();
|
||||
if (data === 'true') {
|
||||
$('#notice_box_totp').html('<div class="alert alert-success">{{ trans('base.account.totp_enabled') }}</div>').slideDown();
|
||||
} else {
|
||||
$('#notice_box_totp').html('<div class="alert alert-danger">{{ trans('base.account.totp_enabled_error') }}</div>').slideDown();
|
||||
}
|
||||
}).fail(function (jqXHR) {
|
||||
alert('An error occured while attempting to perform this action. Please try again.');
|
||||
console.log(jqXHR);
|
||||
}).always(function () {
|
||||
$('#submit_action').html('{{ trans('strings.submit') }}').removeClass('disabled');
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,28 +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. --}}
|
||||
<html>
|
||||
<head>
|
||||
<title>Pterodactyl - You've been added to a Server</title>
|
||||
</head>
|
||||
<body>
|
||||
<center><h1>Pterodactyl - Added to Server</h1></center>
|
||||
<p>You are recieving this email because you have been added as a subuser for <a href="{{ $url }}">{{ $serverName }}</a> on Pterodactyl Panel.</p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,31 +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. --}}
|
||||
<html>
|
||||
<head>
|
||||
<title>Pterodactyl - New Account</title>
|
||||
</head>
|
||||
<body>
|
||||
<center><h1>Pterodactyl - Account Created</h1></center>
|
||||
<p>You are recieving this email because an account has been created for you on Pterodactyl Panel.</p>
|
||||
<p>Login: <a href="{{ $login }}">{{ $login }}</a></p>
|
||||
<p>Email: {{ $email }}</p>
|
||||
<p>Forgot your password? <a href="{{ $forgot }}">{{ $forgot }}</a></p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,32 +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. --}}
|
||||
<html>
|
||||
<head>
|
||||
<title>Pterodactyl - Admin Reset Password</title>
|
||||
</head>
|
||||
<body>
|
||||
<center><h1>Pterodactyl - Admin Reset Password</h1></center>
|
||||
<p>Hello there! You are receiving this email because an admin has reset the password on your Pterodactyl account.</p>
|
||||
<p><strong>Login:</strong> <a href="{{ config('app.url') }}/auth/login">{{ config('app.url') }}/auth/login</a><br>
|
||||
<strong>Email:</strong> {{ $user->email }}<br>
|
||||
<strong>Password:</strong> {{ $password }}</p>
|
||||
<p>Thanks,<br>Pterodactyl</p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,32 +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. --}}
|
||||
<html>
|
||||
<head>
|
||||
<title>Pterodactyl Lost Password Recovery</title>
|
||||
</head>
|
||||
<body>
|
||||
<center><h1>Pterodactyl Lost Password Recovery</h1></center>
|
||||
<p>Hello there! You are receiving this email because you requested a new password for your Pterodactyl account.</p>
|
||||
<p>Please click the link below to confirm that you wish to change your password. If you did not make this request, or do not wish to continue simply ignore this email and nothing will happen. <strong>This link will expire in 1 hour.</strong></p>
|
||||
<p><a href="{{ url('auth/password/reset/'.$token) }}">{{ url('auth/password/reset/'.$token) }}</a></p>
|
||||
<p>Please do not hesitate to contact us if you belive something is wrong.
|
||||
<p>Thanks!<br />Pterodactyl</p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,37 +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', '403: Forbidden')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-danger">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">HTTP 403: Access Denied</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p style="margin-bottom:0;">You do not have permission to access that function. Please contact your server administrator to request permission.</p>
|
||||
</div>
|
||||
</div>
|
||||
<p style="text-align:center;"><img src="{{ asset('images/403.jpg') }}" /></p>
|
||||
<p style="text-align:center;"><a href="{{ URL::previous() }}">Take me back</a> or <a href="/">go home</a>.</p>
|
||||
</div>
|
||||
@endsection
|
|
@ -1,37 +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', '404: Not Found')
|
||||
|
||||
|
||||
@section('right-nav')
|
||||
@endsection
|
||||
|
||||
@section('sidebar')
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-8">
|
||||
<h1 class="text-center">404 - File Not Found</h1>
|
||||
<p class="text-center"><img src="{{ asset('images/404.jpg') }}" /></p>
|
||||
<p class="text-center"><a href="{{ URL::previous() }}">Take me back</a> or <a href="/">go home</a>.</p>
|
||||
</div>
|
||||
@endsection
|
|
@ -1,47 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Be right back.</title>
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css">
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
color: #B0BEC5;
|
||||
display: table;
|
||||
font-weight: 100;
|
||||
font-family: 'Lato';
|
||||
}
|
||||
|
||||
.container {
|
||||
text-align: center;
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.content {
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 72px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<div class="title">Be right back.</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,40 +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', '503: Server Temporarily Unavaliable')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-danger">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">HTTP 503: Temporarily Unavaliable</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p style="margin-bottom:0;">The requested server is still completing the install process. Please check back in a few minutes, you should recieve an email as soon as this process is completed.</p>
|
||||
<br /><br />
|
||||
<div class="progress progress-striped active">
|
||||
<div class="progress-bar progress-bar-danger" style="width: 75%"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p style="text-align:center;"><a href="{{ URL::previous() }}">Take me back</a> or <a href="/">go home</a>.</p>
|
||||
</div>
|
||||
@endsection
|
|
@ -1,210 +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. --}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@section('scripts')
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="noindex">
|
||||
<link rel="stylesheet" href="{{ asset('css/bootstrap.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('css/pterodactyl.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('css/animate.css') }}">
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/fuelux/3.13.0/css/fuelux.min.css" />
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/js/bootstrap.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/fuelux/3.13.0/js/fuelux.min.js"></script>
|
||||
<script src="{{ asset('js/admin.min.js') }}"></script>
|
||||
@show
|
||||
<title>{{ Settings::get('company') }} - @yield('title')</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="alert alert-danger" style="margin:10px auto -20px;">
|
||||
<strong>Warning:</strong> You are running a developmental build of Pterodactyl Panel. Do not under any circumstances run this on a live environment. We cannot be held liable for any damages caused to your system by this panel.
|
||||
</div>
|
||||
<div class="navbar navbar-default">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">{{ Settings::get('company') }}</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse navbar-responsive-collapse">
|
||||
@section('navbar-links')
|
||||
<ul class="nav navbar-nav hidden-md hidden-lg">
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Management <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/admin">Admin Index</a></li>
|
||||
<li><a href="/admin/settings">General Settings</a></li>
|
||||
<li><a href="/admin/api">API Management</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Accounts <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/admin/accounts">Find Account</a></li>
|
||||
<li><a href="/admin/accounts/new">New Account</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Servers <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/admin/servers">Find Server</a></li>
|
||||
<li><a href="/admin/servers/new">New Server</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Nodes <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/admin/nodes">List Nodes</a></li>
|
||||
<li><a href="/admin/locations">Manage Locations</a></li>
|
||||
<li><a href="/admin/nodes/new">New Node</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Services <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/admin/services">List Services</a></li>
|
||||
<li><a href="/admin/services/new">Add Service</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@show
|
||||
@section('right-nav')
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ trans('strings.language') }}<b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/language/de">Deutsch</a></li>
|
||||
<li><a href="/language/en">English</a></li>
|
||||
<li><a href="/language/es">Español</a></li>
|
||||
<li><a href="/language/fr">Français</a></li>
|
||||
<li><a href="/language/it">Italiano</a></li>
|
||||
<li><a href="/language/pl">Polski</a></li>
|
||||
<li><a href="/language/pt">Português</a></li>
|
||||
<li><a href="/language/ru">русский</a></li>
|
||||
<li><a href="/language/se">Svenska</a></li>
|
||||
<li><a href="/language/zh">中国的的</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="hidden-xs"><a href="/"><i class="fa fa-server"></i></a></li>
|
||||
<li class="visible-xs"><a href="/"><i class="fa fa-server"></i> Server View</a></li>
|
||||
<li class="hidden-xs"><a href="/auth/logout"><i class="fa fa-power-off"></i></a></li>
|
||||
<li class="visible-xs"><a href="/auth/logout"><i class="fa fa-power-off"></i> Logout</a></li>
|
||||
</ul>
|
||||
@show
|
||||
</div>
|
||||
</div>
|
||||
<!-- Add Back Mobile Support -->
|
||||
<div class="row">
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar_links">
|
||||
@section('sidebar')
|
||||
<div class="list-group">
|
||||
<a href="#" class="list-group-item list-group-item-heading"><strong>Management</strong></a>
|
||||
<a href="/admin" id="sidenav_admin-index" class="list-group-item">Admin Index</a>
|
||||
<a href="/admin/settings" class="list-group-item">General Settings</a>
|
||||
<a href="/admin/api" class="list-group-item">API Management</a>
|
||||
</div>
|
||||
<div class="list-group">
|
||||
<a href="#" class="list-group-item list-group-item-heading"><strong>Account Management</strong></a>
|
||||
<a href="/admin/accounts" class="list-group-item">Find Account</a>
|
||||
<a href="/admin/accounts/new" class="list-group-item">New Account</a>
|
||||
</div>
|
||||
<div class="list-group">
|
||||
<a href="#" class="list-group-item list-group-item-heading"><strong>Server Management</strong></a>
|
||||
<a href="/admin/servers" class="list-group-item">Find Server</a>
|
||||
<a href="/admin/servers/new" class="list-group-item">New Server</a>
|
||||
</div>
|
||||
<div class="list-group">
|
||||
<a href="#" class="list-group-item list-group-item-heading"><strong>Node Management</strong></a>
|
||||
<a href="/admin/nodes" class="list-group-item">List Nodes</a>
|
||||
<a href="/admin/locations" class="list-group-item">Manage Locations</a>
|
||||
<a href="/admin/nodes/new" class="list-group-item">Add Node</a>
|
||||
</div>
|
||||
<div class="list-group">
|
||||
<a href="#" class="list-group-item list-group-item-heading"><strong>Service Management</strong></a>
|
||||
<a href="/admin/services" class="list-group-item">List Services</a>
|
||||
<a href="/admin/services/new" class="list-group-item">Add Service</a>
|
||||
</div>
|
||||
@show
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="tpl_messages">
|
||||
@if (count($errors) > 0)
|
||||
<div class="alert alert-danger">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<strong>{{ trans('strings.whoops') }}!</strong> {{ trans('auth.errorencountered') }}<br><br>
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@foreach (Alert::getMessages() as $type => $messages)
|
||||
@foreach ($messages as $message)
|
||||
<div class="alert alert-{{ $type }} alert-dismissable" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
{!! $message !!}
|
||||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@yield('content')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
Copyright © 2015 - {{ date('Y') }} <a href="https://github.com/Pterodactyl/Panel" target="_blank">Pterodactyl Software & Design</a>.<br />
|
||||
Pterodactyl is licensed under a <a href="https://opensource.org/licenses/MIT" target="_blank">MIT</a> license. <!-- Please do not remove this license notice. We can't stop you though... :) -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
// Remeber Active Tab and Navigate to it on Reload
|
||||
for(var queryParameters={},queryString=location.search.substring(1),re=/([^&=]+)=([^&]*)/g,m;m=re.exec(queryString);)queryParameters[decodeURIComponent(m[1])]=decodeURIComponent(m[2]);$("a[data-toggle='tab']").click(function(){queryParameters.tab=$(this).attr("href").substring(1),window.history.pushState(null,null,location.pathname+"?"+$.param(queryParameters))});
|
||||
if($.urlParam('tab') != null){$('.nav.nav-tabs a[href="#' + $.urlParam('tab') + '"]').tab('show');}
|
||||
|
||||
@if (count($errors) > 0)
|
||||
@foreach ($errors->all() as $error)
|
||||
<?php preg_match('/^The\s(.*?)\s/', $error, $matches) ?>
|
||||
@if (isset($matches[1]))
|
||||
$('[name="{{ $matches[1] }}"]').parent().parent().addClass('has-error');
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,322 +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. --}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@section('scripts')
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="noindex">
|
||||
<link rel="stylesheet" href="{{ asset('css/bootstrap.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('css/pterodactyl.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('css/animate.css') }}">
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/fuelux/3.13.0/css/fuelux.min.css" />
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/js/bootstrap.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.7/socket.io.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/fuelux/3.13.0/js/fuelux.min.js"></script>
|
||||
<script src="{{ asset('js/admin.min.js') }}"></script>
|
||||
<script src="{{ asset('js/bootstrap-notify.min.js') }}"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$.notifyDefaults({
|
||||
placement: {
|
||||
from: 'bottom',
|
||||
align: 'right'
|
||||
},
|
||||
newest_on_top: true,
|
||||
delay: 2000,
|
||||
animate: {
|
||||
enter: 'animated fadeInUp',
|
||||
exit: 'animated fadeOutDown'
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@section('server-socket')
|
||||
@if (isset($server->name) && isset($node->name))
|
||||
<script>
|
||||
var socket;
|
||||
var notifySocketError = false;
|
||||
$(window).load(function () {
|
||||
|
||||
// Main Socket Object
|
||||
socket = io('{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/ws/{{ $server->uuid }}', {
|
||||
'query': 'token={{ $server->daemonSecret }}'
|
||||
});
|
||||
|
||||
// Socket Failed to Connect
|
||||
socket.io.on('connect_error', function (err) {
|
||||
$('#applyUpdate').removeClass('fa-circle-o-notch fa-spinner fa-spin').addClass('fa-question-circle').css({ color: '#FF9900' });
|
||||
if(typeof notifySocketError !== 'object') {
|
||||
notifySocketError = $.notify({
|
||||
message: '{!! trans('server.ajax.socket_error') !!}'
|
||||
}, {
|
||||
type: 'danger',
|
||||
delay: 0
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Connected to Socket Successfully
|
||||
socket.on('connect', function () {
|
||||
if (notifySocketError !== false) {
|
||||
notifySocketError.close();
|
||||
notifySocketError = 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.');
|
||||
});
|
||||
|
||||
// Socket Sends Server Status on Connect
|
||||
socket.on('initial_status', function (data) {
|
||||
var color = '#E33200';
|
||||
var selector = 'fa-times-circle';
|
||||
|
||||
if (data.status === 1) {
|
||||
color = '#53B30C';
|
||||
selector = 'fa-check-circle';
|
||||
}
|
||||
|
||||
$('#applyUpdate').removeClass('fa-circle-o-notch fa-spinner fa-spin fa-check-circle fa-times-circle').addClass(selector).css({ color: color });
|
||||
});
|
||||
|
||||
// Socket Recieves New Status from Scales
|
||||
socket.on('status', function(data) {
|
||||
if(data.status !== 'crashed') {
|
||||
|
||||
var newStatus, selector = 'fa-times-circle';
|
||||
var color = '#E33200';
|
||||
|
||||
switch (data.status) {
|
||||
case 0:
|
||||
newStatus = 'OFF';
|
||||
break;
|
||||
case 1:
|
||||
newStatus = 'ON';
|
||||
color = "#53B30C";
|
||||
selector = "fa-check-circle";
|
||||
break;
|
||||
case 2:
|
||||
newStatus = 'STARTING';
|
||||
break;
|
||||
case 3:
|
||||
newStatus = 'STOPPING';
|
||||
break;
|
||||
}
|
||||
|
||||
$('#applyUpdate').removeClass('fa-circle-o-notch fa-spinner fa-spin fa-check-circle fa-times-circle').addClass(selector).css({ color: color });
|
||||
|
||||
$.notify({
|
||||
message: '{{ trans('server.ajax.socket_status') }} <strong>' + newStatus + '</strong>.'
|
||||
}, {
|
||||
type: 'info'
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
$.notify({
|
||||
message: '{{ trans('server.ajax.socket_status_crashed') }}'
|
||||
}, {
|
||||
delay: 5000,
|
||||
type: 'danger'
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
@show
|
||||
@show
|
||||
<title>{{ Settings::get('company') }} - @yield('title')</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="alert alert-danger" style="margin:10px auto -20px;">
|
||||
<strong>Warning:</strong> You are running a developmental build of Pterodactyl Panel. Do not under any circumstances run this on a live environment. We cannot be held liable for any damages caused to your system by this panel.
|
||||
</div>
|
||||
<div class="navbar navbar-default">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">{{ Settings::get('company') }}</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse navbar-responsive-collapse">
|
||||
@section('server-name')
|
||||
@if (isset($server->name) && isset($node->name))
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="active" id="{{ $server->name }}"><a href="/server/{{ $server->id }}/index"><i id="applyUpdate" class="fa fa-circle-o-notch fa-spinner fa-spin spin-light"></i> {{ $server->name }}</a></li>
|
||||
</ul>
|
||||
@endif
|
||||
@show
|
||||
@section('navbar-links')
|
||||
<ul class="nav navbar-nav hidden-md hidden-lg">
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ trans('pagination.sidebar.account_controls') }} <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/account">{{ trans('pagination.sidebar.account_settings') }}</a></li>
|
||||
<li><a href="/account/totp">{{ trans('pagination.sidebar.account_security') }}</a></li>
|
||||
<li><a href="/index">{{ trans('pagination.sidebar.servers') }}</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@if (isset($server->name) && isset($node->name))
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ trans('pagination.sidebar.server_controls') }} <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="server-index"><a href="/server/{{ $server->uuidShort }}">{{ trans('pagination.sidebar.overview') }}</a></li>
|
||||
@can('list-files', $server)<li class="server-files"><a href="/server/{{ $server->uuidShort }}/files">{{ trans('pagination.sidebar.files') }}</a></li>@endcan
|
||||
@can('list-subusers', $server)<li class="server-users"><a href="/server/{{ $server->uuidShort }}/users">{{ trans('pagination.sidebar.subusers') }}</a></li>@endcan
|
||||
@can('view-sftp', $server)
|
||||
<li class="server-settings"><a href="/server/{{ $server->uuidShort }}/settings">{{ trans('pagination.sidebar.manage') }}</a></li>
|
||||
@else
|
||||
@can('view-startup', $server)
|
||||
<li class="server-settings"><a href="/server/{{ $server->uuidShort }}/settings">{{ trans('pagination.sidebar.manage') }}</a></li>
|
||||
@endcan
|
||||
@endcan
|
||||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
@show
|
||||
@section('right-nav')
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ trans('strings.language') }}<b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/language/de">Deutsch</a></li>
|
||||
<li><a href="/language/en">English</a></li>
|
||||
<li><a href="/language/es">Español</a></li>
|
||||
<li><a href="/language/fr">Français</a></li>
|
||||
<li><a href="/language/it">Italiano</a></li>
|
||||
<li><a href="/language/pl">Polski</a></li>
|
||||
<li><a href="/language/pt">Português</a></li>
|
||||
<li><a href="/language/ru">русский</a></li>
|
||||
<li><a href="/language/se">Svenska</a></li>
|
||||
<li><a href="/language/zh">中国的的</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@if (null !== Auth::user() && Auth::user()->root_admin == 1)
|
||||
<li class="hidden-xs"><a href="/admin/"><i class="fa fa-cogs"></i></a></li>
|
||||
<li class="visible-xs"><a href="/admin/"><i class="fa fa-cogs"></i> Admin Control Panel</a></li>
|
||||
@endif
|
||||
<li class="hidden-xs"><a href="/auth/logout"><i class="fa fa-power-off"></i></a></li>
|
||||
<li class="visible-xs"><a href="/auth/logout"><i class="fa fa-power-off"></i> Logout</a></li>
|
||||
</ul>
|
||||
@show
|
||||
</div>
|
||||
</div>
|
||||
<!-- Add Back Mobile Support -->
|
||||
<div class="row">
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar_links">
|
||||
@section('sidebar')
|
||||
<div class="list-group">
|
||||
<a href="#" class="list-group-item list-group-item-heading"><strong>{{ trans('pagination.sidebar.account_controls') }}</strong></a>
|
||||
<a href="/account" class="list-group-item">{{ trans('pagination.sidebar.account_settings') }}</a>
|
||||
<a href="/account/totp" class="list-group-item">{{ trans('pagination.sidebar.account_security') }}</a>
|
||||
<a href="/" class="list-group-item">{{ trans('pagination.sidebar.servers') }}</a>
|
||||
</div>
|
||||
@section('sidebar-server')
|
||||
@if (isset($server->name) && isset($node->name))
|
||||
<div class="list-group">
|
||||
<a href="#" class="list-group-item list-group-item-heading"><strong>{{ trans('pagination.sidebar.server_controls') }}</strong></a>
|
||||
<a href="/server/{{ $server->uuidShort }}/" class="list-group-item server-index">{{ trans('pagination.sidebar.overview') }}</a>
|
||||
@can('list-files', $server)<a href="/server/{{ $server->uuidShort }}/files" class="list-group-item server-files">{{ trans('pagination.sidebar.files') }}</a>@endcan
|
||||
@can('list-subusers', $server)<a href="/server/{{ $server->uuidShort }}/users" class="list-group-item server-users">{{ trans('pagination.sidebar.subusers') }}</a>@endcan
|
||||
@can('view-sftp', $server)
|
||||
<a href="/server/{{ $server->uuidShort }}/settings" class="list-group-item server-settings">{{ trans('pagination.sidebar.manage') }}</a>
|
||||
@else
|
||||
@can('view-startup', $server)
|
||||
<a href="/server/{{ $server->uuidShort }}/settings" class="list-group-item server-settings">{{ trans('pagination.sidebar.manage') }}</a>
|
||||
@endcan
|
||||
@endcan
|
||||
</div>
|
||||
@endif
|
||||
@show
|
||||
@show
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="tpl_messages">
|
||||
@section('resp-errors')
|
||||
@if (count($errors) > 0)
|
||||
<div class="alert alert-danger">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<strong>{{ trans('strings.whoops') }}!</strong> {{ trans('auth.errorencountered') }}<br><br>
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@show
|
||||
@section('resp-alerts')
|
||||
@foreach (Alert::getMessages() as $type => $messages)
|
||||
@foreach ($messages as $message)
|
||||
<div class="alert alert-{{ $type }} alert-dismissable" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
{!! $message !!}
|
||||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
@show
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@yield('content')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
Copyright © 2015 - {{ date('Y') }} <a href="https://github.com/Pterodactyl/Panel" target="_blank">Pterodactyl Software & Design</a>.<br />
|
||||
Pterodactyl is licensed under a <a href="https://opensource.org/licenses/MIT" target="_blank">MIT</a> license. <!-- Please do not remove this license notice. We can't stop you though... :) -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
// Remeber Active Tab and Navigate to it on Reload
|
||||
for(var queryParameters={},queryString=location.search.substring(1),re=/([^&=]+)=([^&]*)/g,m;m=re.exec(queryString);)queryParameters[decodeURIComponent(m[1])]=decodeURIComponent(m[2]);$("a[data-toggle='tab']").click(function(){queryParameters.tab=$(this).attr("href").substring(1),window.history.pushState(null,null,location.pathname+"?"+$.param(queryParameters))});
|
||||
if($.urlParam('tab') != null){$('.nav.nav-tabs a[href="#' + $.urlParam('tab') + '"]').tab('show');}
|
||||
@if (count($errors) > 0)
|
||||
@foreach ($errors->all() as $error)
|
||||
<?php preg_match('/^The\s(.*?)\s/', $error, $matches) ?>
|
||||
@if (isset($matches[1]))
|
||||
$('[name="{{ $matches[1] }}"]').parent().parent().addClass('has-error');
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,205 +0,0 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
||||
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
||||
{{-- in the Software without restriction, including without limitation the rights --}}
|
||||
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
||||
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
||||
{{-- furnished to do so, subject to the following conditions: --}}
|
||||
|
||||
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
||||
{{-- copies or substantial portions of the Software. --}}
|
||||
|
||||
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
||||
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
||||
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
||||
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
||||
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
||||
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
||||
{{-- SOFTWARE. --}}
|
||||
@extends('layouts.master')
|
||||
|
||||
@section('title')
|
||||
Add File to: {{ $server->name }}
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
@parent
|
||||
<script src="{{ asset('js/binaryjs.js') }}"></script>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="nav nav-tabs" id="config_tabs">
|
||||
<li class="active"><a href="#create" data-toggle="tab">Create File</a></li>
|
||||
@can('upload-files', $server)<li><a href="#upload" data-toggle="tab">Upload Files</a></li>@endcan
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="create">
|
||||
<div id="write_status" style="display:none;width: 100%; margin: 10px 0 5px;"></div>
|
||||
<form method="post" id="new_file">
|
||||
<h4>/home/container/{{ $directory }} <input type="text" id="file_name" class="filename" value="newfile.txt" /></h4>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<textarea name="file_contents" id="fileContents" style="border: 1px solid #dddddd;" class="form-control console"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button class="btn btn-primary btn-sm" id="create_file">{{ trans('strings.save') }}</button>
|
||||
<button class="btn btn-default btn-sm" onclick="window.location='/server/{{ $server->uuidShort }}/files?dir=/{{ $directory }}';return false;">{{ trans('server.files.back') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@can('upload-files', $server)
|
||||
<div class="tab-pane" id="upload">
|
||||
<h4>/home/container/ <input type="text" id="u_file_name" value="{{ $directory }}" style='outline: none;width:450px;background: transparent;margin-left:-5px;padding:0;border: 0px;font-family: "Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight: 250;line-height: 1.1;color: inherit;font-size: 19px;'/></h4>
|
||||
<div class="alert alert-warning">Please edit the path location above <strong>before you upload files</strong>. They will automatically be placed in the directory you specify above. Simply click next to <code>/home/container/</code> and begin typing. You can change this each time you upload a new file without having to press anything else.</div>
|
||||
<div class="alert alert-danger" id="upload_error" style="display: none;"></div>
|
||||
<input type="file" id="fileinput" name="fileUpload[]" multiple="" style="display:none;"/>
|
||||
<div id="uploader_box" class="well well-sm" style="cursor:pointer;">
|
||||
<center><h2 style="margin-bottom: 25px;">Connecting...</h2></center>
|
||||
</div>
|
||||
<span id="file_progress"></span>
|
||||
</div>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(window).load(function () {
|
||||
|
||||
$('.server-files').addClass('active');
|
||||
|
||||
var newFilePath;
|
||||
var newFileContents;
|
||||
|
||||
@can('upload-files', $server)
|
||||
var client = new BinaryClient('{{ $node->scheme === 'https' ? 'wss' : 'ws' }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/upload/{{ $server->uuid }}', {
|
||||
chunkSize: 40960
|
||||
});
|
||||
// Wait for connection to BinaryJS server
|
||||
client.on('open', function() {
|
||||
|
||||
var box = $('#uploader_box');
|
||||
box.on('dragenter', doNothing);
|
||||
box.on('dragover', doNothing);
|
||||
box.html('<center><h2 style="margin-bottom:25px;">Drag or Click to Upload</h2></center>');
|
||||
box.on('click', function () {
|
||||
$('#fileinput').click();
|
||||
});
|
||||
box.on('drop', function (e, files) {
|
||||
|
||||
if (typeof files !== 'undefined') {
|
||||
e.originalEvent = {
|
||||
dataTransfer: {
|
||||
files: files.currentTarget.files
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
$.each(e.originalEvent.dataTransfer.files, function(index, value) {
|
||||
|
||||
var file = e.originalEvent.dataTransfer.files[index];
|
||||
var identifier = Math.random().toString(36).slice(2);
|
||||
|
||||
$('#file_progress').append('<div class="well well-sm" id="file-upload-' + identifier +'"> \
|
||||
<div class="row"> \
|
||||
<div class="col-md-12"> \
|
||||
<h6>Uploading ' + file.name + '</h6> \
|
||||
<span class="prog-bar-text-' + identifier +'" style="font-size: 10px;position: absolute;margin: 3px 0 0 15px;">Waiting...</span> \
|
||||
<div class="progress progress-striped active"> \
|
||||
<div class="progress-bar progress-bar-info prog-bar-' + identifier +'" style="width: 0%"></div> \
|
||||
</div> \
|
||||
</div> \
|
||||
</div> \
|
||||
</div>');
|
||||
|
||||
// Add to list of uploaded files
|
||||
var stream = client.send(file, {
|
||||
token: "{{ $server->daemonSecret }}",
|
||||
server: "{{ $server->uuid }}",
|
||||
path: $("#u_file_name").val(),
|
||||
name: file.name,
|
||||
size: file.size
|
||||
});
|
||||
|
||||
var tx = 0;
|
||||
stream.on('data', function(data) {
|
||||
if(data.error) {
|
||||
$("#upload_error").html(data.error).show();
|
||||
$("#file-upload-" + identifier).hide();
|
||||
} else {
|
||||
tx += data.rx;
|
||||
|
||||
if(tx >= 0.999) {
|
||||
$('.prog-bar-text-' + identifier).text('Upload Complete');
|
||||
$('.prog-bar-' + identifier).css('width', '100%').parent().removeClass('active').removeClass('progress-striped');
|
||||
} else {
|
||||
$('.prog-bar-text-' + identifier).text(Math.round(tx * 100) + '%');
|
||||
$('.prog-bar-' + identifier).css('width', tx * 100 + '%');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
stream.on('close', function(data) {
|
||||
$("#upload_error").html("The BinaryJS data stream was closed by the server. Please refresh the page and try again.").show();
|
||||
$("#file-upload-" + identifier).hide();
|
||||
});
|
||||
|
||||
stream.on('error', function(data) {
|
||||
console.error("An error was encountered with the BinaryJS upload stream.");
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// listen for a file being chosen
|
||||
$('#fileinput').change(function (event) {
|
||||
$('#uploader_box').trigger('drop', [event, event.currentTarget]);
|
||||
$('#fileinput').val('');
|
||||
});
|
||||
|
||||
// Deal with DOM quirks
|
||||
function doNothing (e){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
@endcan
|
||||
|
||||
$('textarea').keydown(function (e) {
|
||||
if (e.keyCode === 9) {
|
||||
var start = this.selectionStart;
|
||||
var end = this.selectionEnd;
|
||||
var value = $(this).val();
|
||||
$(this).val(value.substring(0, start) + '\t' + value.substring(end));
|
||||
this.selectionStart = this.selectionEnd = start + 1;
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
$("#create_file").click(function(e) {
|
||||
e.preventDefault();
|
||||
$("#create_file").append(' <i class="fa fa-spinner fa fa-spin"></i>').addClass("disabled");
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/server/{{ $server->uuidShort }}/ajax/files/save',
|
||||
headers: { 'X-CSRF-Token': '{{ csrf_token() }}' },
|
||||
data: {
|
||||
file: '{{ $directory }}' + $('#file_name').val(),
|
||||
contents: $('#fileContents').val()
|
||||
}
|
||||
}).done(function (data) {
|
||||
window.location.replace('/server/{{ $server->uuidShort }}/files/edit/{{ $directory }}' + $('#file_name').val());
|
||||
}).fail(function (jqXHR) {
|
||||
$('#write_status').html('<div class="alert alert-danger">' + jqXHR.responseText + '</div>').show();
|
||||
$('#create_file').html('{{ trans('strings.save') }}').removeClass('disabled');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,109 +0,0 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
||||
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
||||
{{-- in the Software without restriction, including without limitation the rights --}}
|
||||
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
||||
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
||||
{{-- furnished to do so, subject to the following conditions: --}}
|
||||
|
||||
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
||||
{{-- copies or substantial portions of the Software. --}}
|
||||
|
||||
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
||||
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
||||
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
||||
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
||||
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
||||
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
||||
{{-- SOFTWARE. --}}
|
||||
@extends('layouts.master')
|
||||
|
||||
@section('title')
|
||||
Managing Files for: {{ $server->name }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<h3 class="nopad"><small>Editing File: /home/container/{{ $file }}</small></h3>
|
||||
<form method="post" id="editing_file">
|
||||
<div class="form-group">
|
||||
<div>
|
||||
@if (in_array($extension, ['yaml', 'yml']))
|
||||
<div class="alert alert-info">
|
||||
{!! trans('server.files.yaml_notice', [
|
||||
'dropdown' => '<select id="space_yaml">
|
||||
<option value="2">2</option>
|
||||
<option value="4" selected="selected">4</option>
|
||||
<option value="8">8</option>
|
||||
</select>'
|
||||
]) !!}
|
||||
</div>
|
||||
@endif
|
||||
<textarea name="file_contents" id="fileContent" style="border: 1px solid #dddddd;height:500px;" class="form-control console">{{ $contents }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
@can('save-files', $server)
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<input type="hidden" name="file" value="{{ $file }}" />
|
||||
{!! csrf_field() !!}
|
||||
<button class="btn btn-primary btn-sm" id="save_file" type="submit">{{ trans('strings.save') }}</button>
|
||||
<a href="/server/{{ $server->uuidShort }}/files?dir={{ rawurlencode($directory) }}" class="text-muted pull-right"><small>{{ trans('server.files.back') }}</small></a>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('.server-files').addClass('active');
|
||||
$('textarea').keydown(function (e) {
|
||||
if (e.keyCode === 9) {
|
||||
|
||||
var start = this.selectionStart;
|
||||
var end = this.selectionEnd;
|
||||
var value = $(this).val();
|
||||
var joinYML = '\t';
|
||||
var yamlSpaces = 1;
|
||||
|
||||
@if (in_array($extension, ['yaml', 'yml']))
|
||||
yamlSpaces = parseInt($("#space_yaml").val());
|
||||
joinYML = Array(yamlSpaces + 1).join(" ");
|
||||
@endif
|
||||
|
||||
$(this).val(value.substring(0, start) + joinYML + value.substring(end));
|
||||
this.selectionStart = this.selectionEnd = start + yamlSpaces;
|
||||
e.preventDefault();
|
||||
|
||||
}
|
||||
});
|
||||
@can('save-files', $server)
|
||||
$('#save_file').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var fileName = $('input[name="file"]').val();
|
||||
var fileContents = $('#fileContent').val();
|
||||
|
||||
$('#save_file').append(' <i class="fa fa-spinner fa fa-spin"></i>').addClass('disabled');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '{{ route('server.files.save', $server->uuidShort) }}',
|
||||
headers: { 'X-CSRF-Token': '{{ csrf_token() }}' },
|
||||
data: {
|
||||
file: fileName,
|
||||
contents: fileContents
|
||||
}
|
||||
}).done(function (data) {
|
||||
$('#tpl_messages').html('<div class="alert alert-success">{{ trans('server.files.saved') }}</div>').show().delay(3000).slideUp();
|
||||
}).fail(function (jqXHR) {
|
||||
$('#tpl_messages').html('<div class="alert alert-danger">' + jqXHR.responseText + '</div>');
|
||||
}).always(function () {
|
||||
$('#save_file').html('{{ trans('strings.save') }}').removeClass('disabled');
|
||||
});
|
||||
|
||||
});
|
||||
@endcan
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,175 +0,0 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
||||
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
||||
{{-- in the Software without restriction, including without limitation the rights --}}
|
||||
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
||||
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
||||
{{-- furnished to do so, subject to the following conditions: --}}
|
||||
|
||||
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
||||
{{-- copies or substantial portions of the Software. --}}
|
||||
|
||||
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
||||
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
||||
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
||||
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
||||
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
||||
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
||||
{{-- SOFTWARE. --}}
|
||||
@extends('layouts.master')
|
||||
|
||||
@section('title')
|
||||
Managing Files for: {{ $server->name }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="internal_alert">
|
||||
<div class="alert alert-info">
|
||||
<i class="fa fa-spinner fa-spin"></i> {{ trans('server.files.loading') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="ajax_loading_box"><i class="fa fa-refresh fa-spin" id="position_me"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="load_files"></div>
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">File Path Information</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
When configuring any file paths in your server plugins or settings you should use <code>/home/container</code> as your base path. While your SFTP client sees the files as <code>/public</code> this is not true for the server process.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('.server-files').addClass('active');
|
||||
});
|
||||
$(window).load(function(){
|
||||
var doneLoad = false;
|
||||
|
||||
// Show Loading Animation
|
||||
function handleLoader (show) {
|
||||
|
||||
// Hide animation if no files displayed.
|
||||
if ($('#load_files').height() < 5) { return; }
|
||||
|
||||
// Show Animation
|
||||
if (show === true){
|
||||
var height = $('#load_files').height();
|
||||
var width = $('.ajax_loading_box').width();
|
||||
var center_height = (height / 2) - 30;
|
||||
var center_width = (width / 2) - 30;
|
||||
$('#position_me').css({
|
||||
'top': center_height,
|
||||
'left': center_width,
|
||||
'font-size': '60px'
|
||||
});
|
||||
$(".ajax_loading_box").css('height', (height + 5)).fadeIn();
|
||||
} else {
|
||||
$('.ajax_loading_box').fadeOut(100);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function reloadActions () {
|
||||
reloadActionClick();
|
||||
reloadActionDelete();
|
||||
}
|
||||
|
||||
// Handle folder clicking to load new contents
|
||||
function reloadActionClick () {
|
||||
$('a.load_new').click(function (e) {
|
||||
e.preventDefault();
|
||||
window.history.pushState(null, null, $(this).attr('href'));
|
||||
loadDirectoryContents($.urlParam('dir', $(this).attr('href')));
|
||||
});
|
||||
}
|
||||
|
||||
// Handle Deleting Files
|
||||
function reloadActionDelete () {
|
||||
$('a.delete_file').click(function (e) {
|
||||
e.preventDefault();
|
||||
var clicked = $(this);
|
||||
var deleteItemPath = $(this).attr('href');
|
||||
|
||||
swal({
|
||||
type: 'warning',
|
||||
title: 'Really Delete this File?',
|
||||
showCancelButton: true,
|
||||
showConfirmButton: true,
|
||||
closeOnConfirm: false,
|
||||
showLoaderOnConfirm: true
|
||||
}, function () {
|
||||
$.ajax({
|
||||
type: 'DELETE',
|
||||
url: '{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/server/file/' + deleteItemPath,
|
||||
headers: {
|
||||
'X-Access-Token': '{{ $server->daemonSecret }}',
|
||||
'X-Access-Server': '{{ $server->uuid }}'
|
||||
}
|
||||
}).done(function (data) {
|
||||
clicked.parent().parent().parent().parent().fadeOut();
|
||||
swal({
|
||||
type: 'success',
|
||||
title: 'File Deleted'
|
||||
});
|
||||
}).fail(function (jqXHR) {
|
||||
console.error(jqXHR);
|
||||
swal({
|
||||
type: 'error',
|
||||
title: 'Whoops!',
|
||||
html: true,
|
||||
text: 'An error occured while attempting to delete this file. Please try again.',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// Handle Loading Contents
|
||||
function loadDirectoryContents (dir) {
|
||||
|
||||
handleLoader(true);
|
||||
var outputContent;
|
||||
var urlDirectory = (dir === null) ? '/' : dir;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '{{ route('server.files.directory-list', $server->uuidShort) }}',
|
||||
headers: { 'X-CSRF-Token': '{{ csrf_token() }}' },
|
||||
data: { directory: urlDirectory }
|
||||
}).done(function (data) {
|
||||
handleLoader(false);
|
||||
$("#load_files").slideUp(function () {
|
||||
$("#load_files").html(data).slideDown();
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$('#internal_alert').slideUp();
|
||||
|
||||
// Run Actions Again
|
||||
reloadActions();
|
||||
});
|
||||
}).fail(function (jqXHR) {
|
||||
$("#internal_alert").html('<div class="alert alert-danger">An error occured while attempting to process this request. Please try again.</div>').show();
|
||||
console.log(jqXHR);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Load on Initial Page Load
|
||||
loadDirectoryContents($.urlParam('dir'));
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,105 +0,0 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
||||
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
||||
{{-- in the Software without restriction, including without limitation the rights --}}
|
||||
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
||||
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
||||
{{-- furnished to do so, subject to the following conditions: --}}
|
||||
|
||||
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
||||
{{-- copies or substantial portions of the Software. --}}
|
||||
|
||||
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
||||
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
||||
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
||||
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
||||
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
||||
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
||||
{{-- SOFTWARE. --}}
|
||||
<h4 class="nopad">/home/container{{ $directory['header'] }} <small><a href="/server/{{ $server->uuidShort }}/files/add/@if($directory['header'] !== '')?dir={{ $directory['header'] }}@endif" class="text-muted"><i class="fa fa-plus" data-toggle="tooltip" data-placement="top" title="Add New File(s)"></i></a></small></h4>
|
||||
<table class="table table-striped table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:2%;text-align:center;"></th>
|
||||
<th style="width:45%">File Name</th>
|
||||
<th style="width:15%">Size</th>
|
||||
<th style="width:20%">Last Modified</th>
|
||||
<th style="width:20%;text-align:center;">Options</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (isset($directory['first']) && $directory['first'] === true)
|
||||
<tr>
|
||||
<td><i class="fa fa-folder-open" style="margin-left: 0.859px;"></i></td>
|
||||
<td><a href="/server/{{ $server->uuidShort }}/files" class="load_new">←</a></a></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@endif
|
||||
@if (isset($directory['show']) && $directory['show'] === true)
|
||||
<tr>
|
||||
<td><i class="fa fa-folder-open" style="margin-left: 0.859px;"></i></td>
|
||||
<td><a href="/server/{{ $server->uuidShort }}/files?dir={{ rawurlencode($directory['link']) }}" class="load_new">← {{ $directory['link_show'] }}</a></a></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@endif
|
||||
@foreach ($folders as $folder)
|
||||
<tr>
|
||||
<td><i class="fa fa-folder-open" style="margin-left: 0.859px;"></i></td>
|
||||
<td><a href="/server/{{ $server->uuidShort }}/files?dir=/@if($folder['directory'] !== ''){{ rawurlencode($folder['directory']) }}/@endif{{ rawurlencode($folder['entry']) }}" class="load_new">{{ $folder['entry'] }}</a></td>
|
||||
<td>{{ $folder['size'] }}</td>
|
||||
<td>{{ date('m/d/y H:i:s', $folder['date']) }}</td>
|
||||
<td style="text-align:center;">
|
||||
<div class="row" style="text-align:center;">
|
||||
<div class="col-md-3 hidden-xs hidden-sm"></div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
@can('delete-files', $server)
|
||||
<a href="@if($folder['directory'] !== ''){{ rawurlencode($folder['directory']) }}/@endif{{ rawurlencode($folder['entry']) }}" class="delete_file"><span class="badge label-danger"><i class="fa fa-trash-o"></i></span></a>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@foreach ($files as $file)
|
||||
<tr>
|
||||
<td><i class="fa fa-file-text" style="margin-left: 2px;"></i></td>
|
||||
<td>
|
||||
@if(in_array($file['extension'], $extensions))
|
||||
@can('edit-files', $server)
|
||||
<a href="/server/{{ $server->uuidShort }}/files/edit/@if($file['directory'] !== ''){{ rawurlencode($file['directory']) }}/@endif{{ rawurlencode($file['entry']) }}" class="edit_file">{{ $file['entry'] }}</a>
|
||||
@else
|
||||
{{ $file['entry'] }}
|
||||
@endcan
|
||||
@else
|
||||
{{ $file['entry'] }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $file['size'] }}</td>
|
||||
<td>{{ date('m/d/y H:i:s', $file['date']) }}</td>
|
||||
<td style="text-align:center;">
|
||||
<div class="row" style="text-align:center;">
|
||||
<div class="col-md-3 hidden-xs hidden-sm">
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm">
|
||||
@can('download-files', $server)
|
||||
<a href="/server/{{ $server->uuidShort }}/files/download/@if($file['directory'] !== ''){{ rawurlencode($file['directory']) }}/@endif{{ rawurlencode($file['entry']) }}"><span class="badge"><i class="fa fa-download"></i></span></a>
|
||||
@endcan
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
@can('delete-files', $server)
|
||||
<a href="@if($file['directory'] !== ''){{ rawurlencode($file['directory']) }}/@endif{{ rawurlencode($file['entry']) }}" class="delete_file"><span class="badge label-danger"><i class="fa fa-trash-o"></i></span>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
|
@ -1,589 +0,0 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
||||
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
||||
{{-- in the Software without restriction, including without limitation the rights --}}
|
||||
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
||||
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
||||
{{-- furnished to do so, subject to the following conditions: --}}
|
||||
|
||||
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
||||
{{-- copies or substantial portions of the Software. --}}
|
||||
|
||||
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
||||
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
||||
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
||||
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
||||
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
||||
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
||||
{{-- SOFTWARE. --}}
|
||||
@extends('layouts.master')
|
||||
|
||||
@section('title')
|
||||
Viewing Server: {{ $server->name }}
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
@parent
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highcharts/4.2.1/highcharts.js"></script>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<ul class="nav nav-tabs tabs_with_panel" id="config_tabs">
|
||||
<li id="triggerConsoleView" class="active"><a href="#console" data-toggle="tab">{{ trans('server.index.control') }}</a></li>
|
||||
<li><a href="#stats" data-toggle="tab">{{ trans('server.index.usage') }}</a></li>
|
||||
@can('view-allocation', $server)<li><a href="#allocation" data-toggle="tab">{{ trans('server.index.allocation') }}</a></li>@endcan
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="console">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<textarea id="live_console" class="form-control console" readonly="readonly">Loading Previous Content...</textarea>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<hr />
|
||||
@can('command', $server)
|
||||
<form action="#" method="post" id="console_command" style="display:none;">
|
||||
<fieldset>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="command" id="ccmd" placeholder="{{ trans('server.index.command') }}" />
|
||||
<span class="input-group-btn">
|
||||
<button id="sending_command" class="btn btn-primary btn-sm">→</button>
|
||||
</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
<div class="alert alert-danger" id="sc_resp" style="display:none;margin-top: 15px;"></div>
|
||||
@endcan
|
||||
</div>
|
||||
<div class="col-md-6" style="text-align:center;">
|
||||
<hr />
|
||||
@can('power-start', $server)<button class="btn btn-success btn-sm disabled" data-attr="power" data-action="start">Start</button>@endcan
|
||||
@can('power-restart', $server)<button class="btn btn-primary btn-sm disabled" data-attr="power" data-action="restart">Restart</button>@endcan
|
||||
@can('power-stop', $server)<button class="btn btn-danger btn-sm disabled" data-attr="power" data-action="stop">Stop</button>@endcan
|
||||
@can('power-kill', $server)<button class="btn btn-danger btn-sm disabled" data-attr="power" data-action="kill"><i class="fa fa-ban" data-toggle="tooltip" data-placement="top" title="Kill Running Process"></i></button>@endcan
|
||||
<button class="btn btn-primary btn-sm" data-toggle="modal" data-target="#pauseConsole" id="pause_console"><small><i class="fa fa-pause fa-fw"></i></small></button>
|
||||
<div id="pw_resp" style="display:none;margin-top: 15px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="stats_players">
|
||||
<h3>Active Players</h3><hr />
|
||||
<div id="players_notice" class="alert alert-info">
|
||||
<i class="fa fa-spinner fa-spin"></i> Waiting for response from server...
|
||||
</div>
|
||||
<span id="toggle_players" style="display:none;">
|
||||
<p class="text-muted">No players are online.</p>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="stats">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-11 text-center" id="chart_memory" style="height:250px;"></div>
|
||||
<div class="col-xs-11 text-center" id="chart_cpu" style="height:250px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@can('view-allocation', $server)
|
||||
<div class="tab-pane" id="allocation">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-info">Below is a listing of all avaliable IPs and Ports for your service. To change the default connection address for your server, simply click on the one you would like to make default below.</div>
|
||||
<ul class="nav nav-pills nav-stacked" id="conn_options">
|
||||
@foreach ($allocations as $allocation)
|
||||
<li role="presentation" @if($allocation->ip === $server->ip && $allocation->port === $server->port) class="active" @endif><a href="#/set-connnection/{{ $allocation->ip }}:{{ $allocation->port }}" data-action="set-connection" data-connection="{{ $allocation->ip }}:{{ $allocation->port }}">{{ $allocation->ip }} <span class="badge">{{ $allocation->port }}</span></a></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-11" id="col11_setter"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="pauseConsole" tabindex="-1" role="dialog" aria-labelledby="PauseConsole" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="PauseConsole">{{ trans('server.index.scrollstop') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<textarea id="paused_console" class="form-control console" readonly="readonly"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('strings.close') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if($server->a_serviceFile === 'minecraft')
|
||||
<script src="{{ route('server.js', [$server->uuidShort, 'minecraft/eula.js']) }}"></script>
|
||||
@endif
|
||||
<script>
|
||||
$(window).load(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
|
||||
// -----------------+
|
||||
// Charting Methods |
|
||||
// -----------------+
|
||||
$(window).resize(function() {
|
||||
$('#chart_memory').highcharts().setSize($('#col11_setter').width(), 250);
|
||||
$('#chart_cpu').highcharts().setSize($('#col11_setter').width(), 250);
|
||||
});
|
||||
$('#chart_memory').highcharts({
|
||||
chart: {
|
||||
type: 'area',
|
||||
animation: Highcharts.svg,
|
||||
marginRight: 10,
|
||||
renderTo: 'container',
|
||||
width: $('#col11_setter').width()
|
||||
},
|
||||
colors: [
|
||||
'#113F8C',
|
||||
'#00A1CB',
|
||||
'#01A4A4',
|
||||
'#61AE24',
|
||||
'#D0D102',
|
||||
'#D70060',
|
||||
'#E54028',
|
||||
'#F18D05',
|
||||
'#616161',
|
||||
'#32742C',
|
||||
],
|
||||
credits: {
|
||||
enabled: false,
|
||||
},
|
||||
title: {
|
||||
text: 'Live Memory Usage',
|
||||
},
|
||||
tooltip: {
|
||||
shared: true,
|
||||
crosshairs: true,
|
||||
formatter: function () {
|
||||
var s = '<b>Memory Usage</b>';
|
||||
|
||||
$.each(this.points, function () {
|
||||
s += '<br/>' + this.series.name + ': ' +
|
||||
this.y + 'MB';
|
||||
});
|
||||
|
||||
return s;
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
visible: false,
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
text: 'Memory Usage (MB)',
|
||||
},
|
||||
plotLines: [{
|
||||
value: 0,
|
||||
width: 1,
|
||||
}],
|
||||
},
|
||||
plotOptions: {
|
||||
area: {
|
||||
fillOpacity: 0.10,
|
||||
marker: {
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
enabled: false
|
||||
},
|
||||
series: [{
|
||||
name: 'Total Memory',
|
||||
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
}]
|
||||
});
|
||||
|
||||
$('#chart_cpu').highcharts({
|
||||
chart: {
|
||||
type: 'area',
|
||||
animation: Highcharts.svg,
|
||||
marginRight: 10,
|
||||
renderTo: 'container',
|
||||
width: $('#col11_setter').width()
|
||||
},
|
||||
colors: [
|
||||
'#00A1CB',
|
||||
'#01A4A4',
|
||||
'#61AE24',
|
||||
'#D0D102',
|
||||
'#D70060',
|
||||
'#E54028',
|
||||
'#F18D05',
|
||||
'#616161',
|
||||
'#32742C',
|
||||
],
|
||||
credits: {
|
||||
enabled: false,
|
||||
},
|
||||
title: {
|
||||
text: 'Live CPU Usage',
|
||||
},
|
||||
tooltip: {
|
||||
shared: true,
|
||||
crosshairs: true,
|
||||
formatter: function () {
|
||||
var s = '<b>CPU Usage</b>';
|
||||
var i = 0;
|
||||
var t = 0;
|
||||
$.each(this.points, function () {
|
||||
t = t + this.y;
|
||||
i++;
|
||||
s += '<br/>' + this.series.name + ': ' +
|
||||
this.y + '%';
|
||||
});
|
||||
|
||||
t = parseFloat(t).toFixed(3).toString();
|
||||
|
||||
if (i > 1) {
|
||||
return s + '<br />Combined: ' + t;
|
||||
} else {
|
||||
return s;
|
||||
}
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
visible: false,
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
text: 'CPU Usage (%)',
|
||||
},
|
||||
plotLines: [{
|
||||
value: 0,
|
||||
width: 1,
|
||||
}],
|
||||
},
|
||||
plotOptions: {
|
||||
area: {
|
||||
fillOpacity: 0.10,
|
||||
stacking: 'normal',
|
||||
lineWidth: 1,
|
||||
marker: {
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
enabled: true
|
||||
},
|
||||
series: [{
|
||||
name: 'Core 0',
|
||||
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
}]
|
||||
});
|
||||
|
||||
// Socket Recieves New Server Stats
|
||||
var activeChartArrays = [];
|
||||
socket.on('proc', function (proc) {
|
||||
var MemoryChart = $('#chart_memory').highcharts();
|
||||
MemoryChart.series[0].addPoint(parseInt(proc.data.memory.total / (1024 * 1024)), true, true);
|
||||
|
||||
var CPUChart = $('#chart_cpu').highcharts();
|
||||
|
||||
// Remove blank values from listing
|
||||
var activeCores = [];
|
||||
for (i = 0, length = proc.data.cpu.cores.length; i < length; i++) {
|
||||
if (proc.data.cpu.cores[i] > 0) {
|
||||
activeCores.push(proc.data.cpu.cores[i]);
|
||||
}
|
||||
}
|
||||
|
||||
var modifedActiveCores = { '0': 0 };
|
||||
for (i = 0, length = activeCores.length; i < length; i++) {
|
||||
if (i > 7) {
|
||||
modifedActiveCores['0'] = modifedActiveCores['0'] + activeCores[i];
|
||||
} else {
|
||||
if (activeChartArrays.indexOf(i) < 0) {
|
||||
activeChartArrays.push(i);
|
||||
}
|
||||
modifedActiveCores[i] = activeCores[i];
|
||||
}
|
||||
}
|
||||
|
||||
console.log(activeChartArrays);
|
||||
console.log(modifedActiveCores);
|
||||
|
||||
for (i = 0, length = activeChartArrays.length; i < length; i++) {
|
||||
if (typeof CPUChart.series[i] === 'undefined') {
|
||||
CPUChart.addSeries({
|
||||
name: 'Core ' + i,
|
||||
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
});
|
||||
}
|
||||
if({{ $server->cpu }} > 0) {
|
||||
CPUChart.series[i].addPoint(parseFloat((((modifedActiveCores[i] || 0)/ {{ $server->cpu }}) * 100).toFixed(3).toString()), true, true);
|
||||
} else {
|
||||
CPUChart.series[i].addPoint(modifedActiveCores[i] || 0, true, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Socket Recieves New Query
|
||||
socket.on('query', function (data){
|
||||
if($('#players_notice').is(':visible')){
|
||||
$('#players_notice').hide();
|
||||
$('#toggle_players').show();
|
||||
}
|
||||
if(data['data'].players != undefined && data['data'].players.length !== 0){
|
||||
$('#toggle_players').html('');
|
||||
$.each(data['data'].players, function(id, d) {
|
||||
$('#toggle_players').append('<code>' + d.name + '</code>,');
|
||||
});
|
||||
}else{
|
||||
$('#toggle_players').html('<p class=\'text-muted\'>No players are currently online.</p>');
|
||||
}
|
||||
});
|
||||
|
||||
// New Console Data Recieved
|
||||
socket.on('console', function (data) {
|
||||
$('#live_console').val($('#live_console').val() + data.line);
|
||||
$('#live_console').scrollTop($('#live_console')[0].scrollHeight);
|
||||
});
|
||||
|
||||
// Update Listings on Initial Status
|
||||
socket.on('initial_status', function (data) {
|
||||
if (data.status !== 0) {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-Access-Token': '{{ $server->daemonSecret }}',
|
||||
'X-Access-Server': '{{ $server->uuid }}'
|
||||
},
|
||||
url: '{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/server/log',
|
||||
timeout: 10000
|
||||
}).done(function(data) {
|
||||
$('#live_console').val(data);
|
||||
$('#live_console').scrollTop($('#live_console')[0].scrollHeight);
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to load initial server log, try reloading the page.');
|
||||
});
|
||||
} else {
|
||||
$('#live_console').val('Server is currently off.');
|
||||
}
|
||||
updateServerPowerControls(data.status);
|
||||
updatePlayerListVisibility(data.status);
|
||||
});
|
||||
|
||||
// Update Listings on Status
|
||||
socket.on('status', function (data) {
|
||||
updateServerPowerControls(data.status);
|
||||
updatePlayerListVisibility(data.status);
|
||||
});
|
||||
|
||||
// Scroll to the top of the Console when switching to that tab.
|
||||
$('#triggerConsoleView').click(function () {
|
||||
$('#live_console').scrollTop($('#live_console')[0].scrollHeight);
|
||||
});
|
||||
if($('triggerConsoleView').is(':visible')) {
|
||||
$('#live_console').scrollTop($('#live_console')[0].scrollHeight);
|
||||
}
|
||||
$('a[data-toggle=\'tab\']').on('shown.bs.tab', function (e) {
|
||||
$('#live_console').scrollTop($('#live_console')[0].scrollHeight);
|
||||
});
|
||||
|
||||
// Load Paused Console with Live Console Data
|
||||
$('#pause_console').click(function(){
|
||||
$('#paused_console').val($('#live_console').val());
|
||||
});
|
||||
|
||||
function updatePlayerListVisibility(data) {
|
||||
// Server is On or Starting
|
||||
if(data !== 0) {
|
||||
$('#stats_players').show();
|
||||
} else {
|
||||
$('#stats_players').hide();
|
||||
}
|
||||
}
|
||||
|
||||
@can('set-allocation', $server)
|
||||
// Send Request
|
||||
$('[data-action="set-connection"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
var element = $(this);
|
||||
if (element.hasClass('active')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/server/{{ $server->uuidShort }}/ajax/set-connection',
|
||||
data: {
|
||||
connection: element.data('connection')
|
||||
},
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
}).done(function (data) {
|
||||
swal({
|
||||
type: 'success',
|
||||
title: '',
|
||||
text: data
|
||||
});
|
||||
$('#conn_options').find('li.active').removeClass('active');
|
||||
element.parent().addClass('active');
|
||||
}).fail(function (jqXHR) {
|
||||
console.error(jqXHR);
|
||||
var respError;
|
||||
if (typeof jqXHR.responseJSON.error === 'undefined' || jqXHR.responseJSON.error === '') {
|
||||
respError = 'An error occured while attempting to perform this action.';
|
||||
} else {
|
||||
respError = jqXHR.responseJSON.error;
|
||||
}
|
||||
swal({
|
||||
type: 'error',
|
||||
title: 'Whoops!',
|
||||
text: respError
|
||||
});
|
||||
});
|
||||
});
|
||||
@endcan
|
||||
|
||||
@can('command', $server)
|
||||
// Send Command to Server
|
||||
$('#console_command').submit(function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
var ccmd = $('#ccmd').val();
|
||||
if (ccmd == '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$('#sending_command').html('<i class=\'fa fa-refresh fa-spin\'></i>').addClass('disabled');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-Access-Token': '{{ $server->daemonSecret }}',
|
||||
'X-Access-Server': '{{ $server->uuid }}'
|
||||
},
|
||||
contentType: 'application/json; charset=utf-8',
|
||||
url: '{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/server/command',
|
||||
timeout: 10000,
|
||||
data: JSON.stringify({ command: ccmd })
|
||||
}).fail(function (jqXHR) {
|
||||
console.error(jqXHR);
|
||||
var error = 'An error occured while trying to process this request.';
|
||||
if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {
|
||||
error = jqXHR.responseJSON.error;
|
||||
}
|
||||
swal({
|
||||
type: 'error',
|
||||
title: 'Whoops!',
|
||||
text: error
|
||||
});
|
||||
}).done(function () {
|
||||
$('#ccmd').val('');
|
||||
}).always(function () {
|
||||
$('#sending_command').html('→').removeClass('disabled');
|
||||
});
|
||||
});
|
||||
@endcan
|
||||
var can_run = true;
|
||||
function updateServerPowerControls (data) {
|
||||
|
||||
// Reset Console Data
|
||||
if (data === 2) {
|
||||
$('#live_console').val($('#live_console').val() + '\n --+ Server Detected as Booting + --\n');
|
||||
$('#live_console').scrollTop($('#live_console')[0].scrollHeight);
|
||||
}
|
||||
|
||||
// Server is On or Starting
|
||||
if(data == 1 || data == 2) {
|
||||
$("#console_command").slideDown();
|
||||
$('[data-attr="power"][data-action="start"]').addClass('disabled');
|
||||
$('[data-attr="power"][data-action="stop"], [data-attr="power"][data-action="restart"]').removeClass('disabled');
|
||||
} else {
|
||||
$("#console_command").slideUp();
|
||||
$('[data-attr="power"][data-action="start"]').removeClass('disabled');
|
||||
$('[data-attr="power"][data-action="stop"], [data-attr="power"][data-action="restart"]').addClass('disabled');
|
||||
}
|
||||
|
||||
if(data !== 0) {
|
||||
$('[data-attr="power"][data-action="kill"]').removeClass('disabled');
|
||||
} else {
|
||||
$('[data-attr="power"][data-action="kill"]').addClass('disabled');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$('[data-attr="power"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
var action = $(this).data('action');
|
||||
var killConfirm = false;
|
||||
if (action === 'kill') {
|
||||
swal({
|
||||
type: 'warning',
|
||||
title: '',
|
||||
text: 'This operation will not save your server data gracefully. You should only use this if your server is failing to respond to normal stop commands.',
|
||||
showCancelButton: true,
|
||||
allowOutsideClick: true,
|
||||
closeOnConfirm: true,
|
||||
confirmButtonText: 'Kill Server',
|
||||
confirmButtonColor: '#d9534f'
|
||||
}, function () {
|
||||
setTimeout(function() {
|
||||
powerToggleServer('kill');
|
||||
}, 100);
|
||||
});
|
||||
} else {
|
||||
powerToggleServer(action);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function powerToggleServer(action) {
|
||||
$.ajax({
|
||||
type: 'PUT',
|
||||
headers: {
|
||||
'X-Access-Token': '{{ $server->daemonSecret }}',
|
||||
'X-Access-Server': '{{ $server->uuid }}'
|
||||
},
|
||||
contentType: 'application/json; charset=utf-8',
|
||||
data: JSON.stringify({
|
||||
action: action
|
||||
}),
|
||||
url: '{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/server/power',
|
||||
timeout: 10000
|
||||
}).fail(function(jqXHR) {
|
||||
var error = 'An error occured while trying to process this request.';
|
||||
if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {
|
||||
error = jqXHR.responseJSON.error;
|
||||
}
|
||||
swal({
|
||||
type: 'error',
|
||||
title: 'Whoops!',
|
||||
text: error
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
$('.server-index').addClass('active');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,61 +0,0 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
||||
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
||||
{{-- in the Software without restriction, including without limitation the rights --}}
|
||||
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
||||
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
||||
{{-- furnished to do so, subject to the following conditions: --}}
|
||||
|
||||
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
||||
{{-- copies or substantial portions of the Software. --}}
|
||||
|
||||
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
||||
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
||||
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
||||
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
||||
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
||||
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
||||
{{-- SOFTWARE. --}}
|
||||
$(window).load(function () {
|
||||
socket.on('console', function (data) {
|
||||
if (data.line.indexOf('You need to agree to the EULA in order to run the server') > -1) {
|
||||
swal({
|
||||
title: 'EULA Acceptance',
|
||||
text: 'By pressing \'I Accept\' below you are indicating your agreement to the <a href="https://account.mojang.com/documents/minecraft_eula" target="_blank">Mojang EULA</a>.',
|
||||
type: 'info',
|
||||
html: true,
|
||||
showCancelButton: true,
|
||||
showConfirmButton: true,
|
||||
cancelButtonText: 'I do not Accept',
|
||||
confirmButtonText: 'I Accept',
|
||||
closeOnConfirm: false,
|
||||
showLoaderOnConfirm: true
|
||||
}, function () {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '{{ route('server.files.save', $server->uuidShort) }}',
|
||||
headers: { 'X-CSRF-Token': '{{ csrf_token() }}' },
|
||||
data: {
|
||||
file: 'eula.txt',
|
||||
contents: 'eula=true'
|
||||
}
|
||||
}).done(function (data) {
|
||||
$('[data-attr="power"][data-action="start"]').trigger('click');
|
||||
swal({
|
||||
type: 'success',
|
||||
title: '',
|
||||
text: 'The EULA for this server has been accepted, restarting server now.',
|
||||
});
|
||||
}).fail(function (jqXHR) {
|
||||
console.error(jqXHR);
|
||||
swal({
|
||||
title: 'Whoops!',
|
||||
text: 'An error occured while attempting to set the EULA as accepted: ' . jqXHR.responseJSON.error,
|
||||
type: 'error'
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
|
@ -1,150 +0,0 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
||||
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
||||
{{-- in the Software without restriction, including without limitation the rights --}}
|
||||
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
||||
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
||||
{{-- furnished to do so, subject to the following conditions: --}}
|
||||
|
||||
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
||||
{{-- copies or substantial portions of the Software. --}}
|
||||
|
||||
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
||||
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
||||
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
||||
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
||||
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
||||
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
||||
{{-- SOFTWARE. --}}
|
||||
@extends('layouts.master')
|
||||
|
||||
@section('title')
|
||||
Server Settings
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<h3 class="nopad">Server Settings</h3><hr />
|
||||
<ul class="nav nav-tabs tabs_with_panel" id="config_tabs">
|
||||
@can('view-sftp', $server)<li class="active"><a href="#tab_sftp" data-toggle="tab">SFTP Settings</a></li>@endcan
|
||||
@can('view-startup', $server)<li><a href="#tab_startup" data-toggle="tab">Startup Configuration</a></li>@endcan
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
@can('view-sftp', $server)
|
||||
<div class="tab-pane active" id="tab_sftp">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label class="control-label">SFTP Connection Address:</label>
|
||||
<div>
|
||||
<input type="text" readonly="readonly" class="form-control" value="{{ $node->fqdn }}:{{ $node->daemonSFTP }}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label class="control-label">SFTP Username:</label>
|
||||
<div>
|
||||
<input type="text" readonly="readonly" class="form-control" value="{{ $server->username }}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@can('reset-sftp', $server)
|
||||
<form action="{{ route('server.settings.sftp', $server->uuidShort) }}" method="POST">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label class="control-label">New SFTP Password:</label>
|
||||
<div>
|
||||
<input type="password" name="sftp_pass" class="form-control" />
|
||||
<p class="text-muted"><small>Passwords must meet the following requirements: at least one uppercase character, one lowercase character, one digit, and be at least 8 characters in length. <a href="#" data-action="generate-password">Click here</a> to generate one to use.</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label class="control-label"> </label>
|
||||
<div>
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-sm btn-primary" value="Update Password" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
@can('view-startup', $server)
|
||||
<div class="tab-pane" id="tab_startup">
|
||||
<form action="{{ route('server.settings.startup', $server->uuidShort) }}" method="POST">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<label class="control-label">Startup Command:</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{{ $service->executable }}</span>
|
||||
<input type="text" class="form-control" readonly="readonly" value="{{ $processedStartup }}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@can('edit-startup', $server)
|
||||
<div class="panel-heading" style="border-top: 1px solid #ddd;"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
@foreach($variables as $item)
|
||||
<div class="form-group col-md-6">
|
||||
<label class="control-label">
|
||||
@if($item->required === 1)<span class="label label-primary">Required</span> @endif
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
<div>
|
||||
<input type="text"
|
||||
@if($item->user_editable === 1)
|
||||
name="{{ $item->env_variable }}"
|
||||
@else
|
||||
readonly="readonly"
|
||||
@endif
|
||||
class="form-control" value="{{ old($item->env_variable, $item->a_serverValue) }}" data-action="matchRegex" data-regex="{{ $item->regex }}" />
|
||||
</div>
|
||||
<p class="text-muted"><small>{{ $item->description }}<br />Regex: <code>{{ $item->regex }}</code><br />Access as: <code>{{{{$item->env_variable}}}}</code></small></p>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-heading" style="border-top: 1px solid #ddd;"></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-primary btn-sm" value="Update Startup Arguments" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('.server-settings').addClass('active');
|
||||
$('[data-action="matchRegex"]').keyup(function (event) {
|
||||
if (!$(this).data('regex')) return;
|
||||
var input = $(this).val();
|
||||
console.log(escapeRegExp($(this).data('regex')));
|
||||
var regex = new RegExp(escapeRegExp($(this).data('regex')));
|
||||
console.log(regex);
|
||||
if (!regex.test(input)) {
|
||||
$(this).parent().parent().removeClass('has-success').addClass('has-error');
|
||||
} else {
|
||||
$(this).parent().parent().removeClass('has-error').addClass('has-success');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,109 +0,0 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
||||
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
||||
{{-- in the Software without restriction, including without limitation the rights --}}
|
||||
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
||||
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
||||
{{-- furnished to do so, subject to the following conditions: --}}
|
||||
|
||||
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
||||
{{-- copies or substantial portions of the Software. --}}
|
||||
|
||||
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
||||
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
||||
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
||||
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
||||
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
||||
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
||||
{{-- SOFTWARE. --}}
|
||||
@extends('layouts.master')
|
||||
|
||||
@section('title')
|
||||
Viewing Subusers
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<h3 class="nopad">Manage Sub-Users</h3><hr />
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Email</th>
|
||||
<th>Created</th>
|
||||
<th>Modified</th>
|
||||
@can('view-subuser', $server)<th></th>@endcan
|
||||
@can('delete-subuser', $server)<th></th>@endcan
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($subusers as $user)
|
||||
<tr>
|
||||
<td><code>{{ $user->a_userEmail }}</code></td>
|
||||
<td>{{ $user->created_at }}</td>
|
||||
<td>{{ $user->updated_at }}</td>
|
||||
@can('view-subuser', $server)
|
||||
<td class="text-center"><a href="{{ route('server.subusers.view', ['server' => $server->uuidShort, 'id' => md5($user->id)]) }}" class="text-success"><i class="fa fa-wrench"></i></a></td>
|
||||
@endcan
|
||||
@can('delete-subuser', $server)
|
||||
<td class="text-center"><a href="#/delete/{{ md5($user->id) }}" data-action="delete" data-id="{{ md5($user->id) }}" class="text-danger"><i class="fa fa-trash-o"></i></a></td>
|
||||
@endcan
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@can('create-subuser', $server)
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<a href="{{ route('server.subusers.new', $server->uuidShort) }}"><button class="btn btn-sm btn-success">Add New Subuser</button></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('.server-users').addClass('active');
|
||||
$('[data-action="delete"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
var self = $(this);
|
||||
swal({
|
||||
type: 'warning',
|
||||
title: 'Delete Subuser',
|
||||
text: 'This will immediately remove this user from this server and revoke all permissions.',
|
||||
showCancelButton: true,
|
||||
showConfirmButton: true,
|
||||
closeOnConfirm: false,
|
||||
showLoaderOnConfirm: true
|
||||
}, function () {
|
||||
$.ajax({
|
||||
method: 'DELETE',
|
||||
url: '{{ route('server.subusers', $server->uuidShort) }}/delete/' + self.data('id'),
|
||||
headers: {
|
||||
'X-CSRF-Token': '{{ csrf_token() }}'
|
||||
}
|
||||
}).done(function () {
|
||||
self.parent().parent().slideUp();
|
||||
swal({
|
||||
type: 'success',
|
||||
title: '',
|
||||
text: 'Subuser was successfully deleted.'
|
||||
});
|
||||
}).fail(function (jqXHR) {
|
||||
console.error(jqXHR);
|
||||
var error = 'An error occured while trying to process this request.';
|
||||
if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {
|
||||
error = jqXHR.responseJSON.error;
|
||||
}
|
||||
swal({
|
||||
type: 'error',
|
||||
title: 'Whoops!',
|
||||
text: error
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,207 +0,0 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
||||
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
||||
{{-- in the Software without restriction, including without limitation the rights --}}
|
||||
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
||||
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
||||
{{-- furnished to do so, subject to the following conditions: --}}
|
||||
|
||||
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
||||
{{-- copies or substantial portions of the Software. --}}
|
||||
|
||||
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
||||
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
||||
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
||||
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
||||
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
||||
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
||||
{{-- SOFTWARE. --}}
|
||||
@extends('layouts.master')
|
||||
|
||||
@section('title')
|
||||
Create New Subuser
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<h3 class="nopad">Create New Subuser<hr />
|
||||
@can('edit-subuser', $server)
|
||||
<form action="{{ route('server.subusers.new', $server->uuidShort) }}" method="POST">
|
||||
@endcan
|
||||
<?php $oldInput = array_flip(is_array(old('permissions')) ? old('permissions') : []) ?>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<label class="control-label">User Email:</label>
|
||||
<div>
|
||||
<input type="text" name="email" autocomplete="off" value="{{ old('email') }}" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 fuelux">
|
||||
<h4>Power Management</h4><hr />
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['power-start']))checked="checked"@endif value="power-start"> <strong>Start Server</strong>
|
||||
<p class="text-muted"><small>Allows user to start server.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['power-stop']))checked="checked"@endif value="power-stop"> <strong>Stop Server</strong>
|
||||
<p class="text-muted"><small>Allows user to stop server.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['power-restart']))checked="checked"@endif value="power-restart"> <strong>Restart Server</strong>
|
||||
<p class="text-muted"><small>Allows user to restart server. A user with this permission can stop or start a server even without the above permissions.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['power-kill']))checked="checked"@endif value="power-kill"> <strong>Kill Server</strong>
|
||||
<p class="text-muted"><small>Allows user to kill server process.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['send-command']))checked="checked"@endif value="send-command"> <strong>Send Console Command</strong>
|
||||
<p class="text-muted"><small>Allows sending a command from the console. If the user does not have stop or restart permissions they cannot send the application's stop command.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 fuelux">
|
||||
<h4>File Management</h4><hr />
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['list-files']))checked="checked"@endif value="list-files"> <strong>List Files</strong>
|
||||
<p class="text-muted"><small>Allows user to list all files and folders on the server but not view file contents.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['edit-files']))checked="checked"@endif value="edit-files"> <strong>Edit Files</strong>
|
||||
<p class="text-muted"><small>Allows user to open a file for <em>viewing only</em>.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['save-files']))checked="checked"@endif value="save-files"> <strong>Save Files</strong>
|
||||
<p class="text-muted"><small>Allows user to save modified file contents.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['add-files']))checked="checked"@endif value="add-files"> <strong>Create Files</strong>
|
||||
<p class="text-muted"><small>Allows user to create a new file within the panel.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['upload-files']))checked="checked"@endif value="upload-files"> <strong>Upload Files</strong>
|
||||
<p class="text-muted"><small>Allows user to upload files.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['delete-files']))checked="checked"@endif value="delete-files"> <strong>Delete Files</strong>
|
||||
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows user to delete files from the system.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['download-files']))checked="checked"@endif value="download-files"> <strong>Download Files</strong>
|
||||
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows user to download files. If a user is given this permission they can download and view file contents.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 fuelux">
|
||||
<h4>Subuser Management</h4><hr />
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['list-subusers']))checked="checked"@endif value="list-subusers"> <strong>List Subusers</strong>
|
||||
<p class="text-muted"><small>Allows user to view all subusers assigned to the server.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['view-subuser']))checked="checked"@endif value="view-subuser"> <strong>View Subuser</strong>
|
||||
<p class="text-muted"><small>Allows user to view specific subuser permissions.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['edit-subuser']))checked="checked"@endif value="edit-subuser"> <strong>Edit Subuser</strong>
|
||||
<p class="text-muted"><small>Allows user to modify permissions for a subuser. <em>They will not have permission to modify themselves.</em></small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['create-subuser']))checked="checked"@endif value="create-subuser"> <strong>Create Subuser</strong>
|
||||
<p class="text-muted"><small>Allows a user to create a new subuser.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['delete-subuser']))checked="checked"@endif value="delete-subuser"> <strong>Delete Subuser</strong>
|
||||
<p class="text-muted"><small>Allows a user to delete a subuser.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 fuelux">
|
||||
<h4>Server Management</h4><hr />
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['set-connection']))checked="checked"@endif value="set-connection"> <strong>Set Default Connection</strong>
|
||||
<p class="text-muted"><small>Allows user to set the default connection used for a server as well as view avaliable ports.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['view-startup']))checked="checked"@endif value="view-startup"> <strong>View Startup Command</strong>
|
||||
<p class="text-muted"><small>Allows user to view the startup command and associated variables for a server.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['edit-startup']))checked="checked"@endif value="edit-startup"> <strong>Edit Startup Command</strong>
|
||||
<p class="text-muted"><small>Allows a user to modify startup variables for a server.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<h4>SFTP Management</h4><hr />
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['view-sftp']))checked="checked"@endif value="view-sftp"> <strong>View SFTP Details</strong>
|
||||
<p class="text-muted"><small>Allows user to view the server's SFTP information (not the password).</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($oldInput['reset-sftp']))checked="checked"@endif value="reset-sftp"> <strong>Reset SFTP Password</strong>
|
||||
<p class="text-muted"><small>Allows user to change the SFTP password for the server.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@can('edit-subuser', $server)
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-sm btn-primary" value="Add New Subuser" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endcan
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('.server-users').addClass('active');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -1,198 +0,0 @@
|
|||
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
|
||||
|
||||
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
|
||||
{{-- of this software and associated documentation files (the "Software"), to deal --}}
|
||||
{{-- in the Software without restriction, including without limitation the rights --}}
|
||||
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
|
||||
{{-- copies of the Software, and to permit persons to whom the Software is --}}
|
||||
{{-- furnished to do so, subject to the following conditions: --}}
|
||||
|
||||
{{-- The above copyright notice and this permission notice shall be included in all --}}
|
||||
{{-- copies or substantial portions of the Software. --}}
|
||||
|
||||
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
|
||||
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
|
||||
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
|
||||
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
|
||||
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
|
||||
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
|
||||
{{-- SOFTWARE. --}}
|
||||
@extends('layouts.master')
|
||||
|
||||
@section('title')
|
||||
Manage Subuser: {{ $subuser->a_userEmail }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<h3 class="nopad">Manage Subuser <span class="label label-primary">{{ $subuser->a_userEmail }}</span></h3><hr />
|
||||
@can('edit-subuser', $server)
|
||||
<form action="{{ route('server.subusers.view', ['uuid' => $server->uuidShort, 'id' => md5($subuser->id) ])}}" method="POST">
|
||||
@endcan
|
||||
<div class="row">
|
||||
<div class="col-md-6 fuelux">
|
||||
<h4>Power Management</h4><hr />
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['power-start']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="power-start"> <strong>Start Server</strong>
|
||||
<p class="text-muted"><small>Allows user to start server.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['power-stop']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="power-stop"> <strong>Stop Server</strong>
|
||||
<p class="text-muted"><small>Allows user to stop server.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['power-restart']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="power-restart"> <strong>Restart Server</strong>
|
||||
<p class="text-muted"><small>Allows user to restart server. A user with this permission can stop or start a server even without the above permissions.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['power-kill']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="power-kill"> <strong>Kill Server</strong>
|
||||
<p class="text-muted"><small>Allows user to kill server process.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['send-command']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="send-command"> <strong>Send Console Command</strong>
|
||||
<p class="text-muted"><small>Allows sending a command from the console. If the user does not have stop or restart permissions they cannot send the application's stop command.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 fuelux">
|
||||
<h4>File Management</h4><hr />
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['list-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="list-files"> <strong>List Files</strong>
|
||||
<p class="text-muted"><small>Allows user to list all files and folders on the server but not view file contents.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['edit-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="edit-files"> <strong>Edit Files</strong>
|
||||
<p class="text-muted"><small>Allows user to open a file for <em>viewing only</em>.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['save-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="save-files"> <strong>Save Files</strong>
|
||||
<p class="text-muted"><small>Allows user to save modified file contents.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['add-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="add-files"> <strong>Create Files</strong>
|
||||
<p class="text-muted"><small>Allows user to create a new file within the panel.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['upload-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="upload-files"> <strong>Upload Files</strong>
|
||||
<p class="text-muted"><small>Allows user to upload files.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['delete-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="delete-files"> <strong>Delete Files</strong>
|
||||
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows user to delete files from the system.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['download-files']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="download-files"> <strong>Download Files</strong>
|
||||
<p class="text-muted"><small><span class="label label-danger">Danger</span> Allows user to download files. If a user is given this permission they can download and view file contents.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 fuelux">
|
||||
<h4>Subuser Management</h4><hr />
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['list-subusers']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="list-subusers"> <strong>List Subusers</strong>
|
||||
<p class="text-muted"><small>Allows user to view all subusers assigned to the server.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['view-subuser']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="view-subuser"> <strong>View Subuser</strong>
|
||||
<p class="text-muted"><small>Allows user to view specific subuser permissions.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['edit-subuser']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="edit-subuser"> <strong>Edit Subuser</strong>
|
||||
<p class="text-muted"><small>Allows user to modify permissions for a subuser. <em>They will not have permission to modify themselves.</em></small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['create-subuser']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="create-subuser"> <strong>Create Subuser</strong>
|
||||
<p class="text-muted"><small>Allows a user to create a new subuser.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['delete-subuser']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="delete-subuser"> <strong>Delete Subuser</strong>
|
||||
<p class="text-muted"><small>Allows a user to delete a subuser.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 fuelux">
|
||||
<h4>Server Management</h4><hr />
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['set-connection']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="set-connection"> <strong>Set Default Connection</strong>
|
||||
<p class="text-muted"><small>Allows user to set the default connection used for a server as well as view avaliable ports.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['view-startup']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="view-startup"> <strong>View Startup Command</strong>
|
||||
<p class="text-muted"><small>Allows user to view the startup command and associated variables for a server.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['edit-startup']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="edit-startup"> <strong>Edit Startup Command</strong>
|
||||
<p class="text-muted"><small>Allows a user to modify startup variables for a server.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<h4>SFTP Management</h4><hr />
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['view-sftp']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="view-sftp"> <strong>View SFTP Details</strong>
|
||||
<p class="text-muted"><small>Allows user to view the server's SFTP information (not the password).</small><p>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox highlight">
|
||||
<label class="checkbox-custom highlight" data-initialize="checkbox">
|
||||
<input class="sr-only" name="permissions[]" type="checkbox" @if(isset($permissions['reset-sftp']))checked="checked"@endif @cannot('edit-subuser', $server)disabled="disabled"@endcannot value="reset-sftp"> <strong>Reset SFTP Password</strong>
|
||||
<p class="text-muted"><small>Allows user to change the SFTP password for the server.</small><p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@can('edit-subuser', $server)
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{!! csrf_field() !!}
|
||||
<input type="submit" class="btn btn-sm btn-primary" value="Modify Subuser" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endcan
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('.server-users').addClass('active');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
0
resources/views/vendor/.gitkeep
vendored
0
resources/views/vendor/.gitkeep
vendored
Loading…
Add table
Add a link
Reference in a new issue