File tree Expand file tree Collapse file tree
src/lib/components/workspace/Knowledge/KnowledgeBase Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111
1212 import { capitalizeFirstLetter , formatFileSize } from ' $lib/utils' ;
1313
14+ import { WEBUI_BASE_URL } from ' $lib/constants' ;
15+
1416 import Tooltip from ' $lib/components/common/Tooltip.svelte' ;
1517 import DocumentPage from ' $lib/components/icons/DocumentPage.svelte' ;
1618 import XMark from ' $lib/components/icons/XMark.svelte' ;
3133 ? ' '
3234 : ' hover:bg-gray-100 dark:hover:bg-gray-850' }"
3335 >
36+ <div class =" flex items-center" >
37+ {#if file ?.status !== ' uploading' }
38+ <Tooltip content ={$i18n .t (' Open file' )}>
39+ <button
40+ class =" p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-850 transition"
41+ type =" button"
42+ on:click ={() => {
43+ let fileId = file ?.id ?? file ?.tempId ;
44+ window .open (` ${WEBUI_BASE_URL }/api/v1/files/${fileId }/content ` , ' _blank' );
45+ }}
46+ >
47+ <DocumentPage className =" size-3.5" />
48+ </button >
49+ </Tooltip >
50+ {:else }
51+ <Spinner className =" size-3.5" />
52+ {/if }
53+ </div >
54+
3455 <button
3556 class =" relative group flex items-center gap-1 rounded-xl p-2 text-left flex-1 justify-between"
3657 type =" button"
4162 >
4263 <div class =" " >
4364 <div class =" flex gap-2 items-center line-clamp-1" >
44- <div class =" shrink-0" >
45- {#if file ?.status !== ' uploading' }
46- <DocumentPage className =" size-3.5" />
47- {:else }
48- <Spinner className =" size-3.5" />
49- {/if }
50- </div >
51-
5265 <div class =" line-clamp-1 text-sm" >
5366 {file ?.name ?? file ?.meta ?.name }
5467 {#if file ?.meta ?.size }
You can’t perform that action at this time.
0 commit comments