index.blade.php•5.86 kB
@extends('layout')
@section('title', 'Database Connections')
@section('content')
<div class="px-4 sm:px-6 lg:px-8">
<div class="sm:flex sm:items-center">
<div class="sm:flex-auto">
<h1 class="text-2xl font-semibold text-gray-900">Database Connections</h1>
<p class="mt-2 text-sm text-gray-700">Manage database connections for MCP access.</p>
</div>
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
<a href="{{ route('connections.create') }}" class="inline-flex items-center justify-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 sm:w-auto">
Add Connection
</a>
</div>
</div>
<div class="mt-8 flow-root">
<div class="-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8">
<div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg">
<table class="min-w-full divide-y divide-gray-300">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Driver</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Database</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Host</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th scope="col" class="relative px-6 py-3"><span class="sr-only">Actions</span></th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
@forelse($connections as $connection)
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">
{{ $connection->connection_name }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{{ strtoupper($connection->driver) }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{{ $connection->database }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{{ $connection->host }}{{ $connection->port ? ':' . $connection->port : '' }}
</td>
<td class="px-6 py-4 whitespace-nowrap">
@if($connection->is_active)
<span class="inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">Active</span>
@else
<span class="inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-red-100 text-red-800">Inactive</span>
@endif
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium space-x-2">
<a href="{{ route('connections.show', $connection) }}" class="text-indigo-600 hover:text-indigo-900">View</a>
<a href="{{ route('connections.edit', $connection) }}" class="text-indigo-600 hover:text-indigo-900">Edit</a>
<form action="{{ route('connections.test', $connection) }}" method="POST" class="inline">
@csrf
<button type="submit" class="text-blue-600 hover:text-blue-900">Test</button>
</form>
<form action="{{ route('connections.destroy', $connection) }}" method="POST" class="inline" onsubmit="return confirm('Are you sure you want to delete this connection?')">
@csrf
@method('DELETE')
<button type="submit" class="text-red-600 hover:text-red-900">Delete</button>
</form>
</td>
</tr>
@empty
<tr>
<td colspan="6" class="px-6 py-4 text-center text-sm text-gray-500">
No database connections configured. <a href="{{ route('connections.create') }}" class="text-indigo-600 hover:text-indigo-900">Add your first connection</a>.
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@endsection