fix: check localhost connection
This commit is contained in:
parent
6ca1d36d5d
commit
9535c8df29
@ -61,7 +61,18 @@ class Form extends Component
|
|||||||
$activity = InstallDocker::run($this->server);
|
$activity = InstallDocker::run($this->server);
|
||||||
$this->emit('newMonitorActivity', $activity->id);
|
$this->emit('newMonitorActivity', $activity->id);
|
||||||
}
|
}
|
||||||
|
public function checkLocalhostConnection() {
|
||||||
|
$uptime = $this->server->validateConnection();
|
||||||
|
if ($uptime) {
|
||||||
|
$this->emit('success', 'Server is reachable.');
|
||||||
|
$this->server->settings->is_reachable = true;
|
||||||
|
$this->server->settings->is_usaable = true;
|
||||||
|
$this->server->settings->save();
|
||||||
|
} else {
|
||||||
|
$this->emit('error', 'Server is not reachable. Please check your connection and configuration.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
public function validateServer($install = true)
|
public function validateServer($install = true)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@ -69,7 +80,7 @@ class Form extends Component
|
|||||||
if ($uptime) {
|
if ($uptime) {
|
||||||
$install && $this->emit('success', 'Server is reachable.');
|
$install && $this->emit('success', 'Server is reachable.');
|
||||||
} else {
|
} else {
|
||||||
$install &&$this->emit('error', 'Server is not reachable. Please check your connection and private key configuration.');
|
$install &&$this->emit('error', 'Server is not reachable. Please check your connection and configuration.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$dockerInstalled = $this->server->validateDockerEngine();
|
$dockerInstalled = $this->server->validateDockerEngine();
|
||||||
|
@ -31,6 +31,12 @@
|
|||||||
Validate Server & Install Docker Engine
|
Validate Server & Install Docker Engine
|
||||||
</x-forms.button>
|
</x-forms.button>
|
||||||
@endif
|
@endif
|
||||||
|
@if ($server->id === 0)
|
||||||
|
<x-forms.button class="mt-8 mb-4 font-bold box-without-bg bg-coollabs hover:bg-coollabs-100"
|
||||||
|
wire:click.prevent='checkLocalhostConnection' isHighlighted>
|
||||||
|
Validate Server
|
||||||
|
</x-forms.button>
|
||||||
|
@endif
|
||||||
<div class="flex flex-col gap-2 pt-4">
|
<div class="flex flex-col gap-2 pt-4">
|
||||||
<div class="flex flex-col w-full gap-2 lg:flex-row">
|
<div class="flex flex-col w-full gap-2 lg:flex-row">
|
||||||
<x-forms.input id="server.name" label="Name" required />
|
<x-forms.input id="server.name" label="Name" required />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user