refactor: remove ServerIconController and update related views for server icon handling
This commit is contained in:
@@ -38,9 +38,16 @@
|
||||
@endphp
|
||||
|
||||
<div class="flex flex-col gap-4 pb-6 pt-6 lg:flex-row lg:items-center lg:justify-between">
|
||||
<span class="text-2xl font-bold">
|
||||
{{ $server->hostname }}
|
||||
</span>
|
||||
<div class="flex items-center gap-3">
|
||||
@if($server->user_set_icon)
|
||||
<i class="ri-{{ $server->user_set_icon }} text-2xl" style="{{ $server->user_set_icon_color ? 'color: ' . $server->user_set_icon_color : '' }}"></i>
|
||||
@else
|
||||
<i class="ri-server-line text-2xl text-secondary"></i>
|
||||
@endif
|
||||
<span class="text-2xl font-bold">
|
||||
{{ $server->hostname }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="hidden lg:flex flex-row gap-2 ml-auto justify-end items-center">
|
||||
|
||||
@@ -78,16 +78,12 @@
|
||||
<!-- Standalone Server Icon Customization (Alpine.js, AJAX) -->
|
||||
<div x-data="serverIconModal({
|
||||
serverId: '{{ $server->id }}',
|
||||
initialIcon: @json($server->user_set_icon),
|
||||
initialColor: @json($server->user_set_icon_color)
|
||||
initialIcon: {{ $server->user_set_icon ? "'" . $server->user_set_icon . "'" : 'null' }},
|
||||
initialColor: {{ $server->user_set_icon_color ? "'" . $server->user_set_icon_color . "'" : 'null' }}
|
||||
})" class="flex items-center gap-2">
|
||||
<button @click="openModal()" :title="icon ? 'Customize server icon' : 'Set server icon'" class="p-2 rounded-lg bg-secondary/10 hover:bg-secondary/20 transition-colors">
|
||||
<template x-if="icon">
|
||||
<i :class="'ri-' + icon + ' size-5'" :style="color ? 'color: ' + color : ''"></i>
|
||||
</template>
|
||||
<template x-if="!icon">
|
||||
<x-ri-server-line class="size-5 text-secondary" />
|
||||
</template>
|
||||
<i x-show="icon" :class="'ri-' + icon" class="size-5" :style="color ? 'color: ' + color : ''"></i>
|
||||
<x-ri-server-line x-show="!icon" class="size-5 text-secondary" />
|
||||
</button>
|
||||
<!-- Modal -->
|
||||
<div x-show="show" x-cloak class="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm">
|
||||
@@ -98,19 +94,15 @@
|
||||
<h3 class="text-lg font-semibold mb-4">Customize Server Icon</h3>
|
||||
<div class="flex items-center gap-4 mb-4">
|
||||
<div class="size-12 rounded-xl border flex items-center justify-center" :style="color ? 'color: ' + color + '; border-color: ' + color : ''">
|
||||
<template x-if="icon">
|
||||
<i :class="'ri-' + icon + ' size-8'" :style="color ? 'color: ' + color : ''"></i>
|
||||
</template>
|
||||
<template x-if="!icon">
|
||||
<x-ri-server-line class="size-8 text-base/40" />
|
||||
</template>
|
||||
<i x-show="icon" :class="'ri-' + icon" class="size-8"></i>
|
||||
<x-ri-server-line x-show="!icon" class="size-8 text-base/40" />
|
||||
</div>
|
||||
<input x-model="search" type="text" placeholder="Search icons..." class="border rounded px-2 py-1 text-sm w-40" />
|
||||
</div>
|
||||
<div class="grid grid-cols-6 gap-2 mb-4 max-h-32 overflow-y-auto">
|
||||
<template x-for="i in filteredIcons" :key="i">
|
||||
<button @click="icon = i" :class="icon === i ? 'ring-2 ring-primary' : ''" class="rounded p-1 border flex items-center justify-center">
|
||||
<i :class="'ri-' + i + ' size-5'"></i>
|
||||
<button @click="icon = i" :class="icon === i ? 'ring-2 ring-primary' : ''" class="rounded p-1 border flex items-center justify-center hover:bg-secondary/10">
|
||||
<i :class="'ri-' + i" class="size-5"></i>
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -5,11 +5,7 @@
|
||||
<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">
|
||||
@if($server->user_set_icon)
|
||||
<i class="ri-{{ $server->user_set_icon }} size-5" @if($server->user_set_icon_color) style="color: {{ $server->user_set_icon_color }}" @endif></i>
|
||||
@else
|
||||
<x-ri-server-line class="size-5 text-secondary" />
|
||||
@endif
|
||||
<x-ri-server-line class="size-5 text-secondary" />
|
||||
</div>
|
||||
<span class="font-medium">{{ $status->name }}</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user