Add initial go at user created databases for servers, still needs cleaning
This commit is contained in:
parent
87b96bdfc8
commit
07893effa3
11 changed files with 314 additions and 25 deletions
|
@ -21,15 +21,10 @@
|
|||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="{{ $allowCreation ? 'col-xs-12 col-sm-8' : 'col-xs-12' }}">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">@lang('server.config.database.your_dbs')</h3>
|
||||
@if(auth()->user()->root_admin)
|
||||
<div class="box-tools">
|
||||
<a href="{{ route('admin.servers.view.database', ['server' => $server->id]) }}" target="_blank" class="btn btn-sm btn-success">Create New</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@if(count($databases) > 0)
|
||||
<div class="box-body table-responsive no-padding">
|
||||
|
@ -69,17 +64,49 @@
|
|||
<div class="box-body">
|
||||
<div class="alert alert-info no-margin-bottom">
|
||||
@lang('server.config.database.no_dbs')
|
||||
@if(Auth::user()->root_admin === 1)
|
||||
<a href="{{ route('admin.servers.view', [
|
||||
'id' => $server->id,
|
||||
'tab' => 'tab_database'
|
||||
]) }}" target="_blank">@lang('server.config.database.add_db')</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@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
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue