Files
coolify/app/Livewire/Project/Application/InternalAccess.php
T
Andras Bacsai 16b092336e feat(sentinel): track synchronization state and refresh status UI
Add sentinel waiting-state tracking, synchronization broadcasts, and restore
status handling across server and application interfaces.
2026-09-16 12:51:27 +02:00

51 lines
1.3 KiB
PHP

<?php
namespace App\Livewire\Project\Application;
use App\Models\Application;
use Illuminate\Contracts\View\View;
use Livewire\Component;
class InternalAccess extends Component
{
protected $listeners = [
'applicationNetworkingUpdated' => 'refreshApplicationNetworking',
];
public Application $application;
public ?string $currentInternalHostname = null;
public bool $currentInternalHostnameLoaded = false;
public function refreshApplicationNetworking(): void
{
$this->application->refresh();
}
public function loadCurrentInternalHostname(): void
{
try {
$containers = getCurrentApplicationContainerStatus(
$this->application->destination->server,
$this->application->id,
0
);
$currentContainer = $containers->first(
fn ($container) => data_get($container, 'State') === 'running'
) ?? $containers->first();
$this->currentInternalHostname = data_get($currentContainer, 'Names');
} catch (\Throwable) {
$this->currentInternalHostname = null;
} finally {
$this->currentInternalHostnameLoaded = true;
}
}
public function render(): View
{
return view('livewire.project.application.internal-access');
}
}