Skip to content

Commit f7e85cd

Browse files
committed
refac
1 parent 4b4583d commit f7e85cd

File tree

4 files changed

+99
-88
lines changed

4 files changed

+99
-88
lines changed

src/app.html

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,35 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<link rel="icon" type="image/png" href="/static/favicon.png" crossorigin="use-credentials"/>
6-
<link rel="icon" type="image/png" href="/static/favicon-96x96.png" sizes="96x96" crossorigin="use-credentials" />
7-
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg" crossorigin="use-credentials"/>
8-
<link rel="shortcut icon" href="/static/favicon.ico" crossorigin="use-credentials"/>
9-
<link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png" crossorigin="use-credentials" />
5+
<link rel="icon" type="image/png" href="/static/favicon.png" crossorigin="use-credentials" />
6+
<link
7+
rel="icon"
8+
type="image/png"
9+
href="/static/favicon-96x96.png"
10+
sizes="96x96"
11+
crossorigin="use-credentials"
12+
/>
13+
<link
14+
rel="icon"
15+
type="image/svg+xml"
16+
href="/static/favicon.svg"
17+
crossorigin="use-credentials"
18+
/>
19+
<link rel="shortcut icon" href="/static/favicon.ico" crossorigin="use-credentials" />
20+
<link
21+
rel="apple-touch-icon"
22+
sizes="180x180"
23+
href="/static/apple-touch-icon.png"
24+
crossorigin="use-credentials"
25+
/>
1026
<meta name="apple-mobile-web-app-title" content="Open WebUI" />
1127

12-
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials" crossorigin="use-credentials" />
28+
<link
29+
rel="manifest"
30+
href="/manifest.json"
31+
crossorigin="use-credentials"
32+
crossorigin="use-credentials"
33+
/>
1334
<meta
1435
name="viewport"
1536
content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover"

src/lib/components/admin/Settings/Documents.svelte

Lines changed: 70 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@
152152
return;
153153
}
154154
if (
155-
RAGConfig.CONTENT_EXTRACTION_ENGINE === 'docling' &&
156-
RAGConfig.DOCLING_DO_OCR &&
155+
RAGConfig.CONTENT_EXTRACTION_ENGINE === 'docling' &&
156+
RAGConfig.DOCLING_DO_OCR &&
157157
((RAGConfig.DOCLING_OCR_ENGINE === '' && RAGConfig.DOCLING_OCR_LANG !== '') ||
158158
(RAGConfig.DOCLING_OCR_ENGINE !== '' && RAGConfig.DOCLING_OCR_LANG === ''))
159159
) {
@@ -164,12 +164,10 @@
164164
}
165165
if (
166166
RAGConfig.CONTENT_EXTRACTION_ENGINE === 'docling' &&
167-
RAGConfig.DOCLING_DO_OCR === false &&
168-
RAGConfig.DOCLING_FORCE_OCR === true
167+
RAGConfig.DOCLING_DO_OCR === false &&
168+
RAGConfig.DOCLING_FORCE_OCR === true
169169
) {
170-
toast.error(
171-
$i18n.t('In order to force OCR, performing OCR must be enabled.')
172-
);
170+
toast.error($i18n.t('In order to force OCR, performing OCR must be enabled.'));
173171
return;
174172
}
175173
@@ -555,7 +553,7 @@
555553
placeholder={$i18n.t('Enter Docling Server URL')}
556554
bind:value={RAGConfig.DOCLING_SERVER_URL}
557555
/>
558-
</div>
556+
</div>
559557

560558
<div class="flex w-full mt-2">
561559
<div class="flex-1 flex justify-between">
@@ -568,19 +566,19 @@
568566
</div>
569567
</div>
570568
{#if RAGConfig.DOCLING_DO_OCR}
571-
<div class="flex w-full mt-2">
572-
<input
573-
class="flex-1 w-full text-sm bg-transparent outline-hidden"
574-
placeholder={$i18n.t('Enter Docling OCR Engine')}
575-
bind:value={RAGConfig.DOCLING_OCR_ENGINE}
576-
/>
577-
<input
578-
class="flex-1 w-full text-sm bg-transparent outline-hidden"
579-
placeholder={$i18n.t('Enter Docling OCR Language(s)')}
580-
bind:value={RAGConfig.DOCLING_OCR_LANG}
581-
/>
582-
</div>
583-
{/if}
569+
<div class="flex w-full mt-2">
570+
<input
571+
class="flex-1 w-full text-sm bg-transparent outline-hidden"
572+
placeholder={$i18n.t('Enter Docling OCR Engine')}
573+
bind:value={RAGConfig.DOCLING_OCR_ENGINE}
574+
/>
575+
<input
576+
class="flex-1 w-full text-sm bg-transparent outline-hidden"
577+
placeholder={$i18n.t('Enter Docling OCR Language(s)')}
578+
bind:value={RAGConfig.DOCLING_OCR_LANG}
579+
/>
580+
</div>
581+
{/if}
584582
<div class="flex w-full mt-2">
585583
<div class="flex-1 flex justify-between">
586584
<div class=" self-center text-xs font-medium">
@@ -591,57 +589,57 @@
591589
</div>
592590
</div>
593591
</div>
594-
<div class="flex justify-between w-full mt-2">
595-
<div class="self-center text-xs font-medium">
596-
<Tooltip content={''} placement="top-start">
597-
{$i18n.t('PDF Backend')}
598-
</Tooltip>
599-
</div>
600-
<div class="">
601-
<select
602-
class="dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 text-xs bg-transparent outline-hidden text-right"
603-
bind:value={RAGConfig.DOCLING_PDF_BACKEND}
604-
>
605-
<option value="pypdfium2">{$i18n.t('pypdfium2')}</option>
606-
<option value="dlparse_v1">{$i18n.t('dlparse_v1')}</option>
607-
<option value="dlparse_v2">{$i18n.t('dlparse_v2')}</option>
608-
<option value="dlparse_v4">{$i18n.t('dlparse_v4')}</option>
609-
</select>
610-
</div>
611-
</div>
612-
<div class="flex justify-between w-full mt-2">
613-
<div class="self-center text-xs font-medium">
614-
<Tooltip content={''} placement="top-start">
615-
{$i18n.t('Table Mode')}
616-
</Tooltip>
617-
</div>
618-
<div class="">
619-
<select
620-
class="dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 text-xs bg-transparent outline-hidden text-right"
621-
bind:value={RAGConfig.DOCLING_TABLE_MODE}
622-
>
623-
<option value="fast">{$i18n.t('fast')}</option>
624-
<option value="accurate">{$i18n.t('accurate')}</option>
625-
</select>
626-
</div>
627-
</div>
628-
<div class="flex justify-between w-full mt-2">
629-
<div class="self-center text-xs font-medium">
630-
<Tooltip content={''} placement="top-start">
631-
{$i18n.t('Pipeline')}
632-
</Tooltip>
633-
</div>
634-
<div class="">
635-
<select
636-
class="dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 text-xs bg-transparent outline-hidden text-right"
637-
bind:value={RAGConfig.DOCLING_PIPELINE}
638-
>
639-
<option value="standard">{$i18n.t('standard')}</option>
640-
<option value="vlm">{$i18n.t('vlm')}</option>
641-
</select>
642-
</div>
643-
</div>
644-
<div class="flex w-full mt-2">
592+
<div class="flex justify-between w-full mt-2">
593+
<div class="self-center text-xs font-medium">
594+
<Tooltip content={''} placement="top-start">
595+
{$i18n.t('PDF Backend')}
596+
</Tooltip>
597+
</div>
598+
<div class="">
599+
<select
600+
class="dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 text-xs bg-transparent outline-hidden text-right"
601+
bind:value={RAGConfig.DOCLING_PDF_BACKEND}
602+
>
603+
<option value="pypdfium2">{$i18n.t('pypdfium2')}</option>
604+
<option value="dlparse_v1">{$i18n.t('dlparse_v1')}</option>
605+
<option value="dlparse_v2">{$i18n.t('dlparse_v2')}</option>
606+
<option value="dlparse_v4">{$i18n.t('dlparse_v4')}</option>
607+
</select>
608+
</div>
609+
</div>
610+
<div class="flex justify-between w-full mt-2">
611+
<div class="self-center text-xs font-medium">
612+
<Tooltip content={''} placement="top-start">
613+
{$i18n.t('Table Mode')}
614+
</Tooltip>
615+
</div>
616+
<div class="">
617+
<select
618+
class="dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 text-xs bg-transparent outline-hidden text-right"
619+
bind:value={RAGConfig.DOCLING_TABLE_MODE}
620+
>
621+
<option value="fast">{$i18n.t('fast')}</option>
622+
<option value="accurate">{$i18n.t('accurate')}</option>
623+
</select>
624+
</div>
625+
</div>
626+
<div class="flex justify-between w-full mt-2">
627+
<div class="self-center text-xs font-medium">
628+
<Tooltip content={''} placement="top-start">
629+
{$i18n.t('Pipeline')}
630+
</Tooltip>
631+
</div>
632+
<div class="">
633+
<select
634+
class="dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 text-xs bg-transparent outline-hidden text-right"
635+
bind:value={RAGConfig.DOCLING_PIPELINE}
636+
>
637+
<option value="standard">{$i18n.t('standard')}</option>
638+
<option value="vlm">{$i18n.t('vlm')}</option>
639+
</select>
640+
</div>
641+
</div>
642+
<div class="flex w-full mt-2">
645643
<div class="flex-1 flex justify-between">
646644
<div class=" self-center text-xs font-medium">
647645
{$i18n.t('Describe Pictures in Documents')}

src/lib/components/channel/MessageInput.svelte

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,7 @@
376376
];
377377
};
378378
379-
reader.readAsDataURL(
380-
file['type'] === 'image/heic'
381-
? await convertHeicToJpeg(file)
382-
: file
383-
);
379+
reader.readAsDataURL(file['type'] === 'image/heic' ? await convertHeicToJpeg(file) : file);
384380
} else {
385381
uploadFileHandler(file);
386382
}

src/lib/components/notes/NoteEditor.svelte

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -544,11 +544,7 @@ ${content}
544544
}
545545
};
546546
547-
reader.readAsDataURL(
548-
file['type'] === 'image/heic'
549-
? await convertHeicToJpeg(file)
550-
: file
551-
);
547+
reader.readAsDataURL(file['type'] === 'image/heic' ? await convertHeicToJpeg(file) : file);
552548
});
553549
554550
return await uploadImagePromise;

0 commit comments

Comments
 (0)