mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-11 20:05:19 +00:00
refac
This commit is contained in:
parent
4b4241273d
commit
4d9a51ba33
3 changed files with 4 additions and 6 deletions
|
|
@ -135,7 +135,7 @@ class KnowledgeResponse(KnowledgeModel):
|
|||
|
||||
|
||||
class KnowledgeUserResponse(KnowledgeUserModel):
|
||||
files: Optional[list[FileMetadataResponse | dict]] = None
|
||||
pass
|
||||
|
||||
|
||||
class KnowledgeForm(BaseModel):
|
||||
|
|
|
|||
|
|
@ -39,8 +39,6 @@
|
|||
};
|
||||
</script>
|
||||
|
||||
{sourceIds}
|
||||
|
||||
{#if sourceIds}
|
||||
{#if (token?.ids ?? []).length == 1}
|
||||
<Source id={token.ids[0] - 1} title={sourceIds[token.ids[0] - 1]} {onClick} />
|
||||
|
|
|
|||
|
|
@ -422,7 +422,7 @@
|
|||
|
||||
// Helper function to maintain file paths within zip
|
||||
const syncDirectoryHandler = async () => {
|
||||
if ((knowledge?.files ?? []).length > 0) {
|
||||
if (fileItems.length > 0) {
|
||||
const res = await resetKnowledgeById(localStorage.token, id).catch((e) => {
|
||||
toast.error(`${e}`);
|
||||
});
|
||||
|
|
@ -757,10 +757,10 @@
|
|||
/>
|
||||
|
||||
<div class="shrink-0 mr-2.5">
|
||||
{#if (knowledge?.files ?? []).length}
|
||||
{#if fileItemsTotal}
|
||||
<div class="text-xs text-gray-500">
|
||||
{$i18n.t('{{count}} files', {
|
||||
count: (knowledge?.files ?? []).length
|
||||
count: fileItemsTotal
|
||||
})}
|
||||
</div>
|
||||
{/if}
|
||||
|
|
|
|||
Loading…
Reference in a new issue