coolify/app/Livewire/Server/Proxy/Show.php

34 lines
844 B
PHP
Raw Normal View History

2023-10-09 11:00:18 +02:00
<?php
2023-12-07 19:06:32 +01:00
namespace App\Livewire\Server\Proxy;
2023-10-09 11:00:18 +02:00
use App\Models\Server;
use Livewire\Component;
class Show extends Component
{
public ?Server $server = null;
public $parameters = [];
2023-10-11 11:00:40 +02:00
protected $listeners = ['proxyStatusUpdated'];
public function proxyStatusUpdated()
{
$this->server->refresh();
}
2023-10-09 11:00:18 +02:00
public function mount()
{
$this->parameters = get_route_parameters();
try {
$this->server = Server::ownedByCurrentTeam(['name', 'proxy'])->whereUuid(request()->server_uuid)->first();
if (is_null($this->server)) {
return redirect()->route('server.all');
}
} catch (\Throwable $e) {
return handleError($e, $this);
}
}
public function render()
{
return view('livewire.server.proxy.show');
}
}