Enhance Proxmox service icon handling with custom color and prefix support

This commit is contained in:
2025-12-06 12:23:39 -05:00
parent 8682916d5e
commit 96f48014fe
2 changed files with 25 additions and 5 deletions

View File

@@ -47,12 +47,15 @@
flex flex-col md:flex-row items-start md:items-center justify-between gap-4">
<div class="flex items-start md:items-center gap-4 flex-grow">
<div class="bg-primary/10 p-3 rounded-full flex-shrink-0 shadow-sm">
@if(optional($service->product->server)->extension === 'Proxmox' && $service->proxmoxServer && $service->proxmoxServer->user_set_icon)
@php
$hasCustomIcon = optional($service->product->server)->extension === 'Proxmox' && $service->proxmoxServer && $service->proxmoxServer->user_set_icon;
$iconColor = $hasCustomIcon ? $service->proxmoxServer->user_set_icon_color : null;
@endphp
<div class="p-3 rounded-full flex-shrink-0 shadow-sm" style="{{ $iconColor ? 'background-color: ' . $iconColor . '20;' : 'background-color: rgb(var(--color-primary) / 0.1);' }}">
@if($hasCustomIcon)
@php
$iconPrefix = $service->proxmoxServer->user_set_icon_prefix ?? 'ri';
$iconName = $service->proxmoxServer->user_set_icon;
$iconColor = $service->proxmoxServer->user_set_icon_color;
if ($iconPrefix === 'vaadin') {
$componentName = 'vaadin-' . str_replace('_', '-', $iconName);
} else {