Commit 1efa25ee authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

chore: format

parent 54b65a89
......@@ -33,7 +33,11 @@ from utils.utils import (
from utils.misc import parse_duration, validate_email_format
from utils.webhook import post_webhook
from constants import ERROR_MESSAGES, WEBHOOK_MESSAGES
from config import WEBUI_AUTH, WEBUI_AUTH_TRUSTED_EMAIL_HEADER, WEBUI_AUTH_TRUSTED_NAME_HEADER
from config import (
WEBUI_AUTH,
WEBUI_AUTH_TRUSTED_EMAIL_HEADER,
WEBUI_AUTH_TRUSTED_NAME_HEADER,
)
router = APIRouter()
......@@ -112,7 +116,9 @@ async def signin(request: Request, form_data: SigninForm):
trusted_email = request.headers[WEBUI_AUTH_TRUSTED_EMAIL_HEADER].lower()
trusted_name = trusted_email
if WEBUI_AUTH_TRUSTED_NAME_HEADER:
trusted_name = request.headers.get(WEBUI_AUTH_TRUSTED_NAME_HEADER, trusted_email)
trusted_name = request.headers.get(
WEBUI_AUTH_TRUSTED_NAME_HEADER, trusted_email
)
if not Users.get_user_by_email(trusted_email.lower()):
await signup(
request,
......
......@@ -294,9 +294,7 @@ WEBUI_AUTH = os.environ.get("WEBUI_AUTH", "True").lower() == "true"
WEBUI_AUTH_TRUSTED_EMAIL_HEADER = os.environ.get(
"WEBUI_AUTH_TRUSTED_EMAIL_HEADER", None
)
WEBUI_AUTH_TRUSTED_NAME_HEADER = os.environ.get(
"WEBUI_AUTH_TRUSTED_NAME_HEADER", None
)
WEBUI_AUTH_TRUSTED_NAME_HEADER = os.environ.get("WEBUI_AUTH_TRUSTED_NAME_HEADER", None)
JWT_EXPIRES_IN = PersistentConfig(
"JWT_EXPIRES_IN", "auth.jwt_expiry", os.environ.get("JWT_EXPIRES_IN", "-1")
)
......
......@@ -80,7 +80,11 @@
class="text-xs text-gray-700 uppercase bg-transparent dark:text-gray-200 border-b-2 dark:border-gray-800"
>
<tr>
<th scope="col" class="px-3 py-2 cursor-pointer select-none" on:click={() => setSortKey('title')}>
<th
scope="col"
class="px-3 py-2 cursor-pointer select-none"
on:click={() => setSortKey('title')}
>
{$i18n.t('Title')}
{#if sortKey === 'title'}
{sortOrder === 'asc' ? '▲' : '▼'}
......@@ -88,7 +92,11 @@
<span class="invisible">▲</span>
{/if}
</th>
<th scope="col" class="px-3 py-2 cursor-pointer select-none" on:click={() => setSortKey('created_at')}>
<th
scope="col"
class="px-3 py-2 cursor-pointer select-none"
on:click={() => setSortKey('created_at')}
>
{$i18n.t('Created at')}
{#if sortKey === 'created_at'}
{sortOrder === 'asc' ? '▲' : '▼'}
......@@ -96,7 +104,11 @@
<span class="invisible">▲</span>
{/if}
</th>
<th scope="col" class="px-3 py-2 hidden md:flex cursor-pointer select-none" on:click={() => setSortKey('updated_at')}>
<th
scope="col"
class="px-3 py-2 hidden md:flex cursor-pointer select-none"
on:click={() => setSortKey('updated_at')}
>
{$i18n.t('Updated at')}
{#if sortKey === 'updated_at'}
{sortOrder === 'asc' ? '▲' : '▼'}
......@@ -108,12 +120,11 @@
</tr>
</thead>
<tbody>
{#each chats
.sort((a, b) => {
if (a[sortKey] < b[sortKey]) return sortOrder === 'asc' ? -1 : 1;
if (a[sortKey] > b[sortKey]) return sortOrder === 'asc' ? 1 : -1;
return 0;
}) as chat, idx}
{#each chats.sort((a, b) => {
if (a[sortKey] < b[sortKey]) return sortOrder === 'asc' ? -1 : 1;
if (a[sortKey] > b[sortKey]) return sortOrder === 'asc' ? 1 : -1;
return 0;
}) as chat, idx}
<tr
class="bg-transparent {idx !== chats.length - 1 &&
'border-b'} dark:bg-gray-900 dark:border-gray-850 text-xs"
......
......@@ -499,6 +499,7 @@
"System": "النظام",
"System Prompt": "محادثة النظام",
"Tags": "الوسوم",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "أخبرنا المزيد:",
"Temperature": "درجة حرارة",
......@@ -545,6 +546,7 @@
"Update": "",
"Update and Copy Link": "تحديث ونسخ الرابط",
"Update password": "تحديث كلمة المرور",
"Updated at": "",
"Upload a GGUF model": "GGUF رفع موديل نوع",
"Upload Files": "تحميل الملفات",
"Upload Pipeline": "",
......
......@@ -495,6 +495,7 @@
"System": "Система",
"System Prompt": "Системен Промпт",
"Tags": "Тагове",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "Повече информация:",
"Temperature": "Температура",
......@@ -541,6 +542,7 @@
"Update": "",
"Update and Copy Link": "Обнови и копирай връзка",
"Update password": "Обновяване на парола",
"Updated at": "",
"Upload a GGUF model": "Качване на GGUF модел",
"Upload Files": "Качване на файлове",
"Upload Pipeline": "",
......
......@@ -495,6 +495,7 @@
"System": "সিস্টেম",
"System Prompt": "সিস্টেম প্রম্পট",
"Tags": "ট্যাগসমূহ",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "আরও বলুন:",
"Temperature": "তাপমাত্রা",
......@@ -541,6 +542,7 @@
"Update": "",
"Update and Copy Link": "আপডেট এবং লিংক কপি করুন",
"Update password": "পাসওয়ার্ড আপডেট করুন",
"Updated at": "",
"Upload a GGUF model": "একটি GGUF মডেল আপলোড করুন",
"Upload Files": "ফাইল আপলোড করুন",
"Upload Pipeline": "",
......
......@@ -496,6 +496,7 @@
"System": "Sistema",
"System Prompt": "Prompt del Sistema",
"Tags": "Etiquetes",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "Dóna'ns més informació:",
"Temperature": "Temperatura",
......@@ -542,6 +543,7 @@
"Update": "",
"Update and Copy Link": "Actualitza i Copia enllaç",
"Update password": "Actualitza contrasenya",
"Updated at": "",
"Upload a GGUF model": "Puja un model GGUF",
"Upload Files": "Pujar fitxers",
"Upload Pipeline": "",
......
......@@ -495,6 +495,7 @@
"System": "Sistema",
"System Prompt": "Madasig nga Sistema",
"Tags": "Mga tag",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "",
"Temperature": "Temperatura",
......@@ -541,6 +542,7 @@
"Update": "",
"Update and Copy Link": "",
"Update password": "I-update ang password",
"Updated at": "",
"Upload a GGUF model": "Pag-upload ug modelo sa GGUF",
"Upload Files": "",
"Upload Pipeline": "",
......
......@@ -495,6 +495,7 @@
"System": "System",
"System Prompt": "System-Prompt",
"Tags": "Tags",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "Erzähl uns mehr",
"Temperature": "Temperatur",
......@@ -541,6 +542,7 @@
"Update": "",
"Update and Copy Link": "Erneuern und kopieren",
"Update password": "Passwort aktualisieren",
"Updated at": "",
"Upload a GGUF model": "GGUF Model hochladen",
"Upload Files": "Dateien hochladen",
"Upload Pipeline": "",
......
......@@ -495,6 +495,7 @@
"System": "System very system",
"System Prompt": "System Prompt much prompt",
"Tags": "Tags very tags",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "",
"Temperature": "Temperature very temp",
......@@ -541,6 +542,7 @@
"Update": "",
"Update and Copy Link": "",
"Update password": "Update password much change",
"Updated at": "",
"Upload a GGUF model": "Upload a GGUF model very upload",
"Upload Files": "",
"Upload Pipeline": "",
......
......@@ -495,6 +495,7 @@
"System": "",
"System Prompt": "",
"Tags": "",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "",
"Temperature": "",
......@@ -541,6 +542,7 @@
"Update": "",
"Update and Copy Link": "",
"Update password": "",
"Updated at": "",
"Upload a GGUF model": "",
"Upload Files": "",
"Upload Pipeline": "",
......
......@@ -495,6 +495,7 @@
"System": "",
"System Prompt": "",
"Tags": "",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "",
"Temperature": "",
......@@ -541,6 +542,7 @@
"Update": "",
"Update and Copy Link": "",
"Update password": "",
"Updated at": "",
"Upload a GGUF model": "",
"Upload Files": "",
"Upload Pipeline": "",
......
......@@ -496,6 +496,7 @@
"System": "Sistema",
"System Prompt": "Prompt del sistema",
"Tags": "Etiquetas",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "Dinos más:",
"Temperature": "Temperatura",
......@@ -542,6 +543,7 @@
"Update": "",
"Update and Copy Link": "Actualizar y copiar enlace",
"Update password": "Actualizar contraseña",
"Updated at": "",
"Upload a GGUF model": "Subir un modelo GGUF",
"Upload Files": "Subir archivos",
"Upload Pipeline": "",
......
......@@ -495,6 +495,7 @@
"System": "سیستم",
"System Prompt": "پرامپت سیستم",
"Tags": "تگ\u200cها",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "بیشتر بگویید:",
"Temperature": "دما",
......@@ -541,6 +542,7 @@
"Update": "",
"Update and Copy Link": "به روزرسانی و کپی لینک",
"Update password": "به روزرسانی رمزعبور",
"Updated at": "",
"Upload a GGUF model": "آپلود یک مدل GGUF",
"Upload Files": "بارگذاری پروندهها",
"Upload Pipeline": "",
......
......@@ -495,6 +495,7 @@
"System": "Järjestelmä",
"System Prompt": "Järjestelmäkehote",
"Tags": "Tagit",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "Kerro lisää:",
"Temperature": "Lämpötila",
......@@ -541,6 +542,7 @@
"Update": "",
"Update and Copy Link": "Päivitä ja kopioi linkki",
"Update password": "Päivitä salasana",
"Updated at": "",
"Upload a GGUF model": "Lataa GGUF-malli",
"Upload Files": "Lataa tiedostoja",
"Upload Pipeline": "",
......
......@@ -496,6 +496,7 @@
"System": "Système",
"System Prompt": "Prompt Système",
"Tags": "Tags",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "Donnez-nous plus:",
"Temperature": "Température",
......@@ -542,6 +543,7 @@
"Update": "",
"Update and Copy Link": "Mettre à jour et copier le lien",
"Update password": "Mettre à jour le mot de passe",
"Updated at": "",
"Upload a GGUF model": "Téléverser un modèle GGUF",
"Upload Files": "Téléverser des fichiers",
"Upload Pipeline": "",
......
......@@ -496,6 +496,7 @@
"System": "Système",
"System Prompt": "Prompt du Système",
"Tags": "Tags",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "Dites-nous en plus :",
"Temperature": "Température",
......@@ -542,6 +543,7 @@
"Update": "",
"Update and Copy Link": "Mettre à Jour et Copier le Lien",
"Update password": "Mettre à Jour le Mot de Passe",
"Updated at": "",
"Upload a GGUF model": "Téléverser un modèle GGUF",
"Upload Files": "Téléverser des fichiers",
"Upload Pipeline": "",
......
......@@ -496,6 +496,7 @@
"System": "מערכת",
"System Prompt": "תגובת מערכת",
"Tags": "תגיות",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "תרשמו יותר:",
"Temperature": "טמפרטורה",
......@@ -542,6 +543,7 @@
"Update": "",
"Update and Copy Link": "עדכן ושכפל קישור",
"Update password": "עדכן סיסמה",
"Updated at": "",
"Upload a GGUF model": "העלה מודל GGUF",
"Upload Files": "העלאת קבצים",
"Upload Pipeline": "",
......
......@@ -495,6 +495,7 @@
"System": "सिस्टम",
"System Prompt": "सिस्टम प्रॉम्प्ट",
"Tags": "टैग",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "हमें और अधिक बताएँ:",
"Temperature": "टेंपेरेचर",
......@@ -541,6 +542,7 @@
"Update": "",
"Update and Copy Link": "अपडेट करें और लिंक कॉपी करें",
"Update password": "पासवर्ड अपडेट करें",
"Updated at": "",
"Upload a GGUF model": "GGUF मॉडल अपलोड करें",
"Upload Files": "फ़ाइलें अपलोड करें",
"Upload Pipeline": "",
......
......@@ -496,6 +496,7 @@
"System": "Sustav",
"System Prompt": "Sistemski prompt",
"Tags": "Oznake",
"Tap to interrupt": "",
"Tavily API Key": "",
"Tell us more:": "Recite nam više:",
"Temperature": "Temperatura",
......@@ -542,6 +543,7 @@
"Update": "",
"Update and Copy Link": "Ažuriraj i kopiraj vezu",
"Update password": "Ažuriraj lozinku",
"Updated at": "",
"Upload a GGUF model": "Učitaj GGUF model",
"Upload Files": "Prijenos datoteka",
"Upload Pipeline": "Prijenos kanala",
......
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