fix: check localhost connection
This commit is contained in:
@@ -61,7 +61,18 @@ class Form extends Component
|
||||
$activity = InstallDocker::run($this->server);
|
||||
$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)
|
||||
{
|
||||
try {
|
||||
@@ -69,7 +80,7 @@ class Form extends Component
|
||||
if ($uptime) {
|
||||
$install && $this->emit('success', 'Server is reachable.');
|
||||
} 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;
|
||||
}
|
||||
$dockerInstalled = $this->server->validateDockerEngine();
|
||||
|
||||
Reference in New Issue
Block a user