Revert "rector: arrrrr"

This reverts commit 16c0cd10d8.
This commit is contained in:
Andras Bacsai
2025-01-07 15:31:43 +01:00
parent da07b4fdcf
commit 1fe4dd722b
349 changed files with 3689 additions and 4184 deletions

View File

@@ -5,9 +5,7 @@ namespace App\Livewire\Server;
use App\Actions\Proxy\CheckProxy;
use App\Actions\Proxy\StartProxy;
use App\Models\Server;
use Exception;
use Livewire\Component;
use Throwable;
class ValidateAndInstall extends Component
{
@@ -19,19 +17,19 @@ class ValidateAndInstall extends Component
public bool $install = true;
public $uptime;
public $uptime = null;
public $supported_os_type;
public $supported_os_type = null;
public $docker_installed;
public $docker_installed = null;
public $docker_compose_installed;
public $docker_compose_installed = null;
public $docker_version;
public $docker_version = null;
public $proxy_started = false;
public $error;
public $error = null;
public bool $ask = false;
@@ -75,16 +73,14 @@ class ValidateAndInstall extends Component
if ($proxy === 'OK') {
$this->proxy_started = true;
} else {
throw new Exception('Proxy could not be started.');
throw new \Exception('Proxy could not be started.');
}
} else {
$this->proxy_started = true;
}
} catch (Throwable $e) {
} catch (\Throwable $e) {
return handleError($e, $this);
}
return null;
}
public function validateConnection()
@@ -121,28 +117,30 @@ class ValidateAndInstall extends Component
$this->docker_compose_installed = $this->server->validateDockerCompose();
if (! $this->docker_installed || ! $this->docker_compose_installed) {
if ($this->install) {
if ($this->number_of_tries === $this->max_tries) {
if ($this->number_of_tries == $this->max_tries) {
$this->error = 'Docker Engine could not be installed. Please install Docker manually before continuing: <a target="_blank" class="underline" href="https://docs.docker.com/engine/install/#server">documentation</a>.';
$this->server->update([
'validation_logs' => $this->error,
]);
return;
} else {
if ($this->number_of_tries <= $this->max_tries) {
$activity = $this->server->installDocker();
$this->number_of_tries++;
$this->dispatch('newActivityMonitor', $activity->id, 'init', $this->number_of_tries);
}
return;
}
if ($this->number_of_tries <= $this->max_tries) {
$activity = $this->server->installDocker();
$this->number_of_tries++;
$this->dispatch('newActivityMonitor', $activity->id, 'init', $this->number_of_tries);
}
} else {
$this->error = 'Docker Engine is not installed. Please install Docker manually before continuing: <a target="_blank" class="underline" href="https://docs.docker.com/engine/install/#server">documentation</a>.';
$this->server->update([
'validation_logs' => $this->error,
]);
return;
}
$this->error = 'Docker Engine is not installed. Please install Docker manually before continuing: <a target="_blank" class="underline" href="https://docs.docker.com/engine/install/#server">documentation</a>.';
$this->server->update([
'validation_logs' => $this->error,
]);
return;
}
$this->dispatch('validateDockerVersion');
}