fix(ui): prevent avatar alt-text overlap on failed image loads (#21730)
This commit is contained in:
@@ -349,6 +349,9 @@
|
|||||||
src="{WEBUI_API_BASE_URL}/models/model/profile/image?id={model.model_id}"
|
src="{WEBUI_API_BASE_URL}/models/model/profile/image?id={model.model_id}"
|
||||||
alt={model.name}
|
alt={model.name}
|
||||||
class="size-5 rounded-full object-cover shrink-0"
|
class="size-5 rounded-full object-cover shrink-0"
|
||||||
|
on:error={(e) => {
|
||||||
|
e.target.src = '/favicon.png';
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<span class="truncate max-w-[150px]">{model.name}</span>
|
<span class="truncate max-w-[150px]">{model.name}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -435,6 +438,9 @@
|
|||||||
src="{WEBUI_API_BASE_URL}/users/{user.user_id}/profile/image"
|
src="{WEBUI_API_BASE_URL}/users/{user.user_id}/profile/image"
|
||||||
alt={user.name || 'User'}
|
alt={user.name || 'User'}
|
||||||
class="size-5 rounded-full object-cover shrink-0"
|
class="size-5 rounded-full object-cover shrink-0"
|
||||||
|
on:error={(e) => {
|
||||||
|
e.target.src = '/user.png';
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<span class="truncate max-w-[150px]"
|
<span class="truncate max-w-[150px]"
|
||||||
>{user.name || user.email || user.user_id.substring(0, 8)}</span
|
>{user.name || user.email || user.user_id.substring(0, 8)}</span
|
||||||
|
|||||||
@@ -130,7 +130,10 @@
|
|||||||
<img
|
<img
|
||||||
src="{WEBUI_API_BASE_URL}/models/model/profile/image?id={model.model_id}"
|
src="{WEBUI_API_BASE_URL}/models/model/profile/image?id={model.model_id}"
|
||||||
alt={model.name}
|
alt={model.name}
|
||||||
class="size-5 rounded-full object-cover"
|
class="size-5 rounded-full object-cover shrink-0"
|
||||||
|
on:error={(e) => {
|
||||||
|
e.target.src = '/favicon.png';
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<span class="font-medium text-gray-800 dark:text-gray-200">{model.name}</span>
|
<span class="font-medium text-gray-800 dark:text-gray-200">{model.name}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -180,7 +180,10 @@
|
|||||||
<img
|
<img
|
||||||
src="{WEBUI_API_BASE_URL}/models/model/profile/image?id={model.id}"
|
src="{WEBUI_API_BASE_URL}/models/model/profile/image?id={model.id}"
|
||||||
alt={model.name}
|
alt={model.name}
|
||||||
class="size-5 rounded-full object-cover"
|
class="size-5 rounded-full object-cover shrink-0"
|
||||||
|
on:error={(e) => {
|
||||||
|
e.target.src = '/favicon.png';
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<Tooltip content={`${model.name} (${model.id})`} placement="top-start">
|
<Tooltip content={`${model.name} (${model.id})`} placement="top-start">
|
||||||
<span class="font-medium text-gray-800 dark:text-gray-200 line-clamp-1"
|
<span class="font-medium text-gray-800 dark:text-gray-200 line-clamp-1"
|
||||||
|
|||||||
Reference in New Issue
Block a user