diff --git a/web/package-lock.json b/web/package-lock.json index 89d0629f8..b55ee249a 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -64,7 +64,7 @@ "jsencrypt": "^3.3.2", "lexical": "^0.23.1", "lodash": "^4.17.21", - "lucide-react": "^0.454.0", + "lucide-react": "^0.508.0", "mammoth": "^1.7.2", "next-themes": "^0.4.6", "openai-speech-stream-player": "^1.0.8", @@ -22959,11 +22959,12 @@ } }, "node_modules/lucide-react": { - "version": "0.454.0", - "resolved": "https://registry.npmmirror.com/lucide-react/-/lucide-react-0.454.0.tgz", - "integrity": "sha512-hw7zMDwykCLnEzgncEEjHeA6+45aeEzRYuKHuyRSOPkhko+J3ySGjGIzu+mmMfDFG1vazHepMaYFYHbTFAZAAQ==", + "version": "0.508.0", + "resolved": "https://registry.npmmirror.com/lucide-react/-/lucide-react-0.508.0.tgz", + "integrity": "sha512-gcP16PnexqtOFrTtv98kVsGzTfnbPekzZiQfByi2S89xfk7E/4uKE1USZqccIp58v42LqkO7MuwpCqshwSrJCg==", + "license": "ISC", "peerDependencies": { - "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc" + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/lz-string": { diff --git a/web/package.json b/web/package.json index 45803da70..6a2faf96a 100644 --- a/web/package.json +++ b/web/package.json @@ -75,7 +75,7 @@ "jsencrypt": "^3.3.2", "lexical": "^0.23.1", "lodash": "^4.17.21", - "lucide-react": "^0.454.0", + "lucide-react": "^0.508.0", "mammoth": "^1.7.2", "next-themes": "^0.4.6", "openai-speech-stream-player": "^1.0.8", diff --git a/web/public/iconfont.js b/web/public/iconfont.js index 38ce5d710..66daadffb 100644 --- a/web/public/iconfont.js +++ b/web/public/iconfont.js @@ -1,21 +1,21 @@ (window._iconfont_svg_string_4909832 = - ''), - ((l) => { - var a = (h = (h = document.getElementsByTagName('script'))[ - h.length - 1 + ''), + ((h) => { + var a = (l = (l = document.getElementsByTagName('script'))[ + l.length - 1 ]).getAttribute('data-injectcss'), - h = h.getAttribute('data-disable-injectsvg'); - if (!h) { - var t, - c, + l = l.getAttribute('data-disable-injectsvg'); + if (!l) { + var c, + t, i, v, - p, - z = function (a, h) { - h.parentNode.insertBefore(a, h); + o, + z = function (a, l) { + l.parentNode.insertBefore(a, l); }; - if (a && !l.__iconfont__svg__cssinject__) { - l.__iconfont__svg__cssinject__ = !0; + if (a && !h.__iconfont__svg__cssinject__) { + h.__iconfont__svg__cssinject__ = !0; try { document.write( '', @@ -24,47 +24,47 @@ console && console.log(a); } } - (t = function () { + (c = function () { var a, - h = document.createElement('div'); - (h.innerHTML = l._iconfont_svg_string_4909832), - (h = h.getElementsByTagName('svg')[0]) && - (h.setAttribute('aria-hidden', 'true'), - (h.style.position = 'absolute'), - (h.style.width = 0), - (h.style.height = 0), - (h.style.overflow = 'hidden'), - (h = h), + l = document.createElement('div'); + (l.innerHTML = h._iconfont_svg_string_4909832), + (l = l.getElementsByTagName('svg')[0]) && + (l.setAttribute('aria-hidden', 'true'), + (l.style.position = 'absolute'), + (l.style.width = 0), + (l.style.height = 0), + (l.style.overflow = 'hidden'), + (l = l), (a = document.body).firstChild - ? z(h, a.firstChild) - : a.appendChild(h)); + ? z(l, a.firstChild) + : a.appendChild(l)); }), document.addEventListener ? ~['complete', 'loaded', 'interactive'].indexOf(document.readyState) - ? setTimeout(t, 0) - : ((c = function () { - document.removeEventListener('DOMContentLoaded', c, !1), t(); + ? setTimeout(c, 0) + : ((t = function () { + document.removeEventListener('DOMContentLoaded', t, !1), c(); }), - document.addEventListener('DOMContentLoaded', c, !1)) + document.addEventListener('DOMContentLoaded', t, !1)) : document.attachEvent && - ((i = t), - (v = l.document), - (p = !1), - e(), + ((i = c), + (v = h.document), + (o = !1), + m(), (v.onreadystatechange = function () { 'complete' == v.readyState && - ((v.onreadystatechange = null), d()); + ((v.onreadystatechange = null), p()); })); } - function d() { - p || ((p = !0), i()); + function p() { + o || ((o = !0), i()); } - function e() { + function m() { try { v.documentElement.doScroll('left'); } catch (a) { - return void setTimeout(e, 50); + return void setTimeout(m, 50); } - d(); + p(); } })(window); diff --git a/web/src/components/bulk-operate-bar.tsx b/web/src/components/bulk-operate-bar.tsx index a2ea76eda..51652ff72 100644 --- a/web/src/components/bulk-operate-bar.tsx +++ b/web/src/components/bulk-operate-bar.tsx @@ -1,8 +1,10 @@ import { Button } from '@/components/ui/button'; import { Card, CardContent } from '@/components/ui/card'; import { cn } from '@/lib/utils'; +import { BrushCleaning } from 'lucide-react'; import { ReactNode, useCallback } from 'react'; import { ConfirmDeleteDialog } from './confirm-delete-dialog'; +import { Separator } from './ui/separator'; export type BulkOperateItemType = { id: string; @@ -11,16 +13,21 @@ export type BulkOperateItemType = { onClick(): void; }; -type BulkOperateBarProps = { list: BulkOperateItemType[] }; +type BulkOperateBarProps = { list: BulkOperateItemType[]; count: number }; -export function BulkOperateBar({ list }: BulkOperateBarProps) { +export function BulkOperateBar({ list, count }: BulkOperateBarProps) { const isDeleteItem = useCallback((id: string) => { return id === 'delete'; }, []); return ( - + +
+ Selected: {count} Files + +
+
    {list.map((x) => (
  • ); diff --git a/web/src/components/new-document-link.tsx b/web/src/components/new-document-link.tsx index 62a23dd59..85480d145 100644 --- a/web/src/components/new-document-link.tsx +++ b/web/src/components/new-document-link.tsx @@ -11,6 +11,7 @@ interface IProps extends React.PropsWithChildren { documentName: string; documentId?: string; prefix?: string; + className?: string; } const NewDocumentLink = ({ @@ -21,6 +22,7 @@ const NewDocumentLink = ({ documentId, documentName, prefix = 'file', + className, }: IProps) => { let nextLink = link; const extension = getExtension(documentName); @@ -38,7 +40,8 @@ const NewDocumentLink = ({ } href={nextLink} rel="noreferrer" - style={{ color, wordBreak: 'break-all' }} + style={{ color: className ? '' : color, wordBreak: 'break-all' }} + className={className} > {children} diff --git a/web/src/components/ui/badge.tsx b/web/src/components/ui/badge.tsx index 2bdbfb46b..961594f96 100644 --- a/web/src/components/ui/badge.tsx +++ b/web/src/components/ui/badge.tsx @@ -11,7 +11,7 @@ const badgeVariants = cva( default: 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80', secondary: - 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80', + 'border-transparent bg-background-card text-text-sub-title-invert hover:bg-secondary/80 rounded-md', destructive: 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80', outline: 'text-foreground', diff --git a/web/src/components/ui/table.tsx b/web/src/components/ui/table.tsx index d8410695f..5316a3aa3 100644 --- a/web/src/components/ui/table.tsx +++ b/web/src/components/ui/table.tsx @@ -4,9 +4,14 @@ import { cn } from '@/lib/utils'; const Table = React.forwardRef< HTMLTableElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
    + React.HTMLAttributes & { rootClassName?: string } +>(({ className, rootClassName, ...props }, ref) => ( +
    >(({ className, ...props }, ref) => ( - + )); TableHeader.displayName = 'TableHeader'; diff --git a/web/src/hooks/logic-hooks/use-row-selection.ts b/web/src/hooks/logic-hooks/use-row-selection.ts index 6da303c55..e86fc9bb0 100644 --- a/web/src/hooks/logic-hooks/use-row-selection.ts +++ b/web/src/hooks/logic-hooks/use-row-selection.ts @@ -9,11 +9,16 @@ export function useRowSelection() { setRowSelection({}); }, []); + const selectedCount = useMemo(() => { + return Object.keys(rowSelection).length; + }, [rowSelection]); + return { rowSelection, setRowSelection, rowSelectionIsEmpty: isEmpty(rowSelection), clearRowSelection, + selectedCount, }; } diff --git a/web/src/hooks/use-document-request.ts b/web/src/hooks/use-document-request.ts index 05f1d0428..3f0b2baa1 100644 --- a/web/src/hooks/use-document-request.ts +++ b/web/src/hooks/use-document-request.ts @@ -93,7 +93,7 @@ export const useFetchDocumentList = () => { filterValue, ], initialData: { docs: [], total: 0 }, - refetchInterval: 15000, + // refetchInterval: 15000, enabled: !!knowledgeId || !!id, queryFn: async () => { const ret = await listDocument( diff --git a/web/src/pages/dataset/dataset/dataset-action-cell.tsx b/web/src/pages/dataset/dataset/dataset-action-cell.tsx index 23e2b1fcc..c1cf8dadc 100644 --- a/web/src/pages/dataset/dataset/dataset-action-cell.tsx +++ b/web/src/pages/dataset/dataset/dataset-action-cell.tsx @@ -11,7 +11,7 @@ import { IDocumentInfo } from '@/interfaces/database/document'; import { formatFileSize } from '@/utils/common-util'; import { formatDate } from '@/utils/date'; import { downloadDocument } from '@/utils/file-util'; -import { ArrowDownToLine, Pencil, ScrollText, Trash2 } from 'lucide-react'; +import { ArrowDownToLine, FolderPen, ScrollText, Trash2 } from 'lucide-react'; import { useCallback } from 'react'; import { UseRenameDocumentShowType } from './use-rename-document'; import { isParserRunning } from './utils'; @@ -50,10 +50,18 @@ export function DatasetActionCell({ }, [record, showRenameModal]); return ( -
    +
    + - @@ -77,27 +85,20 @@ export function DatasetActionCell({ - + {isVirtualDocument || ( )} -
    diff --git a/web/src/pages/dataset/dataset/dataset-table.tsx b/web/src/pages/dataset/dataset/dataset-table.tsx index 5354c39e6..48ec4bb42 100644 --- a/web/src/pages/dataset/dataset/dataset-table.tsx +++ b/web/src/pages/dataset/dataset/dataset-table.tsx @@ -119,7 +119,7 @@ export function DatasetTable({ return (
    -
    +
    {table.getHeaderGroups().map((headerGroup) => ( @@ -164,11 +164,7 @@ export function DatasetTable({ )}
    -
    -
    - {table.getFilteredSelectedRowModel().rows.length} of{' '} - {pagination?.total} row(s) selected. -
    +
    +
    Dataset
    +
    + Please wait for your files to finish parsing before starting an + AI-powered chat. +
    +
    + } > @@ -87,7 +96,9 @@ export default function Dataset() { - {rowSelectionIsEmpty || } + {rowSelectionIsEmpty || ( + + )} -
    +
    +
    - + @@ -73,8 +73,7 @@ export function ParsingStatusCell({ - - +
    +
    - - + + + + {isFolder || ( + - + )} + {isSupportedPreviewDocumentType(extension) && ( - )} - + + {/* - @@ -108,7 +116,12 @@ export function ActionCell({ )} - + */} + + +
    ); } diff --git a/web/src/pages/files/files-table.tsx b/web/src/pages/files/files-table.tsx index 71d1ed2c7..fee8e687f 100644 --- a/web/src/pages/files/files-table.tsx +++ b/web/src/pages/files/files-table.tsx @@ -304,12 +304,7 @@ export function FilesTable({ -
    -
    - {table.getFilteredSelectedRowModel().rows.length} of {total} row(s) - selected. -
    - +
    - + {breadcrumbItems.length > 0 ? : 'File'}
    ); @@ -85,6 +89,7 @@ export default function Files() { searchString={searchString} onSearchChange={handleInputChange} showFilter={false} + icon={'file'} > @@ -104,7 +109,9 @@ export default function Files() { - {!rowSelectionIsEmpty && } + {!rowSelectionIsEmpty && ( + + )} { return list.map((x) => ( - + {x.kb_name} )); @@ -25,8 +26,8 @@ export function KnowledgeCell({ value }: { value: IFile['kbs_info'] }) { {value.length > 2 && ( -