Unverified Commit b8d7fdf1 authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #1965 from open-webui/dev

0.1.124
parents 30b05311 b44ae536
......@@ -177,7 +177,7 @@
</script>
<div class=" hidden lg:flex fixed bottom-0 right-0 px-3 py-3 z-10">
<Tooltip content="Help" placement="left">
<Tooltip content={$i18n.t('Help')} placement="left">
<button
id="show-shortcuts-button"
bind:this={showShortcutsButtonElement}
......@@ -201,11 +201,11 @@
>
{#if loaded}
{#if !['user', 'admin'].includes($user.role)}
<div class="fixed w-full h-full flex z-50">
<div class="fixed w-full h-full flex z-[999]">
<div
class="absolute w-full h-full backdrop-blur-md bg-white/20 dark:bg-gray-900/50 flex justify-center"
class="absolute w-full h-full backdrop-blur-lg bg-white/10 dark:bg-gray-900/50 flex justify-center"
>
<div class="m-auto pb-44 flex flex-col justify-center">
<div class="m-auto pb-10 flex flex-col justify-center">
<div class="max-w-md">
<div class="text-center dark:text-white text-2xl font-medium z-50">
Account Activation Pending<br /> Contact Admin for WebUI Access
......
......@@ -134,6 +134,14 @@
selectedModels = [''];
}
if ($page.url.searchParams.get('q')) {
prompt = $page.url.searchParams.get('q') ?? '';
if (prompt) {
await tick();
submitPrompt(prompt);
}
}
selectedModels = selectedModels.map((modelId) =>
$models.map((m) => m.id).includes(modelId) ? modelId : ''
);
......@@ -366,7 +374,8 @@
},
format: $settings.requestFormat ?? undefined,
keep_alive: $settings.keepAlive ?? undefined,
docs: docs.length > 0 ? docs : undefined
docs: docs.length > 0 ? docs : undefined,
citations: docs.length > 0
});
if (res && res.ok) {
......@@ -401,6 +410,11 @@
console.log(line);
let data = JSON.parse(line);
if ('citations' in data) {
responseMessage.citations = data.citations;
continue;
}
if ('detail' in data) {
throw data;
}
......@@ -598,7 +612,8 @@
num_ctx: $settings?.options?.num_ctx ?? undefined,
frequency_penalty: $settings?.options?.repeat_penalty ?? undefined,
max_tokens: $settings?.options?.num_predict ?? undefined,
docs: docs.length > 0 ? docs : undefined
docs: docs.length > 0 ? docs : undefined,
citations: docs.length > 0
},
model?.source?.toLowerCase() === 'litellm'
? `${LITELLM_API_BASE_URL}/v1`
......@@ -614,7 +629,7 @@
const textStream = await createOpenAITextStream(res.body, $settings.splitLargeChunks);
for await (const update of textStream) {
const { value, done } = update;
const { value, done, citations } = update;
if (done || stopResponseFlag || _chatId !== $chatId) {
responseMessage.done = true;
messages = messages;
......@@ -626,6 +641,11 @@
break;
}
if (citations) {
responseMessage.citations = citations;
continue;
}
if (responseMessage.content == '' && value == '\n') {
continue;
} else {
......
......@@ -110,7 +110,7 @@
<div class=" flex flex-col justify-center">
<div class=" px-6 pt-4">
<div class=" flex justify-between items-center">
<div class="flex items-center text-2xl font-semibold">Dashboard</div>
<div class="flex items-center text-2xl font-semibold">{$i18n.t('Dashboard')}</div>
<div>
<Tooltip content={$i18n.t('Admin Settings')}>
<button
......@@ -141,7 +141,9 @@
</div>
<div class="px-6 flex text-sm gap-2.5">
<div class="py-3 border-b font-medium text-gray-100 cursor-pointer">Overview</div>
<div class="py-3 border-b font-medium text-gray-100 cursor-pointer">
{$i18n.t('Overview')}
</div>
<!-- <div class="py-3 text-gray-300 cursor-pointer">Users</div> -->
</div>
......@@ -268,7 +270,7 @@
<td class="px-3 py-2 text-right">
<div class="flex justify-end w-full">
{#if user.role !== 'admin'}
<Tooltip content="Chats">
<Tooltip content={$i18n.t('Chats')}>
<button
class="self-center w-fit text-sm px-2 py-2 hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
on:click={async () => {
......
......@@ -378,7 +378,8 @@
},
format: $settings.requestFormat ?? undefined,
keep_alive: $settings.keepAlive ?? undefined,
docs: docs.length > 0 ? docs : undefined
docs: docs.length > 0 ? docs : undefined,
citations: docs.length > 0
});
if (res && res.ok) {
......@@ -413,6 +414,11 @@
console.log(line);
let data = JSON.parse(line);
if ('citations' in data) {
responseMessage.citations = data.citations;
continue;
}
if ('detail' in data) {
throw data;
}
......@@ -610,7 +616,8 @@
num_ctx: $settings?.options?.num_ctx ?? undefined,
frequency_penalty: $settings?.options?.repeat_penalty ?? undefined,
max_tokens: $settings?.options?.num_predict ?? undefined,
docs: docs.length > 0 ? docs : undefined
docs: docs.length > 0 ? docs : undefined,
citations: docs.length > 0
},
model?.source?.toLowerCase() === 'litellm'
? `${LITELLM_API_BASE_URL}/v1`
......@@ -626,7 +633,7 @@
const textStream = await createOpenAITextStream(res.body, $settings.splitLargeChunks);
for await (const update of textStream) {
const { value, done } = update;
const { value, done, citations } = update;
if (done || stopResponseFlag || _chatId !== $chatId) {
responseMessage.done = true;
messages = messages;
......@@ -638,6 +645,11 @@
break;
}
if (citations) {
responseMessage.citations = citations;
continue;
}
if (responseMessage.content == '' && value == '\n') {
continue;
} else {
......
......@@ -60,7 +60,7 @@
await goto('/');
}
loaded = true;
if ($config?.trusted_header_auth ?? false) {
if (($config?.trusted_header_auth ?? false) || $config?.auth === false) {
await signInHandler();
}
});
......@@ -81,7 +81,7 @@
</div>
</div>
<div class=" bg-white dark:bg-gray-900 min-h-screen w-full flex justify-center font-mona">
<div class=" bg-white dark:bg-gray-950 min-h-screen w-full flex justify-center font-mona">
<!-- <div class="hidden lg:flex lg:flex-1 px-10 md:px-16 w-full bg-yellow-50 justify-center">
<div class=" my-auto pb-16 text-left">
<div>
......@@ -96,8 +96,8 @@
</div>
</div> -->
<div class="w-full sm:max-w-lg px-4 min-h-screen flex flex-col">
{#if $config?.trusted_header_auth ?? false}
<div class="w-full sm:max-w-md px-10 min-h-screen flex flex-col text-center">
{#if ($config?.trusted_header_auth ?? false) || $config?.auth === false}
<div class=" my-auto pb-10 w-full">
<div
class="flex items-center justify-center gap-3 text-xl sm:text-2xl text-center font-bold dark:text-gray-200"
......@@ -114,27 +114,29 @@
</div>
</div>
{:else}
<div class=" my-auto pb-10 w-full">
<div class=" my-auto pb-10 w-full dark:text-gray-100">
<form
class=" flex flex-col justify-center bg-white py-6 sm:py-16 px-6 sm:px-16 rounded-2xl"
class=" flex flex-col justify-center"
on:submit|preventDefault={() => {
submitHandler();
}}
>
<div class=" text-xl sm:text-2xl font-bold">
{mode === 'signin' ? $i18n.t('Sign in') : $i18n.t('Sign up')}
{$i18n.t('to')}
{$WEBUI_NAME}
</div>
{#if mode === 'signup'}
<div class=" mt-1 text-xs font-medium text-gray-500">
ⓘ {$WEBUI_NAME}
{$i18n.t(
'does not make any external connections, and your data stays securely on your locally hosted server.'
)}
<div class="mb-1">
<div class=" text-2xl font-bold">
{mode === 'signin' ? $i18n.t('Sign in') : $i18n.t('Sign up')}
{$i18n.t('to')}
{$WEBUI_NAME}
</div>
{/if}
{#if mode === 'signup'}
<div class=" mt-1 text-xs font-medium text-gray-500">
ⓘ {$WEBUI_NAME}
{$i18n.t(
'does not make any external connections, and your data stays securely on your locally hosted server.'
)}
</div>
{/if}
</div>
<div class="flex flex-col mt-4">
{#if mode === 'signup'}
......@@ -143,14 +145,14 @@
<input
bind:value={name}
type="text"
class=" border px-4 py-2.5 rounded-2xl w-full text-sm"
class=" px-5 py-3 rounded-2xl w-full text-sm outline-none border dark:border-none dark:bg-gray-900"
autocomplete="name"
placeholder={$i18n.t('Enter Your Full Name')}
required
/>
</div>
<hr class=" my-3" />
<hr class=" my-3 dark:border-gray-900" />
{/if}
<div class="mb-2">
......@@ -158,7 +160,7 @@
<input
bind:value={email}
type="email"
class=" border px-4 py-2.5 rounded-2xl w-full text-sm"
class=" px-5 py-3 rounded-2xl w-full text-sm outline-none border dark:border-none dark:bg-gray-900"
autocomplete="email"
placeholder={$i18n.t('Enter Your Email')}
required
......@@ -167,10 +169,11 @@
<div>
<div class=" text-sm font-semibold text-left mb-1">{$i18n.t('Password')}</div>
<input
bind:value={password}
type="password"
class=" border px-4 py-2.5 rounded-2xl w-full text-sm"
class=" px-5 py-3 rounded-2xl w-full text-sm outline-none border dark:border-none dark:bg-gray-900"
placeholder={$i18n.t('Enter Your Password')}
autocomplete="current-password"
required
......@@ -180,7 +183,7 @@
<div class="mt-5">
<button
class=" bg-gray-900 hover:bg-gray-800 w-full rounded-full text-white font-semibold text-sm py-3 transition"
class=" bg-gray-900 hover:bg-gray-800 w-full rounded-2xl text-white font-semibold text-sm py-3 transition"
type="submit"
>
{mode === 'signin' ? $i18n.t('Sign in') : $i18n.t('Create Account')}
......
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>Open WebUI</ShortName>
<Description>Search Open WebUI</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">http://localhost:5137/favicon.png</Image>
<Url type="text/html" method="get" template="http://localhost:5137/?q={searchTerms}"/>
<moz:SearchForm>http://localhost:5137</moz:SearchForm>
</OpenSearchDescription>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment