This commit is contained in:
Timothy Jaeryang Baek
2026-01-29 20:15:23 +04:00
parent 93ed4ae2cd
commit bc90463ea6
2 changed files with 38 additions and 2 deletions

View File

@@ -5,6 +5,7 @@
import { config, models, tags as _tags } from '$lib/stores';
import Tags from '$lib/components/common/Tags.svelte';
import XMark from '$lib/components/icons/XMark.svelte';
import ChevronRight from '$lib/components/icons/ChevronRight.svelte';
const i18n = getContext('i18n');
@@ -248,4 +249,20 @@
{$i18n.t('Save')}
</button>
</div>
{#if $config?.features.enable_community_sharing && message?.model}
<div class="mt-3 pt-3 border-t border-gray-100/30 dark:border-gray-850/30">
<a
href={`https://openwebui.com/models?q=${encodeURIComponent(message.model)}`}
target="_blank"
class="flex cursor-pointer items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-850 w-full px-3 py-2 rounded-xl transition"
>
<div class="self-center">
<div class="text-sm font-medium">{$i18n.t('Leave a review for {{modelName}}', { modelName: message.model })}</div>
<div class="text-xs text-gray-500">{$i18n.t('Help the community discover great models')}</div>
</div>
<ChevronRight className="size-4" />
</a>
</div>
{/if}
</div>

View File

@@ -9,7 +9,8 @@
import PinSlash from '$lib/components/icons/PinSlash.svelte';
import DocumentDuplicate from '$lib/components/icons/DocumentDuplicate.svelte';
import Link from '$lib/components/icons/Link.svelte';
import { settings } from '$lib/stores';
import { config, settings } from '$lib/stores';
import GlobeAlt from '$lib/components/icons/GlobeAlt.svelte';
const i18n = getContext('i18n');
@@ -45,7 +46,7 @@
<DropdownMenu.Content
strategy="fixed"
class="w-full max-w-[180px] text-sm rounded-2xl p-1 z-[9999999] bg-white dark:bg-gray-850 dark:text-white shadow-lg border border-gray-100 dark:border-gray-800"
class="w-full max-w-[210px] text-sm rounded-2xl p-1 z-[9999999] bg-white dark:bg-gray-850 dark:text-white shadow-lg border border-gray-100 dark:border-gray-800"
sideOffset={-2}
side="bottom"
align="end"
@@ -93,5 +94,23 @@
<div class="flex items-center">{$i18n.t('Copy Link')}</div>
</DropdownMenu.Item>
{#if $config?.features.enable_community_sharing}
<DropdownMenu.Item
type="button"
class="flex rounded-xl py-1.5 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition items-center gap-2"
on:click={(e) => {
e.stopPropagation();
e.preventDefault();
window.open(`https://openwebui.com/models?q=${encodeURIComponent(model?.id ?? '')}`, '_blank');
show = false;
}}
>
<GlobeAlt className="size-4" />
<div class="flex items-center">{$i18n.t('Community Reviews')}</div>
</DropdownMenu.Item>
{/if}
</DropdownMenu.Content>
</DropdownMenu.Root>