fix: server validation

This commit is contained in:
Andras Bacsai 2024-02-22 14:46:11 +01:00
parent 836458ad85
commit 592221b4bf
3 changed files with 14 additions and 12 deletions

View File

@ -11,7 +11,7 @@ class ValidateAndInstall extends Component
{
public Server $server;
public int $number_of_tries = 0;
public int $max_tries = 2;
public int $max_tries = 1;
public bool $install = true;
public $uptime = null;
public $supported_os_type = null;
@ -99,7 +99,7 @@ public function validateDockerEngine()
$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>.';
return;
} else {
if ($this->number_of_tries == 0 ) {
if ($this->number_of_tries == 0) {
$activity = $this->server->installDocker();
$this->number_of_tries++;
$this->dispatch('newActivityMonitor', $activity->id, 'init');

View File

@ -469,7 +469,7 @@ public function validateDockerEngine($throwError = false)
return false;
}
try {
$dockerRunning = instant_remote_process(["docker version"], $this);
instant_remote_process(["docker version"], $this);
} catch (\Throwable $e) {
$this->settings->is_usable = false;
$this->settings->save();

View File

@ -10,15 +10,17 @@
</x-new-modal>
@else
<x-forms.button type="submit">Save</x-forms.button>
<x-slide-over closeWithX fullScreen>
<x-slot:title>Validate & configure</x-slot:title>
<x-slot:content>
<livewire:server.validate-and-install :server="$server" ask />
</x-slot:content>
<x-forms.button @click="slideOverOpen=true" wire:click.prevent='validateServer' isHighlighted>
Revalidate server
</x-forms.button>
</x-slide-over>
@if ($server->isFunctional())
<x-slide-over closeWithX fullScreen>
<x-slot:title>Validate & configure</x-slot:title>
<x-slot:content>
<livewire:server.validate-and-install :server="$server" ask />
</x-slot:content>
<x-forms.button @click="slideOverOpen=true" wire:click.prevent='validateServer' isHighlighted>
Revalidate server
</x-forms.button>
</x-slide-over>
@endif
@endif
</div>
@if ($server->isFunctional())