rector: arrrrr

This commit is contained in:
Andras Bacsai
2025-01-07 14:52:08 +01:00
parent c702ebff6d
commit 16c0cd10d8
349 changed files with 4204 additions and 3712 deletions

View File

@@ -7,6 +7,7 @@ use App\Actions\Proxy\CheckProxy;
use App\Actions\Proxy\StartProxy;
use App\Models\Server;
use Livewire\Component;
use Throwable;
class Status extends Component
{
@@ -38,9 +39,11 @@ class Status extends Component
if ($this->numberOfPolls >= 10) {
$this->polling = false;
$this->numberOfPolls = 0;
$notification && $this->dispatch('error', 'Proxy is not running.');
if ($notification) {
$this->dispatch('error', 'Proxy is not running.');
}
return;
return null;
}
$this->numberOfPolls++;
}
@@ -51,17 +54,25 @@ class Status extends Component
$this->dispatch('proxyStatusUpdated');
if ($this->server->proxy->status === 'running') {
$this->polling = false;
$notification && $this->dispatch('success', 'Proxy is running.');
} elseif ($this->server->proxy->status === 'exited' and ! $this->server->proxy->force_stop) {
$notification && $this->dispatch('error', 'Proxy has exited.');
if ($notification) {
$this->dispatch('success', 'Proxy is running.');
}
} elseif ($this->server->proxy->status === 'exited' && ! $this->server->proxy->force_stop) {
if ($notification) {
$this->dispatch('error', 'Proxy has exited.');
}
} elseif ($this->server->proxy->force_stop) {
$notification && $this->dispatch('error', 'Proxy is stopped manually.');
} else {
$notification && $this->dispatch('error', 'Proxy is not running.');
if ($notification) {
$this->dispatch('error', 'Proxy is stopped manually.');
}
} elseif ($notification) {
$this->dispatch('error', 'Proxy is not running.');
}
} catch (\Throwable $e) {
} catch (Throwable $e) {
return handleError($e, $this);
}
return null;
}
public function getProxyStatus()
@@ -70,8 +81,10 @@ class Status extends Component
GetContainersStatus::run($this->server);
// dispatch_sync(new ContainerStatusJob($this->server));
$this->dispatch('proxyStatusUpdated');
} catch (\Throwable $e) {
} catch (Throwable $e) {
return handleError($e, $this);
}
return null;
}
}