fix: improve server list reliability with async retry polling instead of blocking usleep
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<div class="space-y-4">
|
||||
<div class="space-y-4" @if(!$status && $loadAttempts < 3) wire:poll.500ms="autoRetryLoadStatus" @endif>
|
||||
@if(!$status)
|
||||
{{-- Show loading placeholder if status is not yet loaded --}}
|
||||
<div class="bg-background-secondary border border-neutral p-4 rounded-lg mb-4 flex flex-col">
|
||||
@@ -13,7 +13,13 @@
|
||||
<div class="size-5">
|
||||
<x-ri-loader-4-line class="animate-spin" />
|
||||
</div>
|
||||
<span class="text-sm font-medium">Loading...</span>
|
||||
<span class="text-sm font-medium">
|
||||
@if($loadAttempts < 3)
|
||||
Loading... ({{ $loadAttempts }}/3)
|
||||
@else
|
||||
Failed to load
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-row flex-wrap gap-4 mt-4">
|
||||
@@ -26,9 +32,11 @@
|
||||
<span class="text-base">{{ $server->primaryIpv6->ip ?? 'None' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4 pt-4 border-t border-neutral">
|
||||
<div class="text-sm text-base/50">Unable to fetch server status from Proxmox. <button wire:click="retryLoadStatus" class="text-primary hover:underline">Retry</button></div>
|
||||
</div>
|
||||
@if($loadAttempts >= 3)
|
||||
<div class="mt-4 pt-4 border-t border-neutral">
|
||||
<div class="text-sm text-base/50">Unable to fetch server status from Proxmox. <button wire:click="retryLoadStatus" class="text-primary hover:underline">Retry</button></div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@else
|
||||
<a href="{{ route('proxmox.server.overview', ['server' => $server->id]) }}" wire:navigate>
|
||||
|
||||
Reference in New Issue
Block a user