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