fix(Status): conditionally check proxy status and refresh button based on force_stop state

This commit is contained in:
Andras Bacsai
2025-04-05 14:41:34 +02:00
parent 3176106222
commit 68c2c7fb81
2 changed files with 4 additions and 5 deletions

View File

@@ -34,9 +34,6 @@ class Status extends Component
public function checkProxy(bool $notification = false) public function checkProxy(bool $notification = false)
{ {
try { try {
if ($this->server->proxy->force_stop) {
return;
}
if ($this->polling) { if ($this->polling) {
if ($this->numberOfPolls >= 10) { if ($this->numberOfPolls >= 10) {
$this->polling = false; $this->polling = false;

View File

@@ -1,5 +1,7 @@
<div x-init="$wire.checkProxy()" class="flex gap-2"> <div @if (data_get($server, 'proxy.force_stop', false) === false) x-init="$wire.checkProxy()" @endif class="flex gap-2">
@if (data_get($server, 'proxy.force_stop', false) === false)
<x-forms.button wire:click='checkProxy(true)' :showLoadingIndicator="false">Refresh</x-forms.button> <x-forms.button wire:click='checkProxy(true)' :showLoadingIndicator="false">Refresh</x-forms.button>
@endif
@if (data_get($server, 'proxy.status') === 'running') @if (data_get($server, 'proxy.status') === 'running')
<x-status.running status="Proxy Running" /> <x-status.running status="Proxy Running" />
@elseif (data_get($server, 'proxy.status') === 'restarting') @elseif (data_get($server, 'proxy.status') === 'restarting')