fix: Gitea Traefik routing and connection pool optimization
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Failing after 10m14s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Has been skipped
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Security Vulnerability Scan / Check for Dependency Changes (push) Failing after 11m25s
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Failing after 10m14s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Has been skipped
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Security Vulnerability Scan / Check for Dependency Changes (push) Failing after 11m25s
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
- Remove middleware reference from Gitea Traefik labels (caused routing issues) - Optimize Gitea connection pool settings (MAX_IDLE_CONNS=30, authentication_timeout=180s) - Add explicit service reference in Traefik labels - Fix intermittent 504 timeouts by improving PostgreSQL connection handling Fixes Gitea unreachability via git.michaelschiemer.de
This commit is contained in:
84
src/Application/Admin/Database/DatabaseBrowserController.php
Normal file
84
src/Application/Admin/Database/DatabaseBrowserController.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Application\Admin\Database;
|
||||
|
||||
use App\Framework\Admin\Attributes\AdminPage;
|
||||
use App\Framework\Admin\Attributes\AdminSection;
|
||||
use App\Application\Admin\Service\AdminLayoutProcessor;
|
||||
use App\Framework\Admin\AdminPageRenderer;
|
||||
use App\Framework\Attributes\Route;
|
||||
use App\Framework\Database\Browser\Registry\DatabaseRegistry;
|
||||
use App\Framework\Database\Browser\Registry\TableRegistry;
|
||||
use App\Framework\Meta\MetaData;
|
||||
use App\Framework\Pagination\PaginationService;
|
||||
use App\Framework\Pagination\ValueObjects\PaginationRequest;
|
||||
use App\Framework\Router\Result\ViewResult;
|
||||
use App\Framework\View\Table\Generators\DatabaseTableGenerator;
|
||||
|
||||
#[AdminSection(name: 'Database', icon: 'database', order: 30)]
|
||||
final readonly class DatabaseBrowserController
|
||||
{
|
||||
public function __construct(
|
||||
private DatabaseRegistry $databaseRegistry,
|
||||
private TableRegistry $tableRegistry,
|
||||
private AdminPageRenderer $pageRenderer,
|
||||
private AdminLayoutProcessor $layoutProcessor,
|
||||
private PaginationService $paginationService,
|
||||
private DatabaseTableGenerator $tableGenerator,
|
||||
) {
|
||||
}
|
||||
|
||||
#[AdminPage(title: 'Database Browser', icon: 'database', section: 'Database', order: 10)]
|
||||
#[Route('/admin/database', name: 'admin.database.browser')]
|
||||
public function index(): ViewResult
|
||||
{
|
||||
$database = $this->databaseRegistry->getCurrentDatabase();
|
||||
$tables = $this->tableRegistry->getAllTables();
|
||||
|
||||
// Convert to array for pagination
|
||||
$tablesArray = array_map(fn ($table) => $table->toArray(), $tables);
|
||||
|
||||
// Paginate tables
|
||||
$paginationRequest = PaginationRequest::first(limit: 50, sortField: 'name');
|
||||
$paginator = $this->paginationService->forArray($tablesArray);
|
||||
$paginationResponse = $paginator->paginate($paginationRequest);
|
||||
|
||||
// Generate table
|
||||
$tableData = array_map(
|
||||
fn ($table) => [
|
||||
'name' => $table['name'],
|
||||
'row_count' => $table['row_count'],
|
||||
'size_mb' => $table['size_mb'],
|
||||
'engine' => $table['engine'],
|
||||
'collation' => $table['collation'],
|
||||
],
|
||||
$paginationResponse->data
|
||||
);
|
||||
|
||||
$table = $this->tableGenerator->generate($tableData);
|
||||
|
||||
$data = [
|
||||
'title' => 'Database Browser',
|
||||
'database' => $database->toArray(),
|
||||
'table' => $table->render(),
|
||||
'table_count' => count($tables),
|
||||
'pagination' => [
|
||||
'current_page' => $paginationResponse->meta->currentPage,
|
||||
'total_pages' => $paginationResponse->meta->totalPages,
|
||||
'total_items' => $paginationResponse->meta->totalCount,
|
||||
'items_per_page' => $paginationResponse->request->limit,
|
||||
],
|
||||
];
|
||||
|
||||
$finalData = $this->layoutProcessor->processLayoutFromArray($data);
|
||||
|
||||
return new ViewResult(
|
||||
template: 'database/browser',
|
||||
metaData: new MetaData('Database Browser', 'Admin - Database Browser'),
|
||||
data: $finalData
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user