Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/resources/views/admin/databases/view.blade.php
7460 views
1
@extends('layouts.admin')
2
3
@section('title')
4
Database Hosts → View → {{ $host->name }}
5
@endsection
6
7
@section('content-header')
8
<h1>{{ $host->name }}<small>Viewing associated databases and details for this database host.</small></h1>
9
<ol class="breadcrumb">
10
<li><a href="{{ route('admin.index') }}">Admin</a></li>
11
<li><a href="{{ route('admin.databases') }}">Database Hosts</a></li>
12
<li class="active">{{ $host->name }}</li>
13
</ol>
14
@endsection
15
16
@section('content')
17
<form action="{{ route('admin.databases.view', $host->id) }}" method="POST">
18
<div class="row">
19
<div class="col-sm-6">
20
<div class="box box-primary">
21
<div class="box-header with-border">
22
<h3 class="box-title">Host Details</h3>
23
</div>
24
<div class="box-body">
25
<div class="form-group">
26
<label for="pName" class="form-label">Name</label>
27
<input type="text" id="pName" name="name" class="form-control" value="{{ old('name', $host->name) }}" />
28
</div>
29
<div class="form-group">
30
<label for="pHost" class="form-label">Host</label>
31
<input type="text" id="pHost" name="host" class="form-control" value="{{ old('host', $host->host) }}" />
32
<p class="text-muted small">The IP address or FQDN that should be used when attempting to connect to this MySQL host <em>from the panel</em> to add new databases.</p>
33
</div>
34
<div class="form-group">
35
<label for="pPort" class="form-label">Port</label>
36
<input type="text" id="pPort" name="port" class="form-control" value="{{ old('port', $host->port) }}" />
37
<p class="text-muted small">The port that MySQL is running on for this host.</p>
38
</div>
39
<div class="form-group">
40
<label for="pNodeId" class="form-label">Linked Node</label>
41
<select name="node_id" id="pNodeId" class="form-control">
42
<option value="">None</option>
43
@foreach($locations as $location)
44
<optgroup label="{{ $location->short }}">
45
@foreach($location->nodes as $node)
46
<option value="{{ $node->id }}" {{ $host->node_id !== $node->id ?: 'selected' }}>{{ $node->name }}</option>
47
@endforeach
48
</optgroup>
49
@endforeach
50
</select>
51
<p class="text-muted small">This setting does nothing other than default to this database host when adding a database to a server on the selected node.</p>
52
</div>
53
</div>
54
</div>
55
</div>
56
<div class="col-sm-6">
57
<div class="box box-primary">
58
<div class="box-header with-border">
59
<h3 class="box-title">User Details</h3>
60
</div>
61
<div class="box-body">
62
<div class="form-group">
63
<label for="pUsername" class="form-label">Username</label>
64
<input type="text" name="username" id="pUsername" class="form-control" value="{{ old('username', $host->username) }}" />
65
<p class="text-muted small">The username of an account that has enough permissions to create new users and databases on the system.</p>
66
</div>
67
<div class="form-group">
68
<label for="pPassword" class="form-label">Password</label>
69
<input type="password" name="password" id="pPassword" class="form-control" />
70
<p class="text-muted small">The password to the account defined. Leave blank to continue using the assigned password.</p>
71
</div>
72
<hr />
73
<p class="text-danger small text-left">The account defined for this database host <strong>must</strong> have the <code>WITH GRANT OPTION</code> permission. If the defined account does not have this permission requests to create databases <em>will</em> fail. <strong>Do not use the same account details for MySQL that you have defined for this panel.</strong></p>
74
</div>
75
<div class="box-footer">
76
{!! csrf_field() !!}
77
<button name="_method" value="PATCH" class="btn btn-sm btn-primary pull-right">Save</button>
78
<button name="_method" value="DELETE" class="btn btn-sm btn-danger pull-left muted muted-hover"><i class="fa fa-trash-o"></i></button>
79
</div>
80
</div>
81
</div>
82
</div>
83
</form>
84
<div class="row">
85
<div class="col-xs-12">
86
<div class="box">
87
<div class="box-header with-border">
88
<h3 class="box-title">Databases</h3>
89
</div>
90
<div class="box-body table-responsive no-padding">
91
<table class="table table-hover">
92
<tr>
93
<th>Server</th>
94
<th>Database Name</th>
95
<th>Username</th>
96
<th>Connections From</th>
97
<th>Max Connections</th>
98
<th></th>
99
</tr>
100
@foreach($databases as $database)
101
<tr>
102
<td class="middle"><a href="{{ route('admin.servers.view', $database->getRelation('server')->id) }}">{{ $database->getRelation('server')->name }}</a></td>
103
<td class="middle">{{ $database->database }}</td>
104
<td class="middle">{{ $database->username }}</td>
105
<td class="middle">{{ $database->remote }}</td>
106
@if($database->max_connections != null)
107
<td class="middle">{{ $database->max_connections }}</td>
108
@else
109
<td class="middle">Unlimited</td>
110
@endif
111
<td class="text-center">
112
<a href="{{ route('admin.servers.view.database', $database->getRelation('server')->id) }}">
113
<button class="btn btn-xs btn-primary">Manage</button>
114
</a>
115
</td>
116
</tr>
117
@endforeach
118
</table>
119
</div>
120
@if($databases->hasPages())
121
<div class="box-footer with-border">
122
<div class="col-md-12 text-center">{!! $databases->render() !!}</div>
123
</div>
124
@endif
125
</div>
126
</div>
127
</div>
128
@endsection
129
130
@section('footer-scripts')
131
@parent
132
<script>
133
$('#pNodeId').select2();
134
</script>
135
@endsection
136
137