2017-09-26 02:43:01 +00:00
|
|
|
{{-- Pterodactyl - Panel --}}
|
2017-01-24 22:57:08 +00:00
|
|
|
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
|
2017-01-16 01:28:54 +00:00
|
|
|
|
2017-09-26 02:43:01 +00:00
|
|
|
{{-- This software is licensed under the terms of the MIT license. --}}
|
|
|
|
{{-- https://opensource.org/licenses/MIT --}}
|
2017-01-16 01:28:54 +00:00
|
|
|
@extends('layouts.master')
|
|
|
|
|
|
|
|
@section('title')
|
2017-01-18 00:46:42 +00:00
|
|
|
@lang('server.config.database.header')
|
2017-01-16 01:28:54 +00:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('content-header')
|
2017-01-18 00:46:42 +00:00
|
|
|
<h1>@lang('server.config.database.header')<small>@lang('server.config.database.header_sub')</small></h1>
|
2017-01-16 01:28:54 +00:00
|
|
|
<ol class="breadcrumb">
|
2017-01-18 00:46:42 +00:00
|
|
|
<li><a href="{{ route('index') }}">@lang('strings.home')</a></li>
|
2017-01-16 01:28:54 +00:00
|
|
|
<li><a href="{{ route('server.index', $server->uuidShort) }}">{{ $server->name }}</a></li>
|
2017-01-18 00:46:42 +00:00
|
|
|
<li>@lang('navigation.server.configuration')</li>
|
|
|
|
<li class="active">@lang('navigation.server.databases')</li>
|
2017-01-16 01:28:54 +00:00
|
|
|
</ol>
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
<div class="row">
|
2018-03-02 03:27:37 +00:00
|
|
|
<div class="{{ $allowCreation ? 'col-xs-12 col-sm-8' : 'col-xs-12' }}">
|
2017-01-16 01:28:54 +00:00
|
|
|
<div class="box">
|
|
|
|
<div class="box-header with-border">
|
2017-01-18 00:46:42 +00:00
|
|
|
<h3 class="box-title">@lang('server.config.database.your_dbs')</h3>
|
2017-01-16 01:28:54 +00:00
|
|
|
</div>
|
|
|
|
@if(count($databases) > 0)
|
|
|
|
<div class="box-body table-responsive no-padding">
|
|
|
|
<table class="table table-hover">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
2017-01-18 00:46:42 +00:00
|
|
|
<th>@lang('strings.database')</th>
|
|
|
|
<th>@lang('strings.username')</th>
|
|
|
|
<th>@lang('strings.password')</th>
|
|
|
|
<th>@lang('server.config.database.host')</th>
|
2017-03-05 21:46:44 +00:00
|
|
|
@can('reset-db-password', $server)<td></td>@endcan
|
2017-01-16 01:28:54 +00:00
|
|
|
</tr>
|
|
|
|
@foreach($databases as $database)
|
|
|
|
<tr>
|
2017-03-05 21:46:44 +00:00
|
|
|
<td class="middle">{{ $database->database }}</td>
|
|
|
|
<td class="middle">{{ $database->username }}</td>
|
2017-10-19 03:32:19 +00:00
|
|
|
<td class="middle">
|
|
|
|
<code class="toggle-display" style="cursor:pointer" data-toggle="tooltip" data-placement="right" title="Click to Reveal">
|
|
|
|
<i class="fa fa-key"></i> ••••••••
|
|
|
|
</code>
|
|
|
|
<code class="hidden" data-attr="set-password">
|
|
|
|
{{ Crypt::decrypt($database->password) }}
|
|
|
|
</code>
|
|
|
|
</td>
|
2017-03-17 21:17:36 +00:00
|
|
|
<td class="middle"><code>{{ $database->host->host }}:{{ $database->host->port }}</code></td>
|
2017-03-05 21:46:44 +00:00
|
|
|
@can('reset-db-password', $server)
|
|
|
|
<td>
|
|
|
|
<button class="btn btn-xs btn-primary pull-right" data-action="reset-password" data-id="{{ $database->id }}"><i class="fa fa-fw fa-refresh"></i> @lang('server.config.database.reset_password')</button>
|
|
|
|
</td>
|
|
|
|
@endcan
|
2017-01-16 01:28:54 +00:00
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
@else
|
|
|
|
<div class="box-body">
|
2017-10-19 03:32:19 +00:00
|
|
|
<div class="alert alert-info no-margin-bottom">
|
2017-01-18 00:46:42 +00:00
|
|
|
@lang('server.config.database.no_dbs')
|
2017-01-16 01:28:54 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-03-02 03:27:37 +00:00
|
|
|
@if($allowCreation)
|
|
|
|
<div class="col-xs-12 col-sm-4">
|
|
|
|
<div class="box box-success">
|
|
|
|
<div class="box-header with-border">
|
|
|
|
<h3 class="box-title">Create New Database</h3>
|
|
|
|
</div>
|
|
|
|
@if($overLimit)
|
|
|
|
<div class="box-body">
|
|
|
|
<div class="alert alert-danger no-margin">
|
|
|
|
You are currently using <strong>{{ count($databases) }}</strong> of your <strong>{{ $server->database_limit ?? '∞' }}</strong> allowed databases.
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@else
|
|
|
|
<form action="{{ route('server.databases.new', $server->uuidShort) }}" method="POST">
|
|
|
|
<div class="box-body">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="pDatabaseName" class="control-label">Database</label>
|
|
|
|
<div class="input-group">
|
|
|
|
<span class="input-group-addon">s{{ $server->id }}_</span>
|
|
|
|
<input id="pDatabaseName" type="text" name="database" class="form-control" placeholder="database" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="pRemote" class="control-label">Connections</label>
|
|
|
|
<input id="pRemote" type="text" name="remote" class="form-control" value="%" />
|
|
|
|
<p class="text-muted small">This should reflect the IP address that connections are allowed from. Uses standard MySQL notation. If unsure leave as <code>%</code>.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="box-footer">
|
|
|
|
{!! csrf_field() !!}
|
|
|
|
<p class="text-muted small">You are currently using <strong>{{ count($databases) }}</strong> of <strong>{{ $server->database_limit ?? '∞' }}</strong> databases. A username and password for this database will be randomly generated after form submission.</p>
|
|
|
|
<input type="submit" class="btn btn-sm btn-success pull-right" value="Create Database" />
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
2017-01-16 01:28:54 +00:00
|
|
|
</div>
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('footer-scripts')
|
|
|
|
@parent
|
|
|
|
{!! Theme::js('js/frontend/server.socket.js') !!}
|
|
|
|
<script>
|
2017-10-19 03:32:19 +00:00
|
|
|
$(function () {
|
|
|
|
$('[data-toggle="tooltip"]').tooltip()
|
|
|
|
});
|
|
|
|
$('.toggle-display').on('click', function () {
|
|
|
|
$(this).parent().find('code[data-attr="set-password"]').removeClass('hidden');
|
|
|
|
$(this).hide();
|
|
|
|
});
|
|
|
|
@can('reset-db-password', $server)
|
|
|
|
$('[data-action="reset-password"]').click(function (e) {
|
|
|
|
e.preventDefault();
|
|
|
|
var block = $(this);
|
|
|
|
$(this).addClass('disabled').find('i').addClass('fa-spin');
|
|
|
|
$.ajax({
|
|
|
|
type: 'PATCH',
|
|
|
|
url: Router.route('server.databases.password', { server: Pterodactyl.server.uuidShort }),
|
|
|
|
headers: {
|
|
|
|
'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content'),
|
|
|
|
},
|
|
|
|
data: {
|
|
|
|
database: $(this).data('id')
|
|
|
|
}
|
|
|
|
}).done(function (data) {
|
|
|
|
block.parent().parent().find('[data-attr="set-password"]').html(data.password);
|
|
|
|
}).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
|
|
|
|
});
|
|
|
|
}).always(function () {
|
|
|
|
block.removeClass('disabled').find('i').removeClass('fa-spin');
|
2017-01-16 01:28:54 +00:00
|
|
|
});
|
|
|
|
});
|
2017-10-19 03:32:19 +00:00
|
|
|
@endcan
|
2017-01-16 01:28:54 +00:00
|
|
|
</script>
|
|
|
|
@endsection
|