Private
Public Access
1
0

feat: enhance VM status loading with retry logic and improved error handling

This commit is contained in:
2025-12-24 09:54:17 -05:00
parent bc340c83f0
commit 892961d28c
5 changed files with 134 additions and 15 deletions

View File

@@ -1,4 +1,36 @@
<div class="space-y-4">
@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">
<div class="flex items-center justify-between mb-2">
<div class="flex items-center gap-3">
<div class="bg-secondary/10 p-2 rounded-lg flex-shrink-0">
<x-ri-server-line class="size-5 text-secondary" />
</div>
<span class="font-medium">{{ $server->service->product->name ?? 'Server' }}</span>
</div>
<div class="flex items-center gap-2 px-3 py-1.5 rounded-lg flex-shrink-0 text-warning bg-warning/20">
<div class="size-5">
<x-ri-loader-4-line class="animate-spin" />
</div>
<span class="text-sm font-medium">Loading...</span>
</div>
</div>
<div class="flex flex-row flex-wrap gap-4 mt-4">
<div class="flex flex-col">
<span class="text-xs text-base/50">IPv4 Address</span>
<span class="text-base">{{ $server->primaryIpv4->ip ?? 'None' }}</span>
</div>
<div class="flex flex-col">
<span class="text-xs text-base/50">IPv6 Address</span>
<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>
</div>
@else
<a href="{{ route('proxmox.server.overview', ['server' => $server->id]) }}" wire:navigate>
<div class="bg-background-secondary hover:bg-background-secondary/80 border border-neutral p-4 rounded-lg mb-4">
@@ -169,4 +201,5 @@
</div>
</div>
</a>
@endif
</div>