Files
coolify/app/Livewire/DeploymentsIndicator.php
T
Andras Bacsai 0393d4e931 fix(ui): move deployments indicator into the sidebar
The floating bottom-left pill and its expanded list covered page content.

- Desktop: show a compact 'N deployments' row in the sticky sidebar footer
  (spinner with count badge when the sidebar is collapsed); the list opens
  to the right of the sidebar
- Mobile: show a spinner with the count in the top bar; the list opens
  below the top bar
- Poll only the copy visible at the current breakpoint (wire:poll.visible)
- Show the indicator on the dashboard too, and drop the path-based
  visibility logic and its navigate round trip
2026-09-29 09:58:54 +02:00

49 lines
1.2 KiB
PHP

<?php
namespace App\Livewire;
use App\Models\ApplicationDeploymentQueue;
use App\Models\Server;
use Livewire\Attributes\Computed;
use Livewire\Component;
class DeploymentsIndicator extends Component
{
/**
* Where the indicator is rendered: 'sidebar' (desktop sidebar footer) or 'mobile' (mobile top bar).
*/
public string $variant = 'sidebar';
#[Computed]
public function deployments()
{
$servers = Server::ownedByCurrentTeamCached();
return ApplicationDeploymentQueue::with(['application.environment.project'])
->whereIn('status', ['in_progress', 'queued'])
->whereIn('server_id', $servers->pluck('id'))
->orderBy('id')
->get([
'id',
'application_id',
'application_name',
'deployment_url',
'pull_request_id',
'server_name',
'server_id',
'status',
]);
}
#[Computed]
public function deploymentCount()
{
return $this->deployments->count();
}
public function render()
{
return view('livewire.deployments-indicator');
}
}