fix(server): distinguish proxy restart and update statuses
This commit is contained in:
parent
50913dc409
commit
981163973b
2 changed files with 13 additions and 3 deletions
|
|
@ -6,10 +6,16 @@
|
|||
|
||||
@php
|
||||
$serverReady = $server->isFunctional();
|
||||
$proxyUpdateAvailable = $server->proxySet()
|
||||
&& ($server->hasCurrentTraefikOutdatedInfo() || $server->hasPendingProxyConfiguration());
|
||||
$proxyConfigurationPending = $server->proxySet() && $server->hasPendingProxyConfiguration();
|
||||
$traefikUpdateAvailable = $server->proxySet() && $server->hasCurrentTraefikOutdatedInfo();
|
||||
$proxyUpdateAvailable = $proxyConfigurationPending || $traefikUpdateAvailable;
|
||||
$proxyNeedsAttention = $server->proxySet()
|
||||
&& (! in_array($proxyStatus, ['running'], true) || $proxyUpdateAvailable);
|
||||
$proxyStatusLabel = match (true) {
|
||||
$proxyConfigurationPending => 'Restart required',
|
||||
$traefikUpdateAvailable => 'Update available',
|
||||
default => str($proxyStatus ?: 'unknown')->headline(),
|
||||
};
|
||||
$sentinelNeedsAttention = $showSentinelStatus && ! $server->isSentinelLive();
|
||||
|
||||
[$summaryLabel, $summaryType] = match (true) {
|
||||
|
|
@ -66,7 +72,7 @@ class="listbox-option gap-2.5!" @click="open = false" role="menuitem">
|
|||
'bg-error' => $proxyNeedsAttention && ! $proxyUpdateAvailable && ! in_array($proxyStatus, ['starting', 'restarting', 'stopping'], true),
|
||||
])></span>
|
||||
<span class="flex-1">Proxy</span>
|
||||
<span>{{ str($proxyStatus ?: 'unknown')->headline() }}</span>
|
||||
<span>{{ $proxyStatusLabel }}</span>
|
||||
</a>
|
||||
@endif
|
||||
@if ($showSentinelStatus)
|
||||
|
|
|
|||
|
|
@ -39,6 +39,10 @@
|
|||
|
||||
expect($summary)
|
||||
->toContain('$server->hasCurrentTraefikOutdatedInfo()')
|
||||
->toContain('$proxyStatusLabel = match (true)')
|
||||
->toContain("\$proxyConfigurationPending => 'Restart required'")
|
||||
->toContain("\$traefikUpdateAvailable => 'Update available'")
|
||||
->toContain('{{ $proxyStatusLabel }}')
|
||||
->toContain("'bg-warning' => \$proxyNeedsAttention && (\$proxyUpdateAvailable")
|
||||
->toContain("'bg-warning' => \$sentinelNeedsAttention")
|
||||
->not->toContain("\$server->isSentinelLive() ? 'bg-success' : 'bg-error'");
|
||||
|
|
|
|||
Loading…
Reference in a new issue