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