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;
|
2023-07-14 11:01:55 +00:00
|
|
|
protected $listeners = ['proxyStatusUpdated'];
|
2023-06-02 13:15:12 +00:00
|
|
|
public function proxyStatusUpdated()
|
|
|
|
{
|
|
|
|
$this->server->refresh();
|
|
|
|
}
|
2023-07-28 12:44:26 +00:00
|
|
|
public function get_status()
|
2023-06-02 13:15:12 +00:00
|
|
|
{
|
|
|
|
try {
|
2023-07-14 11:01:55 +00:00
|
|
|
dispatch_sync(new ProxyContainerStatusJob(
|
2023-06-02 13:15:12 +00:00
|
|
|
server: $this->server
|
|
|
|
));
|
|
|
|
$this->emit('proxyStatusUpdated');
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
ray($e->getMessage());
|
|
|
|
}
|
|
|
|
}
|
2023-07-28 12:44:26 +00:00
|
|
|
}
|