fix(cloudflare): update refresh method to correctly set Cloudflare tunnel status and improve user notification on IP address update
This commit is contained in:
@@ -31,7 +31,8 @@ class CloudflareTunnel extends Component
|
|||||||
|
|
||||||
public function refresh()
|
public function refresh()
|
||||||
{
|
{
|
||||||
$this->mount($this->server->uuid);
|
$this->server->refresh();
|
||||||
|
$this->isCloudflareTunnelsEnabled = $this->server->settings->is_cloudflare_tunnel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function mount(string $server_uuid)
|
public function mount(string $server_uuid)
|
||||||
@@ -58,7 +59,7 @@ class CloudflareTunnel extends Component
|
|||||||
$this->server->update(['ip' => $this->server->ip_previous]);
|
$this->server->update(['ip' => $this->server->ip_previous]);
|
||||||
$this->dispatch('success', 'Cloudflare Tunnel disabled.<br><br>Manually updated the server IP address to its previous IP address.');
|
$this->dispatch('success', 'Cloudflare Tunnel disabled.<br><br>Manually updated the server IP address to its previous IP address.');
|
||||||
} else {
|
} else {
|
||||||
$this->dispatch('success', 'Cloudflare Tunnel disabled. Please update the server IP address to its real IP address in the server settings.');
|
$this->dispatch('warning', 'Cloudflare Tunnel disabled. Action required: Update the server IP address to its real IP address in the Advanced settings.');
|
||||||
}
|
}
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
|
|||||||
Reference in New Issue
Block a user