{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}} {{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}} {{-- of this software and associated documentation files (the "Software"), to deal --}} {{-- in the Software without restriction, including without limitation the rights --}} {{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}} {{-- copies of the Software, and to permit persons to whom the Software is --}} {{-- furnished to do so, subject to the following conditions: --}} {{-- The above copyright notice and this permission notice shall be included in all --}} {{-- copies or substantial portions of the Software. --}} {{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}} {{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}} {{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}} {{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}} {{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}} {{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}} {{-- SOFTWARE. --}} @extends('layouts.admin') @section('title') Database Hosts → View → {{ $host->name }} @endsection @section('content-header') <h1>{{ $host->name }}<small>Viewing associated databases and details for this database host.</small></h1> <ol class="breadcrumb"> <li><a href="{{ route('admin.index') }}">Admin</a></li> <li><a href="{{ route('admin.databases') }}">Database Hosts</a></li> <li class="active">{{ $host->name }}</li> </ol> @endsection @section('content') <form action="{{ route('admin.databases.view', $host->id) }}" method="POST"> <div class="row"> <div class="col-sm-6"> <div class="box box-primary"> <div class="box-header with-border"> <h3 class="box-title">Host Details</h3> </div> <div class="box-body"> <div class="form-group"> <label for="pName" class="form-label">Name</label> <input type="text" id="pName" name="name" class="form-control" value="{{ $host->name }}" /> </div> <div class="form-group"> <label for="pHost" class="form-label">Host</label> <input type="text" id="pHost" name="host" class="form-control" value="{{ $host->host }}" /> <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> </div> <div class="form-group"> <label for="pPort" class="form-label">Port</label> <input type="text" id="pPort" name="port" class="form-control" value="{{ $host->port }}" /> <p class="text-muted small">The port that MySQL is running on for this host.</p> </div> <div class="form-group"> <label for="pNodeId" class="form-label">Linked Node</label> <select name="node_id" id="pNodeId" class="form-control"> <option value="0">None</option> @foreach($locations as $location) <optgroup label="{{ $location->short }}"> @foreach($location->nodes as $node) <option value="{{ $node->id }}" {{ $host->node_id !== $node->id ?: 'selected' }}>{{ $node->name }}</option> @endforeach </optgroup> @endforeach </select> <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> </div> </div> </div> </div> <div class="col-sm-6"> <div class="box box-primary"> <div class="box-header with-border"> <h3 class="box-title">User Details</h3> </div> <div class="box-body"> <div class="form-group"> <label for="pUsername" class="form-label">Username</label> <input type="text" name="username" id="pUsername" class="form-control" value="{{ $host->username }}" /> <p class="text-muted small">The username of an account that has enough permissions to create new users and databases on the system.</p> </div> <div class="form-group"> <label for="pPassword" class="form-label">Password</label> <input type="password" name="password" id="pPassword" class="form-control" /> <p class="text-muted small">The password to the account defined. Leave blank to continue using the assigned password.</p> </div> <hr /> <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> </div> <div class="box-footer"> {!! csrf_field() !!} {!! method_field('PATCH') !!} <button name="action" value="delete" class="btn btn-sm btn-danger pull-left muted muted-hover"><i class="fa fa-trash-o"></i></button> <button name="action" value="edit" class="btn btn-sm btn-primary pull-right">Save</button> </div> </div> </div> </div> </form> <div class="row"> <div class="col-xs-12"> <div class="box"> <div class="box-header with-border"> <h3 class="box-title">Databases</h3> </div> <div class="box-body table-responsive no-padding"> <table class="table table-hover"> <tr> <th>Server</th> <th>Database Name</th> <th>Username</th> <th>Connections From</th> <th></th> </tr> @foreach($host->databases as $database) <tr> <td class="middle"><a href="{{ route('admin.servers.view', $database->server->id) }}">{{ $database->server->name }}</a></td> <td class="middle">{{ $database->database }}</td> <td class="middle">{{ $database->username }}</td> <td class="middle">{{ $database->remote }}</td> <td class="text-center"> <a href="{{ route('admin.servers.view.database', $database->server->id) }}"> <button class="btn btn-xs btn-primary">Manage</button> </a> </td> </tr> @endforeach </table> </div> </div> </div> </div> @endsection @section('footer-scripts') @parent <script> $('#pNodeId').select2(); </script> @endsection