|
@@ -20,6 +20,7 @@
|
|
import { documents, models } from '$lib/stores';
|
|
import { documents, models } from '$lib/stores';
|
|
import { onMount, getContext } from 'svelte';
|
|
import { onMount, getContext } from 'svelte';
|
|
import { toast } from 'svelte-sonner';
|
|
import { toast } from 'svelte-sonner';
|
|
|
|
+ import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
|
|
|
|
|
const i18n = getContext('i18n');
|
|
const i18n = getContext('i18n');
|
|
|
|
|
|
@@ -280,24 +281,28 @@
|
|
viewBox="0 0 24 24"
|
|
viewBox="0 0 24 24"
|
|
fill="currentColor"
|
|
fill="currentColor"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
- ><style>
|
|
|
|
|
|
+ >
|
|
|
|
+ <style>
|
|
.spinner_ajPY {
|
|
.spinner_ajPY {
|
|
transform-origin: center;
|
|
transform-origin: center;
|
|
animation: spinner_AtaB 0.75s infinite linear;
|
|
animation: spinner_AtaB 0.75s infinite linear;
|
|
}
|
|
}
|
|
|
|
+
|
|
@keyframes spinner_AtaB {
|
|
@keyframes spinner_AtaB {
|
|
100% {
|
|
100% {
|
|
transform: rotate(360deg);
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- </style><path
|
|
|
|
|
|
+ </style>
|
|
|
|
+ <path
|
|
d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"
|
|
d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"
|
|
opacity=".25"
|
|
opacity=".25"
|
|
- /><path
|
|
|
|
|
|
+ />
|
|
|
|
+ <path
|
|
d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
|
|
d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
|
|
class="spinner_ajPY"
|
|
class="spinner_ajPY"
|
|
- /></svg
|
|
|
|
- >
|
|
|
|
|
|
+ />
|
|
|
|
+ </svg>
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
{/if}
|
|
</button>
|
|
</button>
|
|
@@ -330,18 +335,13 @@
|
|
{#if embeddingEngine === 'openai'}
|
|
{#if embeddingEngine === 'openai'}
|
|
<div class="my-0.5 flex gap-2">
|
|
<div class="my-0.5 flex gap-2">
|
|
<input
|
|
<input
|
|
- class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
|
|
|
|
|
|
+ class="flex-1 w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
|
|
placeholder={$i18n.t('API Base URL')}
|
|
placeholder={$i18n.t('API Base URL')}
|
|
bind:value={OpenAIUrl}
|
|
bind:value={OpenAIUrl}
|
|
required
|
|
required
|
|
/>
|
|
/>
|
|
|
|
|
|
- <input
|
|
|
|
- class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
|
|
|
|
- placeholder={$i18n.t('API Key')}
|
|
|
|
- bind:value={OpenAIKey}
|
|
|
|
- required
|
|
|
|
- />
|
|
|
|
|
|
+ <SensitiveInput placeholder={$i18n.t('API Key')} bind:value={OpenAIKey} />
|
|
</div>
|
|
</div>
|
|
<div class="flex mt-0.5 space-x-2">
|
|
<div class="flex mt-0.5 space-x-2">
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Embedding Batch Size')}</div>
|
|
<div class=" self-center text-xs font-medium">{$i18n.t('Embedding Batch Size')}</div>
|
|
@@ -439,24 +439,28 @@
|
|
viewBox="0 0 24 24"
|
|
viewBox="0 0 24 24"
|
|
fill="currentColor"
|
|
fill="currentColor"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
- ><style>
|
|
|
|
|
|
+ >
|
|
|
|
+ <style>
|
|
.spinner_ajPY {
|
|
.spinner_ajPY {
|
|
transform-origin: center;
|
|
transform-origin: center;
|
|
animation: spinner_AtaB 0.75s infinite linear;
|
|
animation: spinner_AtaB 0.75s infinite linear;
|
|
}
|
|
}
|
|
|
|
+
|
|
@keyframes spinner_AtaB {
|
|
@keyframes spinner_AtaB {
|
|
100% {
|
|
100% {
|
|
transform: rotate(360deg);
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- </style><path
|
|
|
|
|
|
+ </style>
|
|
|
|
+ <path
|
|
d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"
|
|
d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"
|
|
opacity=".25"
|
|
opacity=".25"
|
|
- /><path
|
|
|
|
|
|
+ />
|
|
|
|
+ <path
|
|
d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
|
|
d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
|
|
class="spinner_ajPY"
|
|
class="spinner_ajPY"
|
|
- /></svg
|
|
|
|
- >
|
|
|
|
|
|
+ />
|
|
|
|
+ </svg>
|
|
</div>
|
|
</div>
|
|
{:else}
|
|
{:else}
|
|
<svg
|
|
<svg
|
|
@@ -512,24 +516,28 @@
|
|
viewBox="0 0 24 24"
|
|
viewBox="0 0 24 24"
|
|
fill="currentColor"
|
|
fill="currentColor"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
- ><style>
|
|
|
|
|
|
+ >
|
|
|
|
+ <style>
|
|
.spinner_ajPY {
|
|
.spinner_ajPY {
|
|
transform-origin: center;
|
|
transform-origin: center;
|
|
animation: spinner_AtaB 0.75s infinite linear;
|
|
animation: spinner_AtaB 0.75s infinite linear;
|
|
}
|
|
}
|
|
|
|
+
|
|
@keyframes spinner_AtaB {
|
|
@keyframes spinner_AtaB {
|
|
100% {
|
|
100% {
|
|
transform: rotate(360deg);
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- </style><path
|
|
|
|
|
|
+ </style>
|
|
|
|
+ <path
|
|
d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"
|
|
d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"
|
|
opacity=".25"
|
|
opacity=".25"
|
|
- /><path
|
|
|
|
|
|
+ />
|
|
|
|
+ <path
|
|
d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
|
|
d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
|
|
class="spinner_ajPY"
|
|
class="spinner_ajPY"
|
|
- /></svg
|
|
|
|
- >
|
|
|
|
|
|
+ />
|
|
|
|
+ </svg>
|
|
</div>
|
|
</div>
|
|
{:else}
|
|
{:else}
|
|
<svg
|
|
<svg
|