lasthourcloud/app/Http/Livewire/Server/Proxy/Status.php

29 lines
631 B
PHP
Raw Normal View History

2023-06-02 13:15:12 +00:00
<?php
namespace App\Http\Livewire\Server\Proxy;
use App\Jobs\ProxyContainerStatusJob;
use App\Models\Server;
use Livewire\Component;
class Status extends Component
{
public Server $server;
protected $listeners = ['proxyStatusUpdated'];
2023-06-02 13:15:12 +00:00
public function proxyStatusUpdated()
{
$this->server->refresh();
}
public function proxyStatus()
{
try {
dispatch_sync(new ProxyContainerStatusJob(
2023-06-02 13:15:12 +00:00
server: $this->server
));
$this->emit('proxyStatusUpdated');
} catch (\Exception $e) {
ray($e->getMessage());
}
}
}