feat: remove hardcoded names

This commit is contained in:
Timothy J. Baek 2024-02-09 19:14:26 -08:00
parent 6a4dcac8e9
commit 223f17baf9
9 changed files with 70 additions and 22 deletions

View file

@ -27,19 +27,19 @@
>
{#if model in modelfiles}
<img
src={modelfiles[model]?.imageUrl ?? '/ollama-dark.png'}
src={modelfiles[model]?.imageUrl ?? './favicon.png'}
alt="modelfile"
class=" w-20 mb-2 rounded-full {models.length > 1
? ' border-[5px] border-white dark:border-gray-800'
? ' border-[5px] border-white dark:border-gray-900'
: ''}"
draggable="false"
/>
{:else}
<img
src={models.length === 1 ? '/ollama.png' : 'ollama-dark.png'}
src={models.length === 1 ? '/favicon.png' : '/favicon.png'}
class=" w-20 mb-2 {models.length === 1
? 'invert-[10%] dark:invert-[100%]'
: 'border-[5px] border-white dark:border-gray-800'} rounded-full"
? ''
: 'border-[5px] border-white dark:border-gray-900'} rounded-full"
alt="ollama"
draggable="false"
/>

View file

@ -1,6 +1,6 @@
<script lang="ts">
import { getOllamaVersion } from '$lib/apis/ollama';
import { WEB_UI_VERSION } from '$lib/constants';
import { WEBUI_NAME, WEB_UI_VERSION } from '$lib/constants';
import { config } from '$lib/stores';
import { onMount } from 'svelte';
@ -15,7 +15,7 @@
<div class="flex flex-col h-full justify-between space-y-3 text-sm mb-6">
<div class=" space-y-3">
<div>
<div class=" mb-2.5 text-sm font-medium">Ollama Web UI Version</div>
<div class=" mb-2.5 text-sm font-medium">{WEBUI_NAME} Version</div>
<div class="flex w-full">
<div class="flex-1 text-xs text-gray-700 dark:text-gray-200">
{$config && $config.version ? $config.version : WEB_UI_VERSION}

View file

@ -8,9 +8,10 @@
import ShareChatModal from '../chat/ShareChatModal.svelte';
import TagInput from '../common/Tags/TagInput.svelte';
import Tags from '../common/Tags.svelte';
import { WEBUI_NAME } from '$lib/constants';
export let initNewChat: Function;
export let title: string = 'Ollama Web UI';
export let title: string = WEBUI_NAME;
export let shareEnabled: boolean = false;
export let tags = [];
@ -97,7 +98,7 @@
</div>
<div class=" flex-1 self-center font-medium line-clamp-1">
<div>
{title != '' ? title : 'Ollama Web UI'}
{title != '' ? title : WEBUI_NAME}
</div>
</div>

View file

@ -19,7 +19,7 @@
let show = false;
let navElement;
let title: string = 'Ollama Web UI';
let title: string = 'UI';
let search = '';
let chatDeleteId = null;
@ -88,7 +88,7 @@
<div class="px-2.5 flex justify-center space-x-2">
<button
id="sidebar-new-chat-button"
class="flex-grow flex justify-between rounded-md px-3 py-2 mt-1 hover:bg-gray-900 transition"
class="flex-grow flex justify-between rounded-md px-3 py-2 hover:bg-gray-900 transition"
on:click={async () => {
goto('/');
@ -100,8 +100,8 @@
}}
>
<div class="flex self-center">
<div class="self-center mr-3.5">
<img src="/ollama.png" class=" w-5 invert-[100%] rounded-full" />
<div class="self-center mr-1.5">
<img src="/favicon.png" class=" w-7 -translate-x-1.5 rounded-full" alt="logo" />
</div>
<div class=" self-center font-medium text-sm">New Chat</div>