Edit file File name : dashboard.blade.php Content :@extends('layouts.app') @section('title', 'Dashboard') @section('content') <div class="space-y-6"> <div class="flex justify-between items-center"> <h2 class="text-2xl font-bold text-gray-900">Dashboard</h2> </div> <div class="grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3"> <div class="bg-white overflow-hidden shadow rounded-lg"> <div class="p-5"> <div class="flex items-center"> <div class="flex-shrink-0"> <svg class="h-6 w-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 7v10c0 2 1 3 3 3h10c2 0 3-1 3-3V7c0-2-1-3-3-3H7c-2 0-3 1-3 3z" /> </svg> </div> <div class="ml-5 w-0 flex-1"> <dl> <dt class="text-sm font-medium text-gray-500 truncate">Total Databases</dt> <dd class="text-lg font-medium text-gray-900">{{ $totalDatabases }}</dd> </dl> </div> </div> </div> </div> <div class="bg-white overflow-hidden shadow rounded-lg"> <div class="p-5"> <div class="flex items-center"> <div class="flex-shrink-0"> <svg class="h-6 w-6 text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" /> </svg> </div> <div class="ml-5 w-0 flex-1"> <dl> <dt class="text-sm font-medium text-gray-500 truncate">Successful Backups</dt> <dd class="text-lg font-medium text-gray-900">{{ $successfulBackups }}</dd> </dl> </div> </div> </div> </div> <div class="bg-white overflow-hidden shadow rounded-lg"> <div class="p-5"> <div class="flex items-center"> <div class="flex-shrink-0"> <svg class="h-6 w-6 text-red-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" /> </svg> </div> <div class="ml-5 w-0 flex-1"> <dl> <dt class="text-sm font-medium text-gray-500 truncate">Failed Backups</dt> <dd class="text-lg font-medium text-gray-900">{{ $failedBackups }}</dd> </dl> </div> </div> </div> </div> </div> <div class="bg-white shadow rounded-lg p-6"> <div class="flex justify-between items-center mb-4"> <h3 class="text-lg font-medium text-gray-900">Google Drive Connection</h3> @if($googleDriveConnected) <span class="px-2 py-1 text-xs font-semibold text-green-800 bg-green-100 rounded-full">Connected</span> @else <span class="px-2 py-1 text-xs font-semibold text-red-800 bg-red-100 rounded-full">Not Connected</span> @endif </div> <div class="space-y-3"> @if($googleDriveConnected) <p class="text-sm text-gray-600">Connected as: {{ $googleDriveSetting->email }}</p> <form action="{{ route('google-drive.disconnect') }}" method="POST"> @csrf <button type="submit" class="bg-red-600 hover:bg-red-700 text-white font-bold py-2 px-4 rounded"> Disconnect Google Drive </button> </form> @else <p class="text-sm text-gray-600">Connect your Google Drive account to automatically upload backups.</p> <a href="{{ route('google-drive.authorize') }}" class="inline-block bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"> Connect Google Drive </a> @endif </div> </div> <div class="bg-white shadow rounded-lg p-6"> <h3 class="text-lg font-medium text-gray-900 mb-4">Active Databases</h3> @if($databases->count() > 0) <div class="space-y-4"> @foreach($databases as $database) <div class="flex justify-between items-center p-4 bg-gray-50 rounded-lg"> <div> <h4 class="font-medium text-gray-900">{{ $database->name }}</h4> <p class="text-sm text-gray-500">{{ $database->host }}:{{ $database->port }} / {{ $database->database }}</p> <p class="text-xs text-gray-400 mt-1">Backups: {{ $database->backup_histories_count }}</p> </div> <form action="{{ route('backups.run', $database) }}" method="POST"> @csrf <button type="submit" class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-2 px-4 rounded"> Backup Now </button> </form> </div> @endforeach </div> @else <p class="text-gray-500">No active databases configured. <a href="{{ route('databases.create') }}" class="text-indigo-600 hover:text-indigo-800">Add one now</a></p> @endif </div> <div class="bg-white shadow rounded-lg p-6"> <h3 class="text-lg font-medium text-gray-900 mb-4">Recent Backups</h3> @if($recentBackups->count() > 0) <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead> <tr> <th class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Database</th> <th class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Filename</th> <th class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th> <th class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200"> @foreach($recentBackups as $backup) <tr> <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">{{ $backup->databaseConfiguration->name }}</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ $backup->filename }}</td> <td class="px-6 py-4 whitespace-nowrap"> @if($backup->status === 'success') <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Success</span> @else <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">Failed</span> @endif </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ $backup->created_at->format('M d, Y H:i') }}</td> </tr> @endforeach </tbody> </table> </div> @else <p class="text-gray-500">No backups yet.</p> @endif </div> </div> @endsection Save