mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-20 12:56:55 +08:00
### What problem does this PR solve? #345 feat: translate FileManager feat: batch delete files from the file table in the knowledge base ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -20,12 +20,12 @@ import {
|
||||
import { useMemo } from 'react';
|
||||
import {
|
||||
useFetchDocumentListOnMount,
|
||||
useHandleBreadcrumbClick,
|
||||
useHandleDeleteFile,
|
||||
useHandleSearchChange,
|
||||
useSelectBreadcrumbItems,
|
||||
} from './hooks';
|
||||
|
||||
import { Link } from 'umi';
|
||||
import styles from './index.less';
|
||||
|
||||
interface IProps {
|
||||
@ -35,20 +35,6 @@ interface IProps {
|
||||
setSelectedRowKeys: (keys: string[]) => void;
|
||||
}
|
||||
|
||||
const itemRender: BreadcrumbProps['itemRender'] = (
|
||||
currentRoute,
|
||||
params,
|
||||
items,
|
||||
) => {
|
||||
const isLast = currentRoute?.path === items[items.length - 1]?.path;
|
||||
|
||||
return isLast ? (
|
||||
<span>{currentRoute.title}</span>
|
||||
) : (
|
||||
<Link to={`${currentRoute.path}`}>{currentRoute.title}</Link>
|
||||
);
|
||||
};
|
||||
|
||||
const FileToolbar = ({
|
||||
selectedRowKeys,
|
||||
showFolderCreateModal,
|
||||
@ -59,6 +45,26 @@ const FileToolbar = ({
|
||||
useFetchDocumentListOnMount();
|
||||
const { handleInputChange, searchString } = useHandleSearchChange();
|
||||
const breadcrumbItems = useSelectBreadcrumbItems();
|
||||
const { handleBreadcrumbClick } = useHandleBreadcrumbClick();
|
||||
|
||||
const itemRender: BreadcrumbProps['itemRender'] = (
|
||||
currentRoute,
|
||||
params,
|
||||
items,
|
||||
) => {
|
||||
const isLast = currentRoute?.path === items[items.length - 1]?.path;
|
||||
|
||||
return isLast ? (
|
||||
<span>{currentRoute.title}</span>
|
||||
) : (
|
||||
<span
|
||||
className={styles.breadcrumbItemButton}
|
||||
onClick={() => handleBreadcrumbClick(currentRoute.path)}
|
||||
>
|
||||
{currentRoute.title}
|
||||
</span>
|
||||
);
|
||||
};
|
||||
|
||||
const actionItems: MenuProps['items'] = useMemo(() => {
|
||||
return [
|
||||
@ -70,7 +76,7 @@ const FileToolbar = ({
|
||||
<Button type="link">
|
||||
<Space>
|
||||
<FileTextOutlined />
|
||||
{t('localFiles')}
|
||||
{t('uploadFile', { keyPrefix: 'fileManager' })}
|
||||
</Space>
|
||||
</Button>
|
||||
</div>
|
||||
@ -83,12 +89,13 @@ const FileToolbar = ({
|
||||
label: (
|
||||
<div>
|
||||
<Button type="link">
|
||||
<FolderOpenOutlined />
|
||||
New Folder
|
||||
<Space>
|
||||
<FolderOpenOutlined />
|
||||
{t('newFolder', { keyPrefix: 'fileManager' })}
|
||||
</Space>
|
||||
</Button>
|
||||
</div>
|
||||
),
|
||||
// disabled: true,
|
||||
},
|
||||
];
|
||||
}, [t, showFolderCreateModal, showFileUploadModal]);
|
||||
|
||||
Reference in New Issue
Block a user