fix: restore Component.php and move icon functionality to Overview.php only
- Reverted Component.php to original state (was breaking all Livewire modals) - Icon properties and methods now only in Overview.php where they belong - Icon button only shows as clickable on Overview page - Other pages show the icon as display-only (not a button) - Icon modal only renders on Overview page - Fixed saveIcon method to accept icon and color arguments
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
<div class="flex flex-col gap-4 pb-6 pt-6 lg:flex-row lg:items-center lg:justify-between">
|
||||
<div class="flex items-center gap-3">
|
||||
<!-- Server Icon -->
|
||||
@if($view === 'overview')
|
||||
<button
|
||||
wire:click="openIconModal"
|
||||
class="bg-secondary/10 p-2 rounded-lg hover:bg-secondary/20 transition-colors cursor-pointer"
|
||||
@@ -66,6 +67,21 @@
|
||||
<x-ri-server-line class="size-5 text-secondary" />
|
||||
@endif
|
||||
</button>
|
||||
@else
|
||||
<div class="bg-secondary/10 p-2 rounded-lg">
|
||||
@if($server->user_set_icon)
|
||||
@php
|
||||
$iconColor = $server->user_set_icon_color ?: 'currentColor';
|
||||
$iconName = str_starts_with($server->user_set_icon, 'ri-')
|
||||
? $server->user_set_icon
|
||||
: 'ri-' . $server->user_set_icon;
|
||||
@endphp
|
||||
<x-dynamic-component :component="$iconName" class="size-5" style="color: {{ $iconColor }}" />
|
||||
@else
|
||||
<x-ri-server-line class="size-5 text-secondary" />
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
<span class="text-2xl font-bold">
|
||||
{{ $server->hostname }}
|
||||
</span>
|
||||
@@ -926,6 +942,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($view === 'overview')
|
||||
<!-- Server Icon Customization Modal -->
|
||||
<div x-data="{
|
||||
open: @entangle('showIconModal'),
|
||||
@@ -1074,6 +1091,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@else
|
||||
@php
|
||||
|
||||
Reference in New Issue
Block a user