refac: profile_image_url optimization
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
||||
import VideoInputMenu from './CallOverlay/VideoInputMenu.svelte';
|
||||
import { KokoroWorker } from '$lib/workers/KokoroWorker';
|
||||
import { WEBUI_API_BASE_URL } from '$lib/constants';
|
||||
|
||||
const i18n = getContext('i18n');
|
||||
|
||||
@@ -759,14 +760,8 @@
|
||||
? ' size-16'
|
||||
: rmsLevel * 100 > 1
|
||||
? 'size-14'
|
||||
: 'size-12'} transition-all rounded-full {(model?.info?.meta
|
||||
?.profile_image_url ?? '/static/favicon.png') !== '/static/favicon.png'
|
||||
? ' bg-cover bg-center bg-no-repeat'
|
||||
: 'bg-black dark:bg-white'} bg-black dark:bg-white"
|
||||
style={(model?.info?.meta?.profile_image_url ?? '/static/favicon.png') !==
|
||||
'/static/favicon.png'
|
||||
? `background-image: url('${model?.info?.meta?.profile_image_url}');`
|
||||
: ''}
|
||||
: 'size-12'} transition-all rounded-full bg-cover bg-center bg-no-repeat"
|
||||
style={`background-image: url('${WEBUI_API_BASE_URL}/models/model/profile/image?id=${model?.id}&lang=${$i18n.language}&voice=true');`}
|
||||
/>
|
||||
{/if}
|
||||
<!-- navbar -->
|
||||
@@ -841,14 +836,8 @@
|
||||
? 'size-48'
|
||||
: rmsLevel * 100 > 1
|
||||
? 'size-44'
|
||||
: 'size-40'} transition-all rounded-full {(model?.info?.meta
|
||||
?.profile_image_url ?? '/static/favicon.png') !== '/static/favicon.png'
|
||||
? ' bg-cover bg-center bg-no-repeat'
|
||||
: 'bg-black dark:bg-white'} "
|
||||
style={(model?.info?.meta?.profile_image_url ?? '/static/favicon.png') !==
|
||||
'/static/favicon.png'
|
||||
? `background-image: url('${model?.info?.meta?.profile_image_url}');`
|
||||
: ''}
|
||||
: 'size-40'} transition-all rounded-full bg-cover bg-center bg-no-repeat"
|
||||
style={`background-image: url('${WEBUI_API_BASE_URL}/models/model/profile/image?id=${model?.id}&lang=${$i18n.language}&voice=true');`}
|
||||
/>
|
||||
{/if}
|
||||
</button>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import { tick, getContext } from 'svelte';
|
||||
|
||||
import { models } from '$lib/stores';
|
||||
import { WEBUI_BASE_URL } from '$lib/constants';
|
||||
import { WEBUI_API_BASE_URL, WEBUI_BASE_URL } from '$lib/constants';
|
||||
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
||||
|
||||
const i18n = getContext('i18n');
|
||||
@@ -83,7 +83,7 @@
|
||||
>
|
||||
<div class="flex text-black dark:text-gray-100 line-clamp-1">
|
||||
<img
|
||||
src={model?.info?.meta?.profile_image_url ?? `${WEBUI_BASE_URL}/static/favicon.png`}
|
||||
src={`${WEBUI_API_BASE_URL}/models/model/profile/image?id=${model.id}&lang=${$i18n.language}`}
|
||||
alt={model?.name ?? model.id}
|
||||
class="rounded-full size-5 items-center mr-2"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user