save
This commit is contained in:
29
app/Http/Livewire/Server/Proxy/Status.php
Normal file
29
app/Http/Livewire/Server/Proxy/Status.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?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', 'serverValidated' => 'proxyStatusUpdated'];
|
||||
public function proxyStatusUpdated()
|
||||
{
|
||||
ray('Status: ' . $this->server->extra_attributes->proxy_status);
|
||||
$this->server->refresh();
|
||||
}
|
||||
public function proxyStatus()
|
||||
{
|
||||
try {
|
||||
dispatch(new ProxyContainerStatusJob(
|
||||
server: $this->server
|
||||
));
|
||||
$this->emit('proxyStatusUpdated');
|
||||
} catch (\Exception $e) {
|
||||
ray($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user