Refactor Proxmox views for improved styling and consistency
- Updated subdomain.blade.php to enhance button styles and modal transitions. - Changed text colors for better readability and consistency across the UI. - Refactored system.blade.php to unify button components and improve layout structure. - Adjusted modal z-index values for consistent layering. - Enhanced accessibility by ensuring proper text contrast and hover states.
This commit is contained in:
@@ -1,148 +1,148 @@
|
||||
{{-- Server Card Component - Task History Theme --}}
|
||||
<div class="space-y-2"
|
||||
x-data="{ loaded: false, hovered: false }"
|
||||
x-init="setTimeout(() => loaded = true, 50)"
|
||||
x-cloak>
|
||||
@if($status)
|
||||
<div class="space-y-4">
|
||||
<a href="{{ route('proxmox.server.overview', ['server' => $server->id]) }}" wire:navigate>
|
||||
<div class="bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 rounded-2xl overflow-hidden shadow-theme-sm flex flex-col cursor-pointer
|
||||
transition-all duration-300 ease-out
|
||||
hover:shadow-theme-lg hover:border-gray-300 dark:hover:border-gray-700
|
||||
hover:-translate-y-0.5 hover:scale-[1.005]"
|
||||
:class="loaded ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-2'"
|
||||
@mouseenter="hovered = true"
|
||||
@mouseleave="hovered = false">
|
||||
{{-- Header: Server Name & Status --}}
|
||||
<div class="flex items-center justify-between px-4 py-3 transition-colors duration-200"
|
||||
:class="hovered ? 'bg-gray-50/50 dark:bg-gray-800/30' : ''">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="bg-background-secondary hover:bg-background-secondary/80 border border-neutral p-4 rounded-lg mb-4">
|
||||
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-3">
|
||||
@if($server->user_set_icon)
|
||||
@php
|
||||
$iconColor = $server->user_set_icon_color ?? '#6366f1';
|
||||
$bgColor = $iconColor . '20';
|
||||
// Calculate a lighter background color (20% opacity of the icon color)
|
||||
$bgColor = $iconColor . '33'; // 33 in hex = 20% opacity
|
||||
// Build the full component name with prefix
|
||||
$iconPrefix = $server->user_set_icon_prefix ?? 'ri';
|
||||
$iconName = $server->user_set_icon;
|
||||
$componentName = $iconPrefix . '-' . $iconName;
|
||||
@endphp
|
||||
<div class="flex items-center justify-center size-7 rounded transition-transform duration-300"
|
||||
x-bind:class="hovered ? 'scale-110' : ''"
|
||||
style="background-color: {{ $bgColor }};">
|
||||
<x-dynamic-component :component="$componentName" class="size-3 transition-opacity duration-200" x-bind:class="hovered ? 'opacity-100' : 'opacity-80'" style="color: {{ $iconColor }};" />
|
||||
<div class="p-2 rounded-lg" style="background-color: {{ $bgColor }};">
|
||||
<x-dynamic-component :component="$componentName" class="size-5" style="color: {{ $iconColor }};" />
|
||||
</div>
|
||||
@else
|
||||
<div class="flex items-center justify-center size-7 rounded bg-blue-50 dark:bg-blue-900 transition-transform duration-300"
|
||||
x-bind:class="hovered ? 'scale-110' : ''">
|
||||
<x-ri-server-line class="size-3 text-primary transition-opacity duration-200" x-bind:class="hovered ? 'opacity-100' : 'opacity-80'" />
|
||||
<div class="bg-secondary/10 p-2 rounded-lg">
|
||||
<x-ri-server-line class="size-5 text-secondary" />
|
||||
</div>
|
||||
@endif
|
||||
<span class="font-semibold text-sm transition-colors duration-200" x-bind:class="hovered ? 'text-primary' : ''">{{ $status->name }}</span>
|
||||
<span class="font-medium">{{ $status->name }}</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 px-3 py-1.5 rounded-lg
|
||||
@if($status->status == 'running') text-success bg-success/20
|
||||
@elseif($status->status == 'stopped') text-inactive bg-inactive/20
|
||||
@else text-warning bg-warning/20 @endif">
|
||||
<div class="size-5">
|
||||
@if($status->status == 'running')
|
||||
<x-ri-checkbox-circle-fill />
|
||||
@elseif($status->status == 'stopped')
|
||||
<x-ri-forbid-fill />
|
||||
@else
|
||||
<x-ri-error-warning-fill />
|
||||
@endif
|
||||
</div>
|
||||
<span class="text-sm font-medium">
|
||||
@if($status->status == 'running')
|
||||
Running
|
||||
@elseif($status->status == 'stopped')
|
||||
Stopped
|
||||
@else
|
||||
{{ ucfirst($status->status) }}
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
<x-proxmox::ui.server-status :status="$status->status" showLabel />
|
||||
</div>
|
||||
|
||||
{{-- Quick Info Row --}}
|
||||
<div class="flex flex-row flex-wrap gap-3 px-4 py-2 border-y border-gray-200 dark:border-gray-800 text-xs transition-colors duration-200"
|
||||
x-bind:class="hovered ? 'bg-gray-50/30 dark:bg-gray-800/20' : ''">
|
||||
<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 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 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 class="flex flex-col">
|
||||
<span class="text-xs text-base/50">IPv6 Address</span>
|
||||
<span class="text-base">{{ $server->primaryIpv6->ip }}</span>
|
||||
</div>
|
||||
@if($status->status == 'running' && isset($status->uptime))
|
||||
<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">
|
||||
<div class="flex flex-col">
|
||||
<span class="text-xs text-base/50">Uptime</span>
|
||||
<span class="text-base">
|
||||
@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 ';
|
||||
if ($days > 0) {
|
||||
$uptimeStr .= $days . 'd ';
|
||||
}
|
||||
if ($hours > 0 || $days > 0) {
|
||||
$uptimeStr .= $hours . 'h ';
|
||||
}
|
||||
$uptimeStr .= $minutes . 'm';
|
||||
@endphp
|
||||
{{ trim($uptimeStr) }}
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
<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) }}
|
||||
<div class="hidden sm:flex flex-col">
|
||||
<span class="text-xs text-base/50">Memory</span>
|
||||
<span class="text-base">
|
||||
@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-[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 class="hidden sm:flex flex-col">
|
||||
<span class="text-xs text-base/50">Disk</span>
|
||||
<span class="text-base">
|
||||
{{ Illuminate\Support\Number::fileSize(bytes: $status->maxdisk) }}
|
||||
</span>
|
||||
</div>
|
||||
@if($status->status == 'running')
|
||||
<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 class="hidden sm:flex flex-col">
|
||||
<span class="text-xs text-base/50">CPU</span>
|
||||
<span class="text-base">{{ round($status->cpu * 100, 2) }}%</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Server Configuration Grid --}}
|
||||
<div class="px-4 py-3">
|
||||
<div class="text-[10px] font-medium text-gray-500 dark:text-gray-400 uppercase mb-2 transition-opacity duration-200" x-bind:class="hovered ? 'opacity-70' : 'opacity-60'">Configuration</div>
|
||||
<div class="grid grid-cols-2 sm:grid-cols-4 gap-2">
|
||||
<div class="flex flex-col gap-1 rounded-lg border border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-800 p-3 transition-all duration-200 hover:bg-gray-100 dark:hover:bg-gray-700/50 hover:border-gray-300 dark:hover:border-gray-600">
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-xs font-medium text-gray-500 dark:text-gray-400">CPU</span>
|
||||
<x-ri-cpu-line class="size-3 text-gray-400" />
|
||||
{{-- Server Configuration Statistics --}}
|
||||
<div class="mt-4 pt-4 border-t border-neutral">
|
||||
<div class="text-sm font-medium text-base/70 mb-3">Server Configuration</div>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
|
||||
<div class="flex flex-col">
|
||||
<div class="flex items-center gap-2 mb-1">
|
||||
<x-ri-cpu-line class="size-4 text-base/50" />
|
||||
<span class="text-xs text-base/50">CPU Cores</span>
|
||||
</div>
|
||||
<div class="text-sm font-bold">{{ ($status->cpus ?? 'N/A') . ' Core' . (($status->cpus ?? 0) > 1 ? 's' : '') }}</div>
|
||||
<span class="text-base">{{ $status->cpus ?? 'N/A' }} {{ ($status->cpus ?? 0) > 1 ? 'Cores' : 'Core' }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 rounded-lg border border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-800 p-3 transition-all duration-200 hover:bg-gray-100 dark:hover:bg-gray-700/50 hover:border-gray-300 dark:hover:border-gray-600">
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-xs font-medium text-gray-500 dark:text-gray-400">RAM</span>
|
||||
<x-ri-ram-line class="size-3 text-gray-400 transition-colors duration-200 group-hover:text-primary" />
|
||||
<div class="flex flex-col">
|
||||
<div class="flex items-center gap-2 mb-1">
|
||||
<x-ri-database-2-line class="size-4 text-base/50" />
|
||||
<span class="text-xs text-base/50">RAM Allocation</span>
|
||||
</div>
|
||||
<div class="text-sm font-bold">{{ round(($status->maxmem ?? 0) / (1024 * 1024 * 1024), 1) }} GiB</div>
|
||||
<span class="text-base">{{ round(($status->maxmem ?? 0) / (1024 * 1024 * 1024), 2) }} GiB</span>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 rounded-lg border border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-800 p-3 transition-all duration-200 hover:bg-gray-100 dark:hover:bg-gray-700/50 hover:border-gray-300 dark:hover:border-gray-600">
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-xs font-medium text-gray-500 dark:text-gray-400">Disk</span>
|
||||
<x-ri-hard-drive-2-line class="size-3 text-gray-400 transition-colors duration-200 group-hover:text-primary" />
|
||||
<div class="flex flex-col">
|
||||
<div class="flex items-center gap-2 mb-1">
|
||||
<x-ri-hard-drive-2-line class="size-4 text-base/50" />
|
||||
<span class="text-xs text-base/50">Disk Capacity</span>
|
||||
</div>
|
||||
<div class="text-sm font-bold">{{ Illuminate\Support\Number::fileSize(bytes: $status->maxdisk ?? 0) }}</div>
|
||||
<span class="text-base">{{ Illuminate\Support\Number::fileSize(bytes: $status->maxdisk ?? 0) }}</span>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 rounded-lg border border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-800 p-3 transition-all duration-200 hover:bg-gray-100 dark:hover:bg-gray-700/50 hover:border-gray-300 dark:hover:border-gray-600">
|
||||
<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 transition-colors duration-200 group-hover:text-primary" />
|
||||
<div class="flex flex-col">
|
||||
<div class="flex items-center gap-2 mb-1">
|
||||
<x-ri-speed-line class="size-4 text-base/50" />
|
||||
<span class="text-xs text-base/50">Bandwidth</span>
|
||||
</div>
|
||||
<div class="text-sm font-bold">{{ $this->monthlyTraffic }} GiB</div>
|
||||
<p class="text-[10px] text-gray-500 dark:text-gray-400 transition-opacity duration-200" x-bind:class="hovered ? 'opacity-70' : 'opacity-60'">of {{ $this->bandwidthThreshold95 }} GiB (95%)</p>
|
||||
<span class="text-base font-medium">
|
||||
{{ $this->monthlyTraffic }} GiB / {{ $this->bandwidthThreshold95 }} GiB
|
||||
</span>
|
||||
<span class="text-base text-xs leading-relaxed text-base/60 mt-1">
|
||||
Threshold: 95% of average usage or 10 GiB minimum. Connection reduced to 1 MiB/s if exceeded.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
@else
|
||||
{{-- Error State --}}
|
||||
<a href="{{ route('proxmox.server.overview', ['server' => $server->id]) }}" wire:navigate>
|
||||
<div class="bg-white dark:bg-gray-900 border border-red-200 dark:border-red-800 rounded-2xl overflow-hidden shadow-theme-sm flex flex-col cursor-pointer
|
||||
transition-all duration-300 ease-out
|
||||
hover:shadow-theme-lg hover:-translate-y-0.5 hover:scale-[1.005]
|
||||
opacity-90 hover:opacity-100"
|
||||
:class="loaded ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-2'">
|
||||
<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 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>
|
||||
</div>
|
||||
<p class="text-xs text-gray-500 dark:text-gray-400 px-4 pb-3">Unable to retrieve server status.</p>
|
||||
</div>
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user