mirror of
https://github.com/zebrajr/ollama-webui.git
synced 2026-01-15 12:15:13 +00:00
refac
This commit is contained in:
@@ -826,16 +826,16 @@
|
||||
{#if knowledge?.write_access}
|
||||
<div>
|
||||
<AddContentMenu
|
||||
on:upload={(e) => {
|
||||
if (e.detail.type === 'directory') {
|
||||
onUpload={(data) => {
|
||||
if (data.type === 'directory') {
|
||||
uploadDirectoryHandler();
|
||||
} else if (e.detail.type === 'text') {
|
||||
} else if (data.type === 'text') {
|
||||
showAddTextContentModal = true;
|
||||
} else {
|
||||
document.getElementById('files-input').click();
|
||||
}
|
||||
}}
|
||||
on:sync={(e) => {
|
||||
onSync={() => {
|
||||
showSyncConfirmModal = true;
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
|
||||
export let onClose: Function = () => {};
|
||||
|
||||
export let onSync: Function = () => {};
|
||||
export let onUpload: Function = (data) => {};
|
||||
|
||||
let show = false;
|
||||
</script>
|
||||
|
||||
@@ -59,7 +62,7 @@
|
||||
<DropdownMenu.Item
|
||||
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
|
||||
on:click={() => {
|
||||
dispatch('upload', { type: 'files' });
|
||||
onUpload({ type: 'files' });
|
||||
}}
|
||||
>
|
||||
<ArrowUpCircle strokeWidth="2" />
|
||||
@@ -69,7 +72,7 @@
|
||||
<DropdownMenu.Item
|
||||
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
|
||||
on:click={() => {
|
||||
dispatch('upload', { type: 'directory' });
|
||||
onUpload({ type: 'directory' });
|
||||
}}
|
||||
>
|
||||
<FolderOpen strokeWidth="2" />
|
||||
@@ -85,7 +88,7 @@
|
||||
<DropdownMenu.Item
|
||||
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
|
||||
on:click={() => {
|
||||
dispatch('sync', { type: 'directory' });
|
||||
onSync();
|
||||
}}
|
||||
>
|
||||
<ArrowPath strokeWidth="2" />
|
||||
@@ -96,7 +99,7 @@
|
||||
<DropdownMenu.Item
|
||||
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
|
||||
on:click={() => {
|
||||
dispatch('upload', { type: 'text' });
|
||||
onUpload({ type: 'text' });
|
||||
}}
|
||||
>
|
||||
<BarsArrowUp strokeWidth="2" />
|
||||
|
||||
Reference in New Issue
Block a user