mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-31 21:55:21 +00:00
refac
This commit is contained in:
parent
0dd2cfe1f2
commit
5077676d33
2 changed files with 11 additions and 8 deletions
|
|
@ -826,16 +826,16 @@
|
||||||
{#if knowledge?.write_access}
|
{#if knowledge?.write_access}
|
||||||
<div>
|
<div>
|
||||||
<AddContentMenu
|
<AddContentMenu
|
||||||
on:upload={(e) => {
|
onUpload={(data) => {
|
||||||
if (e.detail.type === 'directory') {
|
if (data.type === 'directory') {
|
||||||
uploadDirectoryHandler();
|
uploadDirectoryHandler();
|
||||||
} else if (e.detail.type === 'text') {
|
} else if (data.type === 'text') {
|
||||||
showAddTextContentModal = true;
|
showAddTextContentModal = true;
|
||||||
} else {
|
} else {
|
||||||
document.getElementById('files-input').click();
|
document.getElementById('files-input').click();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
on:sync={(e) => {
|
onSync={() => {
|
||||||
showSyncConfirmModal = true;
|
showSyncConfirmModal = true;
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,9 @@
|
||||||
|
|
||||||
export let onClose: Function = () => {};
|
export let onClose: Function = () => {};
|
||||||
|
|
||||||
|
export let onSync: Function = () => {};
|
||||||
|
export let onUpload: Function = (data) => {};
|
||||||
|
|
||||||
let show = false;
|
let show = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -59,7 +62,7 @@
|
||||||
<DropdownMenu.Item
|
<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"
|
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={() => {
|
on:click={() => {
|
||||||
dispatch('upload', { type: 'files' });
|
onUpload({ type: 'files' });
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ArrowUpCircle strokeWidth="2" />
|
<ArrowUpCircle strokeWidth="2" />
|
||||||
|
|
@ -69,7 +72,7 @@
|
||||||
<DropdownMenu.Item
|
<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"
|
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={() => {
|
on:click={() => {
|
||||||
dispatch('upload', { type: 'directory' });
|
onUpload({ type: 'directory' });
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FolderOpen strokeWidth="2" />
|
<FolderOpen strokeWidth="2" />
|
||||||
|
|
@ -85,7 +88,7 @@
|
||||||
<DropdownMenu.Item
|
<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"
|
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={() => {
|
on:click={() => {
|
||||||
dispatch('sync', { type: 'directory' });
|
onSync();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ArrowPath strokeWidth="2" />
|
<ArrowPath strokeWidth="2" />
|
||||||
|
|
@ -96,7 +99,7 @@
|
||||||
<DropdownMenu.Item
|
<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"
|
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={() => {
|
on:click={() => {
|
||||||
dispatch('upload', { type: 'text' });
|
onUpload({ type: 'text' });
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<BarsArrowUp strokeWidth="2" />
|
<BarsArrowUp strokeWidth="2" />
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue