From e38df464ea7a9ee90c0571a14fb68895d4d2a8ab Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 19 Aug 2025 15:10:13 +0800 Subject: [PATCH] Ensure front-end file type uploads are synchronized with back-end --- lightrag/lightrag.py | 4 +- lightrag_webui/src/lib/constants.ts | 64 +++++++++++++++-------------- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/lightrag/lightrag.py b/lightrag/lightrag.py index ab694493..af700393 100644 --- a/lightrag/lightrag.py +++ b/lightrag/lightrag.py @@ -1626,9 +1626,7 @@ class LightRAG: doc_id: { "status": DocStatus.PROCESSED, "chunks_count": len(chunks), - "chunks_list": list( - chunks.keys() - ), # 保留 chunks_list + "chunks_list": list(chunks.keys()), "content_summary": status_doc.content_summary, "content_length": status_doc.content_length, "created_at": status_doc.created_at, diff --git a/lightrag_webui/src/lib/constants.ts b/lightrag_webui/src/lib/constants.ts index 048ae8f7..488db2e8 100644 --- a/lightrag_webui/src/lib/constants.ts +++ b/lightrag_webui/src/lib/constants.ts @@ -31,36 +31,40 @@ export const supportedFileTypes = { 'text/plain': [ '.txt', '.md', - '.html', - '.htm', - '.tex', - '.json', - '.xml', - '.yaml', - '.yml', - '.rtf', - '.odt', - '.epub', - '.csv', - '.log', - '.conf', - '.ini', - '.properties', - '.sql', - '.bat', - '.sh', - '.c', - '.cpp', - '.py', - '.java', - '.js', - '.ts', - '.swift', - '.go', - '.rb', - '.php', - '.css', - '.scss', + '.pdf', + '.docx', + '.pptx', + '.xlsx', + '.rtf', //# Rich Text Format + '.odt', // # OpenDocument Text + '.tex', // # LaTeX + '.epub', // # Electronic Publication + '.html', // # HyperText Markup Language + '.htm', // # HyperText Markup Language + '.csv', // # Comma-Separated Values + '.json', // # JavaScript Object Notation + '.xml', // # eXtensible Markup Language + '.yaml', // # YAML Ain't Markup Language + '.yml', // # YAML + '.log', // # Log files + '.conf', // # Configuration files + '.ini', // # Initialization files + '.properties', // # Java properties files + '.sql', // # SQL scripts + '.bat', // # Batch files + '.sh', // # Shell scripts + '.c', // # C source code + '.cpp', // # C++ source code + '.py', // # Python source code + '.java', // # Java source code + '.js', // # JavaScript source code + '.ts', // # TypeScript source code + '.swift', // # Swift source code + '.go', // # Go source code + '.rb', // # Ruby source code + '.php', // # PHP source code + '.css', // # Cascading Style Sheets + '.scss', //# Sassy CSS '.less' ], 'application/pdf': ['.pdf'],