Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/resources/views/admin/databases/index.blade.php
7460 views
1
@extends('layouts.admin')
2
3
@section('title')
4
Database Hosts
5
@endsection
6
7
@section('content-header')
8
<h1>Database Hosts<small>Database hosts that servers can have databases created on.</small></h1>
9
<ol class="breadcrumb">
10
<li><a href="{{ route('admin.index') }}">Admin</a></li>
11
<li class="active">Database Hosts</li>
12
</ol>
13
@endsection
14
15
@section('content')
16
<div class="row">
17
<div class="col-xs-12">
18
<div class="box box-primary">
19
<div class="box-header with-border">
20
<h3 class="box-title">Host List</h3>
21
<div class="box-tools">
22
<button class="btn btn-sm btn-primary" data-toggle="modal" data-target="#newHostModal">Create New</button>
23
</div>
24
</div>
25
<div class="box-body table-responsive no-padding">
26
<table class="table table-hover">
27
<tbody>
28
<tr>
29
<th>ID</th>
30
<th>Name</th>
31
<th>Host</th>
32
<th>Port</th>
33
<th>Username</th>
34
<th class="text-center">Databases</th>
35
<th class="text-center">Node</th>
36
</tr>
37
@foreach ($hosts as $host)
38
<tr>
39
<td><code>{{ $host->id }}</code></td>
40
<td><a href="{{ route('admin.databases.view', $host->id) }}">{{ $host->name }}</a></td>
41
<td><code>{{ $host->host }}</code></td>
42
<td><code>{{ $host->port }}</code></td>
43
<td>{{ $host->username }}</td>
44
<td class="text-center">{{ $host->databases_count }}</td>
45
<td class="text-center">
46
@if(! is_null($host->node))
47
<a href="{{ route('admin.nodes.view', $host->node->id) }}">{{ $host->node->name }}</a>
48
@else
49
<span class="label label-default">None</span>
50
@endif
51
</td>
52
</tr>
53
@endforeach
54
</tbody>
55
</table>
56
</div>
57
</div>
58
</div>
59
</div>
60
<div class="modal fade" id="newHostModal" tabindex="-1" role="dialog">
61
<div class="modal-dialog" role="document">
62
<div class="modal-content">
63
<form action="{{ route('admin.databases') }}" method="POST">
64
<div class="modal-header">
65
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
66
<h4 class="modal-title">Create New Database Host</h4>
67
</div>
68
<div class="modal-body">
69
<div class="form-group">
70
<label for="pName" class="form-label">Name</label>
71
<input type="text" name="name" id="pName" class="form-control" />
72
<p class="text-muted small">A short identifier used to distinguish this location from others. Must be between 1 and 60 characters, for example, <code>us.nyc.lvl3</code>.</p>
73
</div>
74
<div class="row">
75
<div class="col-md-6">
76
<label for="pHost" class="form-label">Host</label>
77
<input type="text" name="host" id="pHost" class="form-control" />
78
<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>
79
</div>
80
<div class="col-md-6">
81
<label for="pPort" class="form-label">Port</label>
82
<input type="text" name="port" id="pPort" class="form-control" value="3306"/>
83
<p class="text-muted small">The port that MySQL is running on for this host.</p>
84
</div>
85
</div>
86
<div class="row">
87
<div class="col-md-6">
88
<label for="pUsername" class="form-label">Username</label>
89
<input type="text" name="username" id="pUsername" class="form-control" />
90
<p class="text-muted small">The username of an account that has enough permissions to create new users and databases on the system.</p>
91
</div>
92
<div class="col-md-6">
93
<label for="pPassword" class="form-label">Password</label>
94
<input type="password" name="password" id="pPassword" class="form-control" />
95
<p class="text-muted small">The password to the account defined.</p>
96
</div>
97
</div>
98
<div class="form-group">
99
<label for="pNodeId" class="form-label">Linked Node</label>
100
<select name="node_id" id="pNodeId" class="form-control">
101
<option value="">None</option>
102
@foreach($locations as $location)
103
<optgroup label="{{ $location->short }}">
104
@foreach($location->nodes as $node)
105
<option value="{{ $node->id }}">{{ $node->name }}</option>
106
@endforeach
107
</optgroup>
108
@endforeach
109
</select>
110
<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>
111
</div>
112
</div>
113
<div class="modal-footer">
114
<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>
115
{!! csrf_field() !!}
116
<button type="button" class="btn btn-default btn-sm pull-left" data-dismiss="modal">Cancel</button>
117
<button type="submit" class="btn btn-success btn-sm">Create</button>
118
</div>
119
</form>
120
</div>
121
</div>
122
</div>
123
@endsection
124
125
@section('footer-scripts')
126
@parent
127
<script>
128
$('#pNodeId').select2();
129
</script>
130
@endsection
131
132