Files
coolify/app/Livewire/DeploymentsIndicator.php
T
Andras BacsaiandClaude Opus 5.5 a82d32c946 chore: merge main into release/v4.5
Resolve conflicts between main's security fixes and v4.5 features:
- Keep v4.5 features (log redaction, multi-S3 backups, transfer flow,
  scheduled task modal, sidebar) and port main's fixes into them.
- Reuse RequiresDeployAbility for the Hostinger create endpoint.
- Align MCP tool abilities and descriptions with main's new deploy
  requirements, and use deploy tokens in the affected MCP tests.
- Drop the duplicate DockerCleanupJobTest helper and tests, and the
  exportBundle test for a method v4.5 removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:00:05 +02:00

68 lines
1.8 KiB
PHP

<?php
namespace App\Livewire;
use App\Models\ApplicationDeploymentQueue;
use Livewire\Attributes\Computed;
use Livewire\Attributes\Locked;
use Livewire\Component;
class DeploymentsIndicator extends Component
{
/**
* Where the indicator is rendered: 'topbar' (desktop top bar) or 'mobile' (mobile top bar).
*/
public string $variant = 'topbar';
/**
* The application on the current page. Its heading has its own "Deploying…" indicator.
*/
#[Locked]
public ?string $currentApplicationUuid = null;
public function mount(): void
{
$this->currentApplicationUuid = request()->route('application_uuid');
}
#[Computed]
public function deployments()
{
return ApplicationDeploymentQueue::with(['application.environment.project'])
->ownedByTeam(currentTeam()->id)
->whereIn('status', ['in_progress', 'queued'])
->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();
}
/**
* Hide the counter when it would only repeat the current page's "Deploying…" indicator.
*/
#[Computed]
public function isOnlyCurrentApplicationDeploying(): bool
{
return $this->currentApplicationUuid !== null
&& $this->deployments->every(fn ($deployment) => $deployment->application?->uuid === $this->currentApplicationUuid);
}
public function render()
{
return view('livewire.deployments-indicator');
}
}