mirror of
https://github.com/coollabsio/coolify.git
synced 2026-10-28 09:34:36 +08:00
Add a /dashboard/canvas page that renders every team server with its resources and their running or queued deployments, backed by a new ServerCanvasController::dashboard endpoint and a per-server usage endpoint for zone headers. The dashboard remembers the list/canvas choice and each section (projects, servers) its own table/grid view. - Show Deploying/Queued pills on canvas cards and a foldable recent deployments panel; add shared CanvasControls component - Allow backup downloads from the server host via the S3 download storage (PrepareFileDownloadJob accepts a null container) - Extract backup toggle/run actions into ManagesDatabaseBackup and surface them in backup execution headers; merge S3 and retention sections into the general backup settings - Move deployments indicator to the top bar and add a main nav resource menu with submenus; simplify breadcrumbs and settings layouts - Add shared variables overview canvas and scheduled task modals - Add feature tests for dashboard canvas, view modes, navbar submenus, backup S3 downloads and scheduled task modals
73 lines
3.3 KiB
PHP
73 lines
3.3 KiB
PHP
@props([
|
|
'context',
|
|
'parameters',
|
|
'section',
|
|
])
|
|
|
|
@php
|
|
$routes = match ($context) {
|
|
'application' => [
|
|
'back' => 'project.application.backup.index',
|
|
'general' => 'project.application.backup.show',
|
|
'executions' => 'project.application.backup.executions',
|
|
'danger' => 'project.application.backup.danger',
|
|
],
|
|
'service' => [
|
|
'back' => 'project.service.volume-backups.index',
|
|
'general' => 'project.service.database.backup.show',
|
|
'executions' => 'project.service.database.backup.executions',
|
|
'danger' => 'project.service.database.backup.danger',
|
|
],
|
|
'service-volume' => [
|
|
'back' => 'project.service.volume-backups.index',
|
|
'general' => 'project.service.volume-backups.show',
|
|
'executions' => 'project.service.volume-backups.executions',
|
|
'danger' => 'project.service.volume-backups.danger',
|
|
],
|
|
default => [
|
|
'back' => 'project.database.configuration',
|
|
'general' => 'project.database.backup.execution',
|
|
'executions' => 'project.database.backup.executions',
|
|
'danger' => 'project.database.backup.danger',
|
|
],
|
|
};
|
|
|
|
$items = [
|
|
['key' => 'general', 'label' => 'General', 'icon' => 'settings'],
|
|
['key' => 'executions', 'label' => 'Executions', 'icon' => 'browser-terminal'],
|
|
['key' => 'danger', 'label' => 'Danger Zone', 'icon' => 'danger'],
|
|
];
|
|
$backLabel = $context === 'database' ? 'Back to database' : 'Back to backups';
|
|
$backParameters = match ($context) {
|
|
'database' => collect($parameters)->except('backup_uuid')->all(),
|
|
'service' => collect($parameters)->except(['stack_service_uuid', 'backup_uuid'])->all(),
|
|
default => $parameters,
|
|
};
|
|
@endphp
|
|
|
|
<x-main-nav-menu :back-href="route($routes['back'], $backParameters)" :back-label="$context === 'database' ? 'Database' : 'Backups'"
|
|
data-settings-search-items="{{ json_encode(settingsSearchItems(['Backup' => collect($items)->map(fn (array $item): array => [...$item, 'route' => $routes[$item['key']]])], $parameters)) }}">
|
|
<nav aria-label="Backup settings"
|
|
class="grid grid-cols-2 gap-0.5 border-y border-neutral-200 py-3 sm:grid-cols-3 xl:grid-cols-1 xl:border-y-0 xl:py-0 dark:border-white/[0.06]">
|
|
<div class="nav-section hidden xl:block">Backup</div>
|
|
<a class="menu-item" data-page-only {{ wireNavigate() }} href="{{ route($routes['back'], $backParameters) }}">
|
|
<x-reicon name="logout" class="menu-item-icon rotate-180" />
|
|
<span class="menu-item-label">{{ $backLabel }}</span>
|
|
</a>
|
|
|
|
@foreach ($items as $item)
|
|
@if ($item['key'] === 'danger')
|
|
<div class="col-span-full my-2 hidden border-t border-neutral-200 xl:block dark:border-white/[0.06]" aria-hidden="true"></div>
|
|
@endif
|
|
<a @class([
|
|
'menu-item',
|
|
'menu-item-active' => $section === $item['key'],
|
|
])
|
|
{{ wireNavigate() }} href="{{ route($routes[$item['key']], $parameters) }}">
|
|
<x-reicon :name="$item['icon']" class="menu-item-icon" />
|
|
<span class="menu-item-label">{{ $item['label'] }}</span>
|
|
</a>
|
|
@endforeach
|
|
</nav>
|
|
</x-main-nav-menu>
|