mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-16 09:42:29 -04: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
131 lines
6.0 KiB
PHP
131 lines
6.0 KiB
PHP
@props([
|
|
'sidebar' => false,
|
|
])
|
|
|
|
@php
|
|
$user = auth()->user();
|
|
$userName = $user?->name ?? 'Account';
|
|
$userEmail = $user?->email ?? '';
|
|
$userInitial = strtoupper(mb_substr($user?->name ?: ($user?->email ?: 'A'), 0, 1));
|
|
@endphp
|
|
<div @class(['relative', 'min-w-0 flex-1' => $sidebar]) x-data="{
|
|
open: false,
|
|
appearanceOpen: false,
|
|
avatarUrl: @js($user?->avatar_path ? profile_avatar_url($user) : null),
|
|
openPanel() {
|
|
this.appearanceOpen = false;
|
|
this.open = true;
|
|
},
|
|
closePanel() {
|
|
this.open = false;
|
|
},
|
|
}" @avatar-updated.window="avatarUrl = $event.detail.url" @keydown.escape.window="closePanel()"
|
|
@click.outside="closePanel()">
|
|
<button type="button" x-ref="userMenuButton" @click="open ? closePanel() : openPanel()"
|
|
title="{{ $userName }}" aria-label="Account menu for {{ $userName }}"
|
|
@if ($sidebar) :class="collapsed ? 'w-8 px-0' : 'w-full'" @endif
|
|
@class([
|
|
'button rounded-lg px-2 normal-case',
|
|
'min-w-0' => $sidebar,
|
|
])>
|
|
<img x-cloak x-show="avatarUrl" :src="avatarUrl" alt="{{ $userName }}"
|
|
class="size-5 shrink-0 rounded-full object-cover">
|
|
<span x-show="!avatarUrl"
|
|
class="flex size-5 shrink-0 items-center justify-center rounded-full bg-neutral-200 text-[11px] font-semibold text-neutral-700 dark:bg-white/[0.1] dark:text-fg">
|
|
{{ $userInitial }}
|
|
</span>
|
|
@if ($sidebar)
|
|
<span class="min-w-0 flex-1 truncate text-left text-xs font-medium" :class="collapsed && 'hidden'">{{ $userName }}</span>
|
|
@endif
|
|
<svg class="size-3.5 shrink-0 text-neutral-400 dark:text-fg-faint transition-transform"
|
|
:class="[open && 'rotate-180', {{ $sidebar ? "collapsed && 'hidden'" : 'false' }}]"
|
|
viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
<path d="M6 9l6 6 6-6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
</svg>
|
|
</button>
|
|
|
|
{{-- In the sidebar the panel is fixed to the button, so the scrolling sidebar does not clip it. --}}
|
|
<div x-show="open" x-cloak
|
|
@if ($sidebar) x-anchor.top-start.fixed.offset.4="$refs.userMenuButton" @endif
|
|
x-transition:enter="transition ease-out duration-150"
|
|
x-transition:enter-start="opacity-0 scale-95" x-transition:enter-end="opacity-100 scale-100"
|
|
x-transition:leave="transition ease-in duration-100"
|
|
x-transition:leave-start="opacity-100 scale-100" x-transition:leave-end="opacity-0 scale-95"
|
|
@class([
|
|
'top-user-menu-panel listbox-panel z-[90]! max-h-none! w-52! min-w-0! overflow-visible!',
|
|
'right-0! left-auto!' => ! $sidebar,
|
|
'origin-bottom-left' => $sidebar,
|
|
'origin-top-right' => ! $sidebar,
|
|
])>
|
|
<div class="min-w-0 px-2 py-1.5">
|
|
<div class="truncate text-[13px] font-semibold text-black dark:text-fg">{{ $userName }}</div>
|
|
<div class="truncate text-[11px] text-neutral-500 dark:text-fg-faint">{{ $userEmail }}</div>
|
|
</div>
|
|
<div class="my-1 h-px bg-neutral-200 dark:bg-white/[0.07]"></div>
|
|
|
|
<a href="{{ route('profile') }}" {{ wireNavigate() }} class="listbox-option">
|
|
<span class="flex items-center gap-2">
|
|
<x-reicon name="profile" class="size-4 opacity-80" />
|
|
Profile
|
|
</span>
|
|
</a>
|
|
<button type="button" class="listbox-option w-full" @click="appearanceOpen = !appearanceOpen"
|
|
:aria-expanded="appearanceOpen">
|
|
<span class="flex items-center gap-2">
|
|
<x-reicon name="settings" class="size-4 opacity-80" />
|
|
Appearance
|
|
</span>
|
|
<svg class="size-3.5 text-neutral-400 transition-transform dark:text-fg-faint"
|
|
:class="appearanceOpen && 'rotate-180'" viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
<path d="M6 9l6 6 6-6" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
|
stroke-linejoin="round" />
|
|
</svg>
|
|
</button>
|
|
<div x-show="appearanceOpen" x-collapse.duration.200ms class="mx-1 pb-1 pl-6">
|
|
<x-theme-controls variant="menu" />
|
|
</div>
|
|
|
|
<div class="my-1 h-px bg-neutral-200 dark:bg-white/[0.07]"></div>
|
|
|
|
<livewire:settings-dropdown trigger="account-menu" />
|
|
<a href="https://coolify.io/docs" target="_blank" rel="noopener noreferrer" class="listbox-option">
|
|
<span class="flex items-center gap-2">
|
|
<x-reicon name="documentation" class="size-4 opacity-80" />
|
|
Documentation
|
|
</span>
|
|
</a>
|
|
<x-modal-input title="How can we help?">
|
|
<x-slot:content>
|
|
<div class="listbox-option cursor-pointer" @click="closePanel()">
|
|
<span class="flex items-center gap-2">
|
|
<x-reicon name="feedback" class="size-4 opacity-80" />
|
|
Feedback
|
|
</span>
|
|
</div>
|
|
</x-slot:content>
|
|
<livewire:help />
|
|
</x-modal-input>
|
|
@if (isSubscribed() || !isCloud())
|
|
<a href="https://coolify.io/sponsorships" target="_blank" rel="noopener noreferrer"
|
|
class="listbox-option">
|
|
<span class="flex items-center gap-2">
|
|
<x-reicon name="sponsor" class="size-4 text-pink-500" />
|
|
Sponsor us
|
|
</span>
|
|
</a>
|
|
@endif
|
|
|
|
<div class="my-1 h-px bg-neutral-200 dark:bg-white/[0.07]"></div>
|
|
|
|
<form action="/logout" method="POST">
|
|
@csrf
|
|
<button type="submit" class="listbox-option w-full text-left text-error dark:text-error">
|
|
<span class="flex items-center gap-2">
|
|
<x-reicon name="logout" class="size-4 opacity-90" />
|
|
Log out
|
|
</span>
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|