Move everything over to pterodactyl theme

This commit is contained in:
Dane Everitt 2017-03-16 19:48:24 -04:00
parent 198a021a97
commit 955d89c0c6
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
15 changed files with 45 additions and 808 deletions

View file

@ -1,150 +0,0 @@
{{-- Copyright (c) 2015 - 2017 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')
Database Management
@endsection
@section('content')
<div class="col-md-12">
<ul class="breadcrumb">
<li><a href="/admin">Admin Control</a></li>
<li class="active">Databases</li>
</ul>
<h3>Manage Databases</h3><hr />
<ul class="nav nav-tabs tabs_with_panel" id="config_tabs">
<li class="active"><a href="#tab_databases" data-toggle="tab">Databases</a></li>
<li><a href="#tab_dbservers" data-toggle="tab">Database Servers</a></li>
<li><a href="{{ route('admin.databases.new') }}"><i class="fa fa-plus"></i></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane {{ Request::input('tab') == 'tab_dbservers' ? '' : 'active' }}" id="tab_databases">
<div class="panel panel-default">
<div class="panel-heading"></div>
<div class="panel-body">
<table class="table table-bordered table-hover" style="margin-bottom:0;">
<thead>
<tr>
<th>Server</th>
<th>Database</th>
<th>Username</th>
<th>Connection</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($databases as $database)
<tr>
<td>{{ $database->server->name }}</td>
<td>{{ $database->database }}</td>
<td>{{ $database->username }} ({{ $database->remote }})</td>
<?php $host = $hosts->where('id', $database->db_server)->first(); ?>
<td><code>{{ $host->host }}:{{ $host->port }}</code></td>
<td class="text-center"><a href="/admin/servers/view/{{ $database->server->id }}?tab=tab_database"><i class="fa fa-search"></i></a></td>
<td class="text-center"><a href="#" data-action="delete" data-type="delete" data-attr="{{ $database->id }}" class="text-danger"><i class="fa fa-trash-o"></i></a></td>
</tr>
@endforeach
</tbody>
</table>
<div class="col-md-12 text-center">
{{ $databases->appends(['tab' => 'tab_databases'])->links() }}
</div>
</div>
</div>
</div>
<div class="tab-pane {{ Request::input('tab') == 'tab_dbservers' ? 'active' : '' }}" id="tab_dbservers">
<div class="panel panel-default">
<div class="panel-heading"></div>
<div class="panel-body">
<table class="table table-bordered table-hover" style="margin-bottom:0;">
<thead>
<tr>
<th>Name</th>
<th>Connection</th>
<th>Username</th>
<th class="text-center">Databases</th>
<th>Linked Node</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($hosts as $database)
<tr>
<td>{{ $database->name }}</td>
<td><code>{{ $database->host }}:{{ $database->port }}</code></td>
<td>{{ $database->username }}</td>
<td class="text-center">{{ $database->databases_count }}</td>
<td>@if(is_null($database->node))<em>unlinked</em>@else{{ $database->node->name }}@endif</td>
<td class="text-center"><a href="#" class="text-danger" data-action="delete" data-type="delete-server" data-attr="{{ $database->id }}"><i class="fa fa-trash-o"></i></a></td>
</tr>
@endforeach
</tbody>
</table>
<div class="col-md-12 text-center">
{{ $hosts->appends('tab', 'tab_dbservers')->render() }}
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('#sidebar_links').find("a[href='/admin/databases']").addClass('active');
$('[data-action="delete"]').click(function (event) {
event.preventDefault();
var self = $(this);
swal({
title: '',
type: 'warning',
text: 'Are you sure that you want to remove this database from the system?',
showCancelButton: true,
confirmButtonText: 'Delete',
confirmButtonColor: '#d9534f',
closeOnConfirm: false
}, function () {
$.ajax({
method: 'DELETE',
url: '{{ route('admin.databases') }}/' + self.data('type') + '/' + self.data('attr'),
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
}
}).done(function () {
self.parent().parent().slideUp();
swal({
title: '',
type: 'success',
text: ''
});
}).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

View file

@ -1,103 +0,0 @@
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
{{-- of this software and associated documentation files (the "Software"), to deal --}}
{{-- in the Software without restriction, including without limitation the rights --}}
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
{{-- copies of the Software, and to permit persons to whom the Software is --}}
{{-- furnished to do so, subject to the following conditions: --}}
{{-- The above copyright notice and this permission notice shall be included in all --}}
{{-- copies or substantial portions of the Software. --}}
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
{{-- SOFTWARE. --}}
@extends('layouts.admin')
@section('title')
Add New Database Server
@endsection
@section('content')
<div class="col-md-12">
<ul class="breadcrumb">
<li><a href="/admin">Admin Control</a></li>
<li><a href="/admin/databases">Databases</a></li>
<li class="active">New Database Server</li>
</ul>
<h3>New Database Server</h3><hr />
<div class="alert alert-info">If you are trying to add a new database to an existing server please visit that server's control page and visit the 'Databases' tab. This page is for adding a new database server that individual per-server databases can be deployed to.</div>
<form action="{{ route('admin.databases.new') }}" method="POST">
<div class="row">
<div class="form-group col-xs-6">
<label class="control-label">Descriptive Name:</label>
<div>
<input type="text" class="form-control" name="name" value="{{ old('name') }}" />
<p class="text-muted"><small>Enter a descriptive name for this database server.</small></p>
</div>
</div>
<div class="form-group col-xs-6">
<label class="control-label">Linked Node:</label>
<div>
<select name="linked_node" class="form-control">
<option>None</option>
@foreach($nodes as $node)
<option value="{{ $node->id }}" @if((int) old('linked_node') === $node->id) selected="selected" @endif>{{ $node->name }} ({{ $node->location->short }})</option>
@endforeach
</select>
<p class="text-muted"><small>A linked node implies that this Database Server is running on that node and it will be auto-selected when adding a database to servers on that node.</small></p>
</div>
</div>
</div>
<hr />
<div class="row">
<div class="form-group col-xs-6">
<label class="control-label">Database Host:</label>
<div>
<input type="text" class="form-control" name="host" value="{{ old('host') }}" />
<p class="text-muted"><small>Enter the IP address that this database server is listening on.</small></p>
</div>
</div>
<div class="form-group col-xs-6">
<label class="control-label">Database Port:</label>
<div>
<input type="text" class="form-control" name="port" value="{{ old('port', 3306) }}" />
</div>
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="control-label">Database Username:</label>
<div>
<input type="text" class="form-control" name="username" value="{{ old('username') }}" />
<p class="text-muted"><small>The panel must be able to access this database, you may need to allow access from <code>{{ Request::server('SERVER_ADDR') }}</code> for this user.</small></p>
</div>
</div>
<div class="form-group col-md-6">
<label class="control-label">Database User Passwod:</label>
<div>
<input type="password" class="form-control" autocomplete="off" name="password" />
</div>
</div>
</div>
<div class="well well-sm">
<div class="row">
<div class="col-md-12">
{!! csrf_field() !!}
<input type="submit" value="Add Database Server" class="btn btn-sm btn-primary" />
</div>
</div>
</div>
</form>
</div>
<script>
$(document).ready(function () {
$('#sidebar_links').find("a[href='/admin/databases']").addClass('active');
});
</script>
@endsection