mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-22 21:50:42 -05:00
refac
This commit is contained in:
1 parent
b130c7f754
commit
9a379eaa73
9 files changed
+30
-6
No files matched your search
@@ -142,6 +142,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml-12 mt-2 flex justify-between text-[0.625rem] tabular-nums">
|
||||
<!-- {$i18n.t('Response order')} -->
|
||||
<span>{bars[0].first}</span><span>{$i18n.t('Response order')}</span><span
|
||||
>{bars[bars.length - 1].last}</span
|
||||
>
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
<span></span>
|
||||
<div class="flex justify-between">
|
||||
{#if sequence}
|
||||
<!-- {$i18n.t('Saved order')} -->
|
||||
<span>1</span><span>{$i18n.t('Saved order')}</span><span>{bars.length}</span>
|
||||
{:else}
|
||||
<span>0s</span><span>{duration(span / 2)}</span><span>{duration(span)}</span>
|
||||
|
||||
@@ -551,6 +551,13 @@
|
||||
aria-hidden="true"><circle cx="8" cy="8" r="5.75" /><path d="M8 5v3l2 1.5" /></svg
|
||||
>{$i18n.t('Next run')}
|
||||
</span>
|
||||
<!-- localisation keys kept from the previous runs list (so they don't get automatically removed):
|
||||
{$i18n.t('Runs')}
|
||||
{$i18n.t('Last run')}
|
||||
{$i18n.t('No runs yet')}
|
||||
{$i18n.t('View chat')}
|
||||
{$i18n.t('View channel')}
|
||||
-->
|
||||
<span
|
||||
class="min-w-0 flex-1 truncate text-xs {is_active
|
||||
? 'text-gray-700 dark:text-gray-300'
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
import { RealtimeCall, getBridgeTurnState, type BridgeSubmission } from '$lib/utils/realtime';
|
||||
import { acquireWakeLock } from '$lib/utils/wakeLock';
|
||||
import { routeAvatarAnimation } from '$lib/utils/voice-avatar';
|
||||
import { createTemporaryChatId, isTemporaryChatId } from '$lib/utils/chatId';
|
||||
import { createTemporaryChatId, isSavedChatId, isTemporaryChatId } from '$lib/utils/chatId';
|
||||
import { canUseTemporaryChats } from '$lib/utils/settings-access';
|
||||
import { resumeTemporaryChat } from '$lib/apis';
|
||||
import {
|
||||
@@ -177,7 +177,8 @@
|
||||
export let chatIdProp = '';
|
||||
export let initialPage = '';
|
||||
let mainChatHref = '/';
|
||||
$: if ($chatId) mainChatHref = `/c/${$chatId}`;
|
||||
// Unsaved chats have no /c/ page, so they keep the new-chat address set by initNewChat.
|
||||
$: if (isSavedChatId($chatId)) mainChatHref = `/c/${$chatId}`;
|
||||
export let embedded = false;
|
||||
export let tabbed = false;
|
||||
const chatId = embedded ? writable('') : _chatId;
|
||||
|
||||
@@ -1140,7 +1140,9 @@
|
||||
return clampToFileRoot(path);
|
||||
};
|
||||
|
||||
const buildBreadcrumbs = (path: string) => {
|
||||
$: rootLabel = fileRoot?.path === homeDirectory ? $i18n.t('Home') : (fileRoot?.label ?? '');
|
||||
|
||||
const buildBreadcrumbs = (path: string, rootLabel: string) => {
|
||||
if (fileRoot) {
|
||||
const directory = clampToFileRoot(path);
|
||||
const relative = directory === fileRoot.path ? '' : directory.slice(fileRoot.path.length);
|
||||
@@ -1151,7 +1153,7 @@
|
||||
acc.push({ label: part, path: asDirectoryPath(joinPath(prev.path, part)) });
|
||||
return acc;
|
||||
},
|
||||
[{ label: fileRoot.label, path: fileRoot.path }]
|
||||
[{ label: rootLabel, path: fileRoot.path }]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2489,7 +2491,7 @@
|
||||
showGitDiff = !showGitDiff;
|
||||
fileAsk = null;
|
||||
}}
|
||||
breadcrumbs={buildBreadcrumbs(currentPath)}
|
||||
breadcrumbs={buildBreadcrumbs(currentPath, rootLabel)}
|
||||
{selectedFile}
|
||||
fileSize={openedFile?.size ?? pendingFile?.size}
|
||||
{loading}
|
||||
|
||||
@@ -1768,7 +1768,7 @@
|
||||
: null;
|
||||
if (href) {
|
||||
const url = new URL(href, location.origin);
|
||||
if (active?.id === mainChatTabId && !chatId) {
|
||||
if (active?.id === mainChatTabId && !isSavedChatId(chatId)) {
|
||||
// delete() re-encodes the other parameters even when it removes nothing.
|
||||
if ($temporaryChat !== ($settings?.temporaryChatByDefault ?? false))
|
||||
url.searchParams.set('temporary-chat', String($temporaryChat));
|
||||
|
||||
@@ -796,6 +796,7 @@
|
||||
<p
|
||||
class="flex flex-1 items-center justify-center p-4 text-center text-sm text-gray-500 dark:text-gray-400"
|
||||
>
|
||||
<!-- {$i18n.t('This sheet is too large to preview. Download it to view all cells.')} -->
|
||||
{t('This sheet is too large to preview. Download it to view all cells.')}
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
@@ -138,6 +138,14 @@
|
||||
type="button"
|
||||
>
|
||||
<svelte:component this={heading.icon} />
|
||||
<!-- localisation keys for heading.label to be recognized from the i18next parser (so they don't get automatically removed):
|
||||
{$i18n.t('Heading 1')}
|
||||
{$i18n.t('Heading 2')}
|
||||
{$i18n.t('Heading 3')}
|
||||
{$i18n.t('H1')}
|
||||
{$i18n.t('H2')}
|
||||
{$i18n.t('H3')}
|
||||
-->
|
||||
{$i18n.t(heading.label)}
|
||||
</button>
|
||||
{/each}
|
||||
|
||||
@@ -187,6 +187,9 @@
|
||||
$: canDeleteChats = $user?.role === 'admin' || ($user?.permissions?.chat?.delete ?? true);
|
||||
setContext('sidebar-chat-selection', chatSelection);
|
||||
|
||||
// Keeps the selection bar's aria-labels in the i18n catalogs; the parser misses them in the markup.
|
||||
// $i18n.t('Archive selected chats')
|
||||
// $i18n.t('Delete selected chats')
|
||||
const applySelectedChatAction = async (action: 'archive' | 'delete', ids: string[]) => {
|
||||
if ($selectionBusy || ids.length === 0 || (action === 'delete' && !canDeleteChats)) return;
|
||||
selectionBusy.set(true);
|
||||
|
||||
Reference in new issue
Block a user