Refactor Proxmox server views for improved layout and styling

- Updated server card component to use a more compact layout with adjusted spacing and styling.
- Enhanced server status display with improved icon sizes and colors.
- Modified quick info row to use smaller text and adjusted labels for clarity.
- Refined server configuration grid for better alignment and spacing.
- Updated modal z-index values for consistent layering across various modals in statistics, storage, subdomain, and system views.
- General styling improvements for better readability and user experience.
This commit is contained in:
2025-12-17 14:36:53 -05:00
parent 7794570770
commit a90aba582d
13 changed files with 517 additions and 865 deletions

View File

@@ -1,11 +1,11 @@
{{-- Server Card Component - TailServer Theme (shadcn-inspired) --}}
<div class="space-y-4">
{{-- Server Card Component - Compact Layout --}}
<div class="space-y-2">
@if($status)
<a href="{{ route('proxmox.server.overview', ['server' => $server->id]) }}" wire:navigate>
<div class="flex flex-col rounded-xl border border-neutral/15 bg-card text-card-foreground shadow-sm hover:shadow-md hover:border-neutral/25 transition-shadow duration-150 cursor-pointer">
<div class="flex flex-col rounded-lg border border-gray-200 dark:border-gray-700 bg-card text-card-foreground shadow-sm hover:shadow-md hover:border-gray-300 dark:hover:border-gray-600 transition-shadow duration-150 cursor-pointer">
{{-- Header: Server Name & Status --}}
<div class="flex items-center justify-between px-6 py-4">
<div class="flex items-center gap-3">
<div class="flex items-center justify-between px-4 py-3">
<div class="flex items-center gap-2">
@if($server->user_set_icon)
@php
$iconColor = $server->user_set_icon_color ?? '#6366f1';
@@ -14,39 +14,38 @@
$iconName = $server->user_set_icon;
$componentName = $iconPrefix . '-' . $iconName;
@endphp
<div class="flex items-center justify-center size-9 rounded-lg" style="background-color: {{ $bgColor }};">
<x-dynamic-component :component="$componentName" class="size-4" style="color: {{ $iconColor }};" />
<div class="flex items-center justify-center size-7 rounded" style="background-color: {{ $bgColor }};">
<x-dynamic-component :component="$componentName" class="size-3" style="color: {{ $iconColor }};" />
</div>
@else
<div class="flex items-center justify-center size-9 rounded-lg bg-primary/10">
<x-ri-server-line class="size-4 text-primary" />
<div class="flex items-center justify-center size-7 rounded bg-blue-50 dark:bg-blue-900">
<x-ri-server-line class="size-3 text-primary" />
</div>
@endif
<span class="font-semibold">{{ $status->name }}</span>
<span class="font-semibold text-sm">{{ $status->name }}</span>
</div>
<x-proxmox::ui.server-status :status="$status->status" showLabel />
</div>
{{-- Quick Info Row --}}
<div class="flex flex-row flex-wrap gap-6 px-6 py-3 border-y border-neutral/10">
<div class="flex flex-col min-w-[120px]">
<span class="text-xs font-medium text-muted-foreground uppercase tracking-wide">IPv4 Address</span>
<span class="text-sm mt-0.5">{{ $server->primaryIpv4->ip ?? 'None' }}</span>
<div class="flex flex-row flex-wrap gap-3 px-4 py-2 border-y border-gray-100 dark:border-gray-800 text-xs">
<div class="flex flex-col min-w-[100px]">
<span class="font-medium text-gray-500 dark:text-gray-400 uppercase text-[10px]">IPv4</span>
<span class="text-xs">{{ $server->primaryIpv4->ip ?? 'None' }}</span>
</div>
<div class="flex flex-col min-w-[120px]">
<span class="text-xs font-medium text-muted-foreground uppercase tracking-wide">IPv6 Address</span>
<span class="text-sm mt-0.5">{{ $server->primaryIpv6->ip ?? 'None' }}</span>
<div class="flex flex-col min-w-[100px]">
<span class="font-medium text-gray-500 dark:text-gray-400 uppercase text-[10px]">IPv6</span>
<span class="text-xs">{{ $server->primaryIpv6->ip ?? 'None' }}</span>
</div>
@if($status->status == 'running' && isset($status->uptime))
<div class="flex flex-col min-w-[100px]">
<span class="text-xs font-medium text-muted-foreground uppercase tracking-wide">Uptime</span>
<span class="text-sm mt-0.5">
<div class="flex flex-col min-w-[70px]">
<span class="font-medium text-gray-500 dark:text-gray-400 uppercase text-[10px]">Uptime</span>
<span class="text-xs">
@php
$uptime = $status->uptime;
$days = floor($uptime / 86400);
$hours = floor(($uptime % 86400) / 3600);
$minutes = floor(($uptime % 3600) / 60);
$uptimeStr = '';
if ($days > 0) $uptimeStr .= $days . 'd ';
if ($hours > 0 || $days > 0) $uptimeStr .= $hours . 'h ';
@@ -56,78 +55,57 @@
</span>
</div>
@endif
<div class="hidden sm:flex flex-col min-w-[100px]">
<span class="text-xs font-medium text-muted-foreground uppercase tracking-wide">Memory</span>
<span class="text-sm mt-0.5">
@if($status->status == 'running')
{{ Illuminate\Support\Number::fileSize(bytes: $status->mem) }}/
@endif
{{ Illuminate\Support\Number::fileSize(bytes: $status->maxmem) }}
<div class="hidden sm:flex flex-col min-w-[80px]">
<span class="font-medium text-gray-500 dark:text-gray-400 uppercase text-[10px]">Memory</span>
<span class="text-xs">
@if($status->status == 'running'){{ Illuminate\Support\Number::fileSize(bytes: $status->mem) }}/@endif{{ Illuminate\Support\Number::fileSize(bytes: $status->maxmem) }}
</span>
</div>
<div class="hidden sm:flex flex-col min-w-[80px]">
<span class="text-xs font-medium text-muted-foreground uppercase tracking-wide">Disk</span>
<span class="text-sm mt-0.5">{{ Illuminate\Support\Number::fileSize(bytes: $status->maxdisk) }}</span>
<div class="hidden sm:flex flex-col min-w-[60px]">
<span class="font-medium text-gray-500 dark:text-gray-400 uppercase text-[10px]">Disk</span>
<span class="text-xs">{{ Illuminate\Support\Number::fileSize(bytes: $status->maxdisk) }}</span>
</div>
@if($status->status == 'running')
<div class="hidden sm:flex flex-col min-w-[60px]">
<span class="text-xs font-medium text-muted-foreground uppercase tracking-wide">CPU</span>
<span class="text-sm mt-0.5">{{ round($status->cpu * 100, 2) }}%</span>
<div class="hidden sm:flex flex-col min-w-[50px]">
<span class="font-medium text-gray-500 dark:text-gray-400 uppercase text-[10px]">CPU</span>
<span class="text-xs">{{ round($status->cpu * 100, 1) }}%</span>
</div>
@endif
</div>
{{-- Server Configuration Grid --}}
<div class="px-6 py-4">
<div class="text-xs font-medium text-muted-foreground uppercase tracking-wide mb-3">Server Configuration</div>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
<x-proxmox::ui.stat-card
label="CPU Cores"
:value="($status->cpus ?? 'N/A') . ' ' . (($status->cpus ?? 0) > 1 ? 'Cores' : 'Core')"
icon="ri-cpu-line"
/>
<x-proxmox::ui.stat-card
label="RAM Allocation"
:value="round(($status->maxmem ?? 0) / (1024 * 1024 * 1024), 2) . ' GiB'"
icon="ri-ram-line"
/>
<x-proxmox::ui.stat-card
label="Disk Capacity"
:value="Illuminate\Support\Number::fileSize(bytes: $status->maxdisk ?? 0)"
icon="ri-hard-drive-2-line"
/>
<div class="flex flex-col gap-6 rounded-xl border border-neutral/15 bg-card py-6 text-card-foreground shadow-sm">
<div class="flex flex-row items-center justify-between space-y-0 px-6 pb-2">
<h3 class="text-sm font-medium text-muted-foreground">Bandwidth</h3>
<x-ri-speed-line class="size-4 text-muted-foreground" />
</div>
<div class="px-6">
<div class="text-xl font-bold">{{ $this->monthlyTraffic }} GiB</div>
<p class="text-xs text-muted-foreground mt-1">
of {{ $this->bandwidthThreshold95 }} GiB (95% threshold)
</p>
<div class="px-4 py-3">
<div class="text-[10px] font-medium text-gray-500 dark:text-gray-400 uppercase mb-2">Configuration</div>
<div class="grid grid-cols-2 sm:grid-cols-4 gap-2">
<x-proxmox::ui.stat-card label="CPU" :value="($status->cpus ?? 'N/A') . ' Core' . (($status->cpus ?? 0) > 1 ? 's' : '')" icon="ri-cpu-line" />
<x-proxmox::ui.stat-card label="RAM" :value="round(($status->maxmem ?? 0) / (1024 * 1024 * 1024), 1) . ' GiB'" icon="ri-ram-line" />
<x-proxmox::ui.stat-card label="Disk" :value="Illuminate\Support\Number::fileSize(bytes: $status->maxdisk ?? 0)" icon="ri-hard-drive-2-line" />
<div class="flex flex-col gap-2 rounded border border-gray-200 dark:border-gray-700 bg-card p-3 text-card-foreground">
<div class="flex items-center justify-between">
<span class="text-xs font-medium text-gray-500 dark:text-gray-400">Bandwidth</span>
<x-ri-speed-line class="size-3 text-gray-400" />
</div>
<div class="text-sm font-bold">{{ $this->monthlyTraffic }} GiB</div>
<p class="text-[10px] text-gray-500 dark:text-gray-400">of {{ $this->bandwidthThreshold95 }} GiB (95%)</p>
</div>
</div>
</div>
</div>
</a>
@else
{{-- Error State: Status unavailable --}}
{{-- Error State --}}
<a href="{{ route('proxmox.server.overview', ['server' => $server->id]) }}" wire:navigate>
<div class="flex flex-col rounded-xl border border-danger/20 bg-card text-card-foreground shadow-sm hover:shadow-md hover:border-danger/30 transition-shadow duration-150 cursor-pointer">
<div class="flex items-center justify-between px-6 py-4">
<div class="flex items-center gap-3">
<div class="flex items-center justify-center size-9 rounded-lg bg-danger/10">
<x-ri-server-line class="size-4 text-danger" />
<div class="flex flex-col rounded-lg border border-red-200 dark:border-red-800 bg-card text-card-foreground shadow-sm hover:shadow-md hover:border-red-300 dark:hover:border-red-700 transition-shadow duration-150 cursor-pointer">
<div class="flex items-center justify-between px-4 py-3">
<div class="flex items-center gap-2">
<div class="flex items-center justify-center size-7 rounded bg-red-50 dark:bg-red-900">
<x-ri-server-line class="size-3 text-danger" />
</div>
<span class="font-semibold">{{ $server->hostname ?? 'Server #' . $server->id }}</span>
<span class="font-semibold text-sm">{{ $server->hostname ?? 'Server #' . $server->id }}</span>
</div>
<x-proxmox::ui.badge variant="danger" icon="ri-error-warning-fill">
Unavailable
</x-proxmox::ui.badge>
<x-proxmox::ui.badge variant="danger" icon="ri-error-warning-fill">Unavailable</x-proxmox::ui.badge>
</div>
<p class="text-sm text-muted-foreground px-6 pb-4">Unable to retrieve server status. Click to view details or try again.</p>
<p class="text-xs text-gray-500 dark:text-gray-400 px-4 pb-3">Unable to retrieve server status.</p>
</div>
</a>
@endif