mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-20 12:23:48 +00:00
Move internal hostname loading and breadcrumb status into dedicated Livewire components with live refresh. Merge public/internal access into one Access section, bind Enter to save on the unsaved bar, and drop x-teleport wrappers from popup and global search.
42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Livewire\Project\Application;
|
|
|
|
use App\Models\Application;
|
|
use Illuminate\Contracts\View\View;
|
|
use Livewire\Component;
|
|
|
|
class InternalAccess extends Component
|
|
{
|
|
public Application $application;
|
|
|
|
public ?string $currentInternalHostname = null;
|
|
|
|
public bool $currentInternalHostnameLoaded = false;
|
|
|
|
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');
|
|
}
|
|
}
|