open-webui/src/lib/components/workspace/Models.svelte

635 lines
18 KiB
Svelte
Raw Normal View History

2024-05-15 06:16:22 +00:00
<script lang="ts">
2024-09-21 20:12:41 +00:00
import { marked } from 'marked';
2024-05-15 06:16:22 +00:00
import { toast } from 'svelte-sonner';
2024-05-31 20:11:04 +00:00
import Sortable from 'sortablejs';
2024-05-15 06:16:22 +00:00
import fileSaver from 'file-saver';
const { saveAs } = fileSaver;
2024-05-31 20:11:04 +00:00
import { onMount, getContext, tick } from 'svelte';
2024-11-14 10:20:34 +00:00
import { goto } from '$app/navigation';
const i18n = getContext('i18n');
2024-05-15 06:16:22 +00:00
2024-11-14 10:20:34 +00:00
import { WEBUI_NAME, config, mobile, models as _models, settings, user } from '$lib/stores';
import { WEBUI_BASE_URL } from '$lib/constants';
2024-11-15 10:05:43 +00:00
import {
createNewModel,
deleteModelById,
2024-11-16 02:53:50 +00:00
getModels as getWorkspaceModels,
2024-11-16 02:21:41 +00:00
toggleModelById,
2024-11-15 10:05:43 +00:00
updateModelById
} from '$lib/apis/models';
2024-05-25 01:26:36 +00:00
2024-05-24 09:17:48 +00:00
import { getModels } from '$lib/apis';
import { getGroups } from '$lib/apis/groups';
2024-05-31 20:11:04 +00:00
2024-05-31 09:11:25 +00:00
import EllipsisHorizontal from '../icons/EllipsisHorizontal.svelte';
import ModelMenu from './Models/ModelMenu.svelte';
2024-06-15 10:13:30 +00:00
import ModelDeleteConfirmDialog from '../common/ConfirmDialog.svelte';
import Tooltip from '../common/Tooltip.svelte';
import GarbageBin from '../icons/GarbageBin.svelte';
2024-11-07 05:45:48 +00:00
import Search from '../icons/Search.svelte';
import Plus from '../icons/Plus.svelte';
2024-11-16 01:36:46 +00:00
import ChevronRight from '../icons/ChevronRight.svelte';
2024-11-16 02:21:41 +00:00
import Switch from '../common/Switch.svelte';
2024-11-17 02:35:14 +00:00
import Spinner from '../common/Spinner.svelte';
2025-05-26 18:29:03 +00:00
import { capitalizeFirstLetter, copyToClipboard } from '$lib/utils';
import XMark from '../icons/XMark.svelte';
2025-05-24 22:32:32 +00:00
import EyeSlash from '../icons/EyeSlash.svelte';
import Eye from '../icons/Eye.svelte';
2024-05-15 06:16:22 +00:00
let shiftKey = false;
2024-05-15 06:16:22 +00:00
let importFiles;
2024-05-25 05:40:36 +00:00
let modelsImportInputElement: HTMLInputElement;
2025-07-08 19:05:39 +00:00
let tagsContainerElement: HTMLDivElement;
2024-11-17 02:35:14 +00:00
let loaded = false;
2024-05-15 06:16:22 +00:00
2024-11-14 10:20:34 +00:00
let models = [];
2025-07-08 19:05:39 +00:00
let tags = [];
let selectedTag = '';
2024-10-14 19:46:05 +00:00
let filteredModels = [];
2024-06-15 10:13:30 +00:00
let selectedModel = null;
2024-05-31 20:11:04 +00:00
2024-11-14 10:20:34 +00:00
let showModelDeleteConfirm = false;
let group_ids = [];
2024-11-14 10:20:34 +00:00
$: if (models) {
filteredModels = models.filter((m) => {
2025-07-08 19:05:39 +00:00
if (query === '' && selectedTag === '') return true;
const lowerQuery = query.toLowerCase();
return (
2025-07-08 19:05:39 +00:00
((m.name || '').toLowerCase().includes(lowerQuery) ||
(m.user?.name || '').toLowerCase().includes(lowerQuery) || // Search by user name
(m.user?.email || '').toLowerCase().includes(lowerQuery)) && // Search by user email
(selectedTag === '' ||
m?.meta?.tags?.some((tag) => tag.name.toLowerCase() === selectedTag.toLowerCase()))
);
});
2024-10-14 19:46:05 +00:00
}
let query = '';
2024-05-26 06:52:17 +00:00
2024-05-25 01:26:36 +00:00
const deleteModelHandler = async (model) => {
2024-11-15 11:02:08 +00:00
const res = await deleteModelById(localStorage.token, model.id).catch((e) => {
2025-01-30 05:56:28 +00:00
toast.error(`${e}`);
2024-11-15 11:02:08 +00:00
return null;
});
2024-05-25 01:32:48 +00:00
if (res) {
toast.success($i18n.t(`Deleted {{name}}`, { name: model.id }));
}
2025-02-12 09:22:53 +00:00
await _models.set(
await getModels(
localStorage.token,
2025-02-12 09:32:49 +00:00
$config?.features?.enable_direct_connections && ($settings?.directConnections ?? null)
2025-02-12 09:22:53 +00:00
)
);
2024-11-15 11:02:08 +00:00
models = await getWorkspaceModels(localStorage.token);
2024-05-25 01:26:36 +00:00
};
2024-05-15 06:16:22 +00:00
2024-05-25 01:26:36 +00:00
const cloneModelHandler = async (model) => {
2024-11-15 10:05:43 +00:00
sessionStorage.model = JSON.stringify({
...model,
id: `${model.id}-clone`,
name: `${model.name} (Clone)`
});
goto('/workspace/models/create');
2024-05-15 06:16:22 +00:00
};
2024-05-24 08:40:48 +00:00
const shareModelHandler = async (model) => {
2025-02-10 06:19:02 +00:00
toast.success($i18n.t('Redirecting you to Open WebUI Community'));
2024-05-15 06:16:22 +00:00
const url = 'https://openwebui.com';
2024-05-24 08:40:48 +00:00
const tab = await window.open(`${url}/models/create`, '_blank');
2024-06-09 18:57:33 +00:00
const messageHandler = (event) => {
if (event.origin !== url) return;
if (event.data === 'loaded') {
tab.postMessage(JSON.stringify(model), '*');
window.removeEventListener('message', messageHandler);
}
};
window.addEventListener('message', messageHandler, false);
2024-05-15 06:16:22 +00:00
};
2024-05-31 09:11:25 +00:00
const hideModelHandler = async (model) => {
2025-05-24 22:32:32 +00:00
model.meta = {
...model.meta,
hidden: !(model?.meta?.hidden ?? false)
2024-05-31 09:11:25 +00:00
};
2025-05-24 22:32:32 +00:00
console.log(model);
2024-05-31 09:11:25 +00:00
2025-05-24 22:32:32 +00:00
const res = await updateModelById(localStorage.token, model.id, model);
2024-05-31 09:11:25 +00:00
if (res) {
toast.success(
$i18n.t(`Model {{name}} is now {{status}}`, {
2025-05-24 22:32:32 +00:00
name: model.id,
status: model.meta.hidden ? 'hidden' : 'visible'
2024-05-31 09:11:25 +00:00
})
);
}
2025-02-12 09:22:53 +00:00
await _models.set(
await getModels(
localStorage.token,
2025-02-12 09:32:49 +00:00
$config?.features?.enable_direct_connections && ($settings?.directConnections ?? null)
2025-02-12 09:22:53 +00:00
)
);
2024-11-15 11:02:08 +00:00
models = await getWorkspaceModels(localStorage.token);
2024-05-31 09:11:25 +00:00
};
2025-05-26 18:29:03 +00:00
const copyLinkHandler = async (model) => {
const baseUrl = window.location.origin;
const res = await copyToClipboard(`${baseUrl}/?model=${encodeURIComponent(model.id)}`);
if (res) {
toast.success($i18n.t('Copied link to clipboard'));
} else {
toast.error($i18n.t('Failed to copy link'));
}
};
2024-05-24 08:40:48 +00:00
const downloadModels = async (models) => {
let blob = new Blob([JSON.stringify(models)], {
2024-05-15 06:16:22 +00:00
type: 'application/json'
});
2024-05-24 08:40:48 +00:00
saveAs(blob, `models-export-${Date.now()}.json`);
2024-05-15 06:16:22 +00:00
};
2024-06-02 20:53:02 +00:00
const exportModelHandler = async (model) => {
let blob = new Blob([JSON.stringify([model])], {
type: 'application/json'
});
saveAs(blob, `${model.id}-${Date.now()}.json`);
};
2024-05-31 20:11:04 +00:00
onMount(async () => {
2024-11-15 10:05:43 +00:00
models = await getWorkspaceModels(localStorage.token);
let groups = await getGroups(localStorage.token);
2025-01-19 19:58:58 +00:00
group_ids = groups.map((group) => group.id);
2025-07-08 19:05:39 +00:00
if (models) {
tags = models
.filter((model) => !(model?.meta?.hidden ?? false))
.flatMap((model) => model?.meta?.tags ?? [])
.map((tag) => tag.name);
// Remove duplicates and sort
tags = Array.from(new Set(tags)).sort((a, b) => a.localeCompare(b));
}
2024-11-17 02:35:14 +00:00
loaded = true;
const onKeyDown = (event) => {
if (event.key === 'Shift') {
shiftKey = true;
}
};
const onKeyUp = (event) => {
if (event.key === 'Shift') {
shiftKey = false;
}
};
const onBlur = () => {
shiftKey = false;
};
window.addEventListener('keydown', onKeyDown);
window.addEventListener('keyup', onKeyUp);
2025-02-16 03:27:25 +00:00
window.addEventListener('blur-sm', onBlur);
return () => {
window.removeEventListener('keydown', onKeyDown);
window.removeEventListener('keyup', onKeyUp);
2025-02-16 03:27:25 +00:00
window.removeEventListener('blur-sm', onBlur);
};
2024-05-15 06:16:22 +00:00
});
</script>
<svelte:head>
<title>
2025-05-03 14:16:32 +00:00
{$i18n.t('Models')}{$WEBUI_NAME}
2024-05-15 06:16:22 +00:00
</title>
</svelte:head>
2024-11-17 02:35:14 +00:00
{#if loaded}
<ModelDeleteConfirmDialog
bind:show={showModelDeleteConfirm}
on:confirm={() => {
deleteModelHandler(selectedModel);
}}
/>
2025-07-08 19:05:39 +00:00
<div class="flex flex-col gap-1 mt-1.5">
2024-11-17 02:35:14 +00:00
<div class="flex justify-between items-center">
<div class="flex items-center md:self-center text-xl font-medium px-0.5">
{$i18n.t('Models')}
<div class="flex self-center w-[1px] h-6 mx-2.5 bg-gray-50 dark:bg-gray-850" />
<span class="text-lg font-medium text-gray-500 dark:text-gray-300"
>{filteredModels.length}</span
>
</div>
2024-05-26 06:52:17 +00:00
</div>
2024-11-17 02:35:14 +00:00
<div class=" flex flex-1 items-center w-full space-x-2">
<div class="flex flex-1 items-center">
<div class=" self-center ml-1 mr-3">
<Search className="size-3.5" />
</div>
<input
2025-02-16 03:27:25 +00:00
class=" w-full text-sm py-1 rounded-r-xl outline-hidden bg-transparent"
bind:value={query}
2024-11-17 02:35:14 +00:00
placeholder={$i18n.t('Search Models')}
/>
{#if query}
<div class="self-center pl-1.5 translate-y-[0.5px] rounded-l-xl bg-transparent">
<button
class="p-0.5 rounded-full hover:bg-gray-100 dark:hover:bg-gray-900 transition"
on:click={() => {
query = '';
}}
>
<XMark className="size-3" strokeWidth="2" />
</button>
</div>
{/if}
2024-11-07 05:45:48 +00:00
</div>
2024-05-26 06:52:17 +00:00
2024-11-17 02:35:14 +00:00
<div>
<a
class=" px-2 py-2 rounded-xl hover:bg-gray-700/10 dark:hover:bg-gray-100/10 dark:text-gray-300 dark:hover:text-white transition font-medium text-sm flex items-center space-x-1"
href="/workspace/models/create"
>
<Plus className="size-3.5" />
</a>
</div>
2024-10-14 19:46:05 +00:00
</div>
</div>
2024-11-17 02:35:14 +00:00
2025-07-08 19:05:39 +00:00
{#if tags.length > 0}
<div
class=" flex w-full bg-transparent overflow-x-auto scrollbar-none"
on:wheel={(e) => {
if (e.deltaY !== 0) {
e.preventDefault();
e.currentTarget.scrollLeft += e.deltaY;
}
}}
>
<div
class="flex gap-1 w-fit text-center text-sm font-medium rounded-full"
bind:this={tagsContainerElement}
>
<button
class="min-w-fit outline-none p-1.5 {selectedTag === ''
? ''
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition capitalize"
on:click={() => {
selectedTag = '';
}}
>
{$i18n.t('All')}
</button>
{#each tags as tag}
<button
class="min-w-fit outline-none p-1.5 {selectedTag === tag
? ''
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition capitalize"
on:click={() => {
selectedTag = tag;
}}
>
{tag}
</button>
{/each}
</div>
</div>
{/if}
2024-11-18 14:19:34 +00:00
<div class=" my-2 mb-5 gap-2 grid lg:grid-cols-2 xl:grid-cols-3" id="model-list">
{#each filteredModels as model (model.id)}
2024-11-17 02:35:14 +00:00
<div
2024-11-18 14:21:54 +00:00
class=" flex flex-col cursor-pointer w-full px-3 py-2 dark:hover:bg-white/5 hover:bg-black/5 rounded-xl transition"
2024-11-17 02:35:14 +00:00
id="model-item-{model.id}"
2024-05-15 06:16:22 +00:00
>
2025-05-26 19:22:37 +00:00
<div class="flex gap-4 mt-1 mb-0.5">
2024-11-18 14:19:34 +00:00
<div class=" w-[44px]">
2024-11-17 02:35:14 +00:00
<div
class=" rounded-full object-cover {model.is_active
? ''
: 'opacity-50 dark:opacity-50'} "
>
<img
src={model?.meta?.profile_image_url ?? `${WEBUI_BASE_URL}/static/favicon.png`}
2024-11-17 02:35:14 +00:00
alt="modelfile profile"
class=" rounded-full w-full h-auto object-cover"
/>
</div>
2024-05-15 06:16:22 +00:00
</div>
2024-11-18 14:02:14 +00:00
<a
2024-11-18 14:19:34 +00:00
class=" flex flex-1 cursor-pointer w-full"
2024-11-18 14:02:14 +00:00
href={`/?models=${encodeURIComponent(model.id)}`}
>
<div class=" flex-1 self-center {model.is_active ? '' : 'text-gray-500'}">
<Tooltip
content={marked.parse(model?.meta?.description ?? model.id)}
className=" w-fit"
placement="top-start"
>
2024-11-18 14:19:34 +00:00
<div class=" font-semibold line-clamp-1">{model.name}</div>
2024-11-18 14:02:14 +00:00
</Tooltip>
2024-11-18 13:37:04 +00:00
2024-11-18 14:02:14 +00:00
<div class="flex gap-1 text-xs overflow-hidden">
<div class="line-clamp-1">
2024-11-19 05:10:34 +00:00
{#if (model?.meta?.description ?? '').trim()}
2024-11-18 14:02:14 +00:00
{model?.meta?.description}
{:else}
{model.id}
{/if}
2024-11-18 13:37:04 +00:00
</div>
2024-11-18 14:02:14 +00:00
</div>
2024-11-17 02:35:14 +00:00
</div>
2024-11-18 14:02:14 +00:00
</a>
</div>
2025-05-26 19:22:37 +00:00
<div class="flex justify-between items-center -mb-0.5 px-0.5 mt-1.5">
2024-11-18 14:21:54 +00:00
<div class=" text-xs mt-0.5">
2024-11-20 00:47:35 +00:00
<Tooltip
content={model?.user?.email ?? $i18n.t('Deleted User')}
className="flex shrink-0"
placement="top-start"
>
2024-11-18 14:02:14 +00:00
<div class="shrink-0 text-gray-500">
{$i18n.t('By {{name}}', {
2024-11-20 00:47:35 +00:00
name: capitalizeFirstLetter(
model?.user?.name ?? model?.user?.email ?? $i18n.t('Deleted User')
)
2024-11-18 14:02:14 +00:00
})}
</div>
</Tooltip>
2024-05-15 06:16:22 +00:00
</div>
2024-11-18 14:02:14 +00:00
<div class="flex flex-row gap-0.5 items-center">
{#if shiftKey}
2025-05-24 22:32:32 +00:00
<Tooltip content={model?.meta?.hidden ? $i18n.t('Show') : $i18n.t('Hide')}>
<button
class="self-center w-fit text-sm px-2 py-2 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
type="button"
on:click={() => {
hideModelHandler(model);
}}
>
{#if model?.meta?.hidden}
<EyeSlash />
{:else}
<Eye />
{/if}
</button>
</Tooltip>
2024-11-18 14:02:14 +00:00
<Tooltip content={$i18n.t('Delete')}>
<button
class="self-center w-fit text-sm px-2 py-2 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
type="button"
on:click={() => {
deleteModelHandler(model);
}}
>
<GarbageBin />
</button>
</Tooltip>
{:else}
2025-01-19 19:58:58 +00:00
{#if $user?.role === 'admin' || model.user_id === $user?.id || model.access_control.write.group_ids.some( (wg) => group_ids.includes(wg) )}
2024-11-18 14:02:14 +00:00
<a
class="self-center w-fit text-sm px-2 py-2 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
type="button"
href={`/workspace/models/edit?id=${encodeURIComponent(model.id)}`}
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-4 h-4"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"
/>
</svg>
</a>
{/if}
<ModelMenu
user={$user}
{model}
shareHandler={() => {
shareModelHandler(model);
2024-11-17 02:35:14 +00:00
}}
2024-11-18 14:02:14 +00:00
cloneHandler={() => {
cloneModelHandler(model);
}}
exportHandler={() => {
exportModelHandler(model);
}}
hideHandler={() => {
hideModelHandler(model);
}}
2025-05-26 18:29:03 +00:00
copyLinkHandler={() => {
copyLinkHandler(model);
}}
2024-11-18 14:02:14 +00:00
deleteHandler={() => {
selectedModel = model;
showModelDeleteConfirm = true;
}}
onClose={() => {}}
2024-11-17 02:35:14 +00:00
>
2024-11-18 14:02:14 +00:00
<button
class="self-center w-fit text-sm p-1.5 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
type="button"
2024-11-17 02:35:14 +00:00
>
2024-11-18 14:02:14 +00:00
<EllipsisHorizontal className="size-5" />
</button>
</ModelMenu>
<div class="ml-1">
<Tooltip content={model.is_active ? $i18n.t('Enabled') : $i18n.t('Disabled')}>
<Switch
bind:state={model.is_active}
on:change={async (e) => {
toggleModelById(localStorage.token, model.id);
2025-02-12 09:17:30 +00:00
_models.set(
2025-02-12 09:22:53 +00:00
await getModels(
localStorage.token,
2025-02-12 09:32:49 +00:00
$config?.features?.enable_direct_connections &&
2025-02-12 09:22:53 +00:00
($settings?.directConnections ?? null)
)
2025-02-12 09:17:30 +00:00
);
2024-11-18 14:02:14 +00:00
}}
2024-11-17 02:35:14 +00:00
/>
2024-11-18 14:02:14 +00:00
</Tooltip>
</div>
2024-11-17 02:35:14 +00:00
{/if}
2024-11-18 14:02:14 +00:00
</div>
2024-11-17 02:35:14 +00:00
</div>
2024-05-15 06:16:22 +00:00
</div>
2024-11-17 02:35:14 +00:00
{/each}
</div>
{#if $user?.role === 'admin'}
<div class=" flex justify-end w-full mb-3">
<div class="flex space-x-1">
<input
id="models-import-input"
bind:this={modelsImportInputElement}
bind:files={importFiles}
type="file"
accept=".json"
hidden
on:change={() => {
console.log(importFiles);
let reader = new FileReader();
reader.onload = async (event) => {
let savedModels = JSON.parse(event.target.result);
console.log(savedModels);
for (const model of savedModels) {
if (model?.info ?? false) {
if ($_models.find((m) => m.id === model.id)) {
await updateModelById(localStorage.token, model.id, model.info).catch(
(error) => {
return null;
}
);
} else {
await createNewModel(localStorage.token, model.info).catch((error) => {
return null;
});
}
2025-03-31 07:39:20 +00:00
} else {
if (model?.id && model?.name) {
await createNewModel(localStorage.token, model).catch((error) => {
return null;
});
}
2024-11-13 11:09:46 +00:00
}
2024-05-29 21:05:46 +00:00
}
2024-05-15 06:16:22 +00:00
2025-02-12 09:17:30 +00:00
await _models.set(
2025-02-12 09:22:53 +00:00
await getModels(
localStorage.token,
2025-02-12 09:32:49 +00:00
$config?.features?.enable_direct_connections &&
2025-02-12 09:22:53 +00:00
($settings?.directConnections ?? null)
)
2025-02-12 09:17:30 +00:00
);
2024-11-17 02:35:14 +00:00
models = await getWorkspaceModels(localStorage.token);
};
2024-05-15 06:16:22 +00:00
2024-11-17 02:35:14 +00:00
reader.readAsText(importFiles[0]);
}}
/>
2024-05-15 06:16:22 +00:00
2024-11-17 02:35:14 +00:00
<button
class="flex text-xs items-center space-x-1 px-3 py-1.5 rounded-xl bg-gray-50 hover:bg-gray-100 dark:bg-gray-800 dark:hover:bg-gray-700 dark:text-gray-200 transition"
on:click={() => {
modelsImportInputElement.click();
}}
>
<div class=" self-center mr-2 font-medium line-clamp-1">{$i18n.t('Import Models')}</div>
<div class=" self-center">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
fill="currentColor"
class="w-3.5 h-3.5"
>
<path
fill-rule="evenodd"
d="M4 2a1.5 1.5 0 0 0-1.5 1.5v9A1.5 1.5 0 0 0 4 14h8a1.5 1.5 0 0 0 1.5-1.5V6.621a1.5 1.5 0 0 0-.44-1.06L9.94 2.439A1.5 1.5 0 0 0 8.878 2H4Zm4 9.5a.75.75 0 0 1-.75-.75V8.06l-.72.72a.75.75 0 0 1-1.06-1.06l2-2a.75.75 0 0 1 1.06 0l2 2a.75.75 0 1 1-1.06 1.06l-.72-.72v2.69a.75.75 0 0 1-.75.75Z"
clip-rule="evenodd"
/>
</svg>
</div>
</button>
{#if models.length}
<button
class="flex text-xs items-center space-x-1 px-3 py-1.5 rounded-xl bg-gray-50 hover:bg-gray-100 dark:bg-gray-800 dark:hover:bg-gray-700 dark:text-gray-200 transition"
on:click={async () => {
downloadModels(models);
}}
>
<div class=" self-center mr-2 font-medium line-clamp-1">
{$i18n.t('Export Models')} ({models.length})
</div>
2024-11-17 02:35:14 +00:00
<div class=" self-center">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
fill="currentColor"
class="w-3.5 h-3.5"
>
<path
fill-rule="evenodd"
d="M4 2a1.5 1.5 0 0 0-1.5 1.5v9A1.5 1.5 0 0 0 4 14h8a1.5 1.5 0 0 0 1.5-1.5V6.621a1.5 1.5 0 0 0-.44-1.06L9.94 2.439A1.5 1.5 0 0 0 8.878 2H4Zm4 3.5a.75.75 0 0 1 .75.75v2.69l.72-.72a.75.75 0 1 1 1.06 1.06l-2 2a.75.75 0 0 1-1.06 0l-2-2a.75.75 0 0 1 1.06-1.06l.72.72V6.25A.75.75 0 0 1 8 5.5Z"
clip-rule="evenodd"
/>
</svg>
</div>
</button>
{/if}
2024-11-17 02:35:14 +00:00
</div>
</div>
{/if}
2024-11-13 11:09:46 +00:00
2024-11-17 02:35:14 +00:00
{#if $config?.features.enable_community_sharing}
<div class=" my-16">
2024-11-18 14:34:25 +00:00
<div class=" text-xl font-medium mb-1 line-clamp-1">
2025-02-10 06:19:02 +00:00
{$i18n.t('Made by Open WebUI Community')}
2024-11-17 02:35:14 +00:00
</div>
2024-05-15 06:16:22 +00:00
2024-11-17 02:35:14 +00:00
<a
class=" flex cursor-pointer items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-850 w-full mb-2 px-3.5 py-1.5 rounded-xl transition"
href="https://openwebui.com/#open-webui-community"
target="_blank"
2024-11-13 11:09:46 +00:00
>
<div class=" self-center">
2024-11-17 02:35:14 +00:00
<div class=" font-semibold line-clamp-1">{$i18n.t('Discover a model')}</div>
<div class=" text-sm line-clamp-1">
{$i18n.t('Discover, download, and explore model presets')}
</div>
2024-10-19 09:12:34 +00:00
</div>
2024-11-16 01:36:46 +00:00
<div>
2024-11-17 02:35:14 +00:00
<div>
<ChevronRight />
</div>
2024-11-16 01:36:46 +00:00
</div>
2024-11-17 02:35:14 +00:00
</a>
</div>
{/if}
{:else}
<div class="w-full h-full flex justify-center items-center">
2025-06-27 12:15:16 +00:00
<Spinner className="size-5" />
2024-10-19 09:12:34 +00:00
</div>
{/if}