chore: streamline the URL used for resources like favicon.png

This commit is contained in:
guenhter
2025-07-09 09:14:51 +02:00
parent 0a3c448a52
commit 196af9eaf7
29 changed files with 66 additions and 42 deletions
@@ -56,7 +56,7 @@
crossorigin="anonymous"
src={model?.info?.meta?.profile_image_url ??
($i18n.language === 'dg-DG'
? `/doge.png`
? `${WEBUI_BASE_URL}/doge.png`
: `${WEBUI_BASE_URL}/static/favicon.png`)}
class=" size-[2.7rem] rounded-full border-[1px] border-gray-100 dark:border-none"
alt="logo"
+1 -1
View File
@@ -835,7 +835,7 @@
src={$models.find((model) => model.id === atSelectedModel.id)?.info?.meta
?.profile_image_url ??
($i18n.language === 'dg-DG'
? `/doge.png`
? `${WEBUI_BASE_URL}/doge.png`
: `${WEBUI_BASE_URL}/static/favicon.png`)}
/>
<div class="translate-y-[0.5px]">
@@ -5,6 +5,7 @@
import { tick, getContext } from 'svelte';
import { models } from '$lib/stores';
import { WEBUI_BASE_URL } from '$lib/constants';
const i18n = getContext('i18n');
@@ -117,7 +118,8 @@
>
<div class="flex font-medium text-black dark:text-gray-100 line-clamp-1">
<img
src={model?.info?.meta?.profile_image_url ?? '/static/favicon.png'}
src={model?.info?.meta?.profile_image_url ??
`${WEBUI_BASE_URL}/static/favicon.png`}
alt={model?.name ?? model.id}
class="rounded-full size-6 items-center mr-2"
/>
@@ -14,7 +14,7 @@
src.startsWith('data:') ||
src.startsWith('/')
? src
: `/user.png`}
: `${WEBUI_BASE_URL}/user.png`}
class=" {className} object-cover rounded-full"
alt="profile"
draggable="false"
@@ -605,7 +605,9 @@
<div class={`shrink-0 ltr:mr-3 rtl:ml-3 hidden @lg:flex mt-1 `}>
<ProfileImage
src={model?.info?.meta?.profile_image_url ??
($i18n.language === 'dg-DG' ? `/doge.png` : `${WEBUI_BASE_URL}/static/favicon.png`)}
($i18n.language === 'dg-DG'
? `${WEBUI_BASE_URL}/doge.png`
: `${WEBUI_BASE_URL}/favicon.png`)}
className={'size-8 assistant-message-profile-image'}
/>
</div>
@@ -6,6 +6,7 @@
import { models, settings } from '$lib/stores';
import { user as _user } from '$lib/stores';
import { copyToClipboard as _copyToClipboard, formatDate } from '$lib/utils';
import { WEBUI_BASE_URL } from '$lib/constants';
import Name from './Name.svelte';
import ProfileImage from './ProfileImage.svelte';
@@ -117,8 +118,8 @@
<ProfileImage
src={message.user
? ($models.find((m) => m.id === message.user)?.info?.meta?.profile_image_url ??
'/user.png')
: (user?.profile_image_url ?? '/user.png')}
`${WEBUI_BASE_URL}/user.png`)
: (user?.profile_image_url ?? `${WEBUI_BASE_URL}/user.png`)}
className={'size-8 user-message-profile-image'}
/>
</div>
@@ -5,6 +5,7 @@
import dayjs from '$lib/dayjs';
import { mobile, settings, user } from '$lib/stores';
import { WEBUI_BASE_URL } from '$lib/constants';
import Tooltip from '$lib/components/common/Tooltip.svelte';
import { copyToClipboard, sanitizeResponseContent } from '$lib/utils';
@@ -73,7 +74,8 @@
<div class="flex items-center min-w-fit">
<Tooltip content={$user?.role === 'admin' ? (item?.value ?? '') : ''} placement="top-start">
<img
src={item.model?.info?.meta?.profile_image_url ?? '/static/favicon.png'}
src={item.model?.info?.meta?.profile_image_url ??
`${WEBUI_BASE_URL}/static/favicon.png`}
alt="Model"
class="rounded-full size-5 flex items-center"
/>
+1 -1
View File
@@ -21,7 +21,7 @@
{#if data.message.role === 'user'}
<div class="flex w-full">
<ProfileImage
src={data.user?.profile_image_url ?? '/user.png'}
src={data.user?.profile_image_url ?? `${WEBUI_BASE_URL}/user.png`}
className={'size-5 -translate-y-[1px]'}
/>
<div class="ml-2">
+1 -1
View File
@@ -100,7 +100,7 @@
crossorigin="anonymous"
src={model?.info?.meta?.profile_image_url ??
($i18n.language === 'dg-DG'
? `/doge.png`
? `${WEBUI_BASE_URL}/doge.png`
: `${WEBUI_BASE_URL}/static/favicon.png`)}
class=" size-9 @sm:size-10 rounded-full border-[1px] border-gray-100 dark:border-none"
aria-hidden="true"
@@ -4,6 +4,7 @@
import { user, config, settings } from '$lib/stores';
import { updateUserProfile, createAPIKey, getAPIKey, getSessionUser } from '$lib/apis/auths';
import { WEBUI_BASE_URL } from '$lib/constants';
import UpdatePassword from './Account/UpdatePassword.svelte';
import { getGravatarUrl } from '$lib/apis/utils';
@@ -223,7 +224,7 @@
<button
class=" text-xs text-center text-gray-800 dark:text-gray-400 rounded-lg px-2 py-1"
on:click={async () => {
profileImageUrl = '/user.png';
profileImageUrl = `${WEBUI_BASE_URL}/user.png`;
}}>{$i18n.t('Remove')}</button
>
</div>