Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fixed typos and added pptx preview for frontend (#12577)

LIRUI YU947e63ca14f4
diff --git a/api/utils/web_utils.py b/api/utils/web_utils.py
index c13889be23..2d26229311 100644
--- a/api/utils/web_utils.py
+++ b/api/utils/web_utils.py
@@ -88,7 +88,7 @@ CONTENT_TYPE_MAP = {
"heic": "image/heic",
# PPTX
"ppt": "application/vnd.ms-powerpoint",
- "pptx": "application/vnd.openxmLformats-officedocument.presentationml.presentation",
+ "pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
}
diff --git a/web/src/components/document-preview/index.tsx b/web/src/components/document-preview/index.tsx
index 968dba3c8a..334cae4511 100644
--- a/web/src/components/document-preview/index.tsx
+++ b/web/src/components/document-preview/index.tsx
@@ -67,7 +67,7 @@ const Preview = ({
<VideoPreviewer className={className} url={url} />
</section>
)}
- {['pptx'].indexOf(fileType) > -1 && (
+ {['ppt', 'pptx'].indexOf(fileType) > -1 && (
<section>
<PptPreviewer className={className} url={url} />
</section>
diff --git a/web/src/pages/document-viewer/index.tsx b/web/src/pages/document-viewer/index.tsx
index 3a01ea5554..9bcd60c0f9 100644
--- a/web/src/pages/document-viewer/index.tsx
+++ b/web/src/pages/document-viewer/index.tsx
@@ -13,6 +13,7 @@ import { ExcelCsvPreviewer } from '@/components/document-preview/excel-preview';
import { ImagePreviewer } from '@/components/document-preview/image-preview';
import Md from '@/components/document-preview/md';
import PdfPreview from '@/components/document-preview/pdf-preview';
+import { PptPreviewer } from '@/components/document-preview/ppt-preview';
import { TxtPreviewer } from '@/components/document-preview/txt-preview';
import { previewHtmlFile } from '@/utils/file-util';
// import styles from './index.less';
@@ -53,6 +54,10 @@ const DocumentViewer = () => {
)}
{ext === 'docx' && <DocPreviewer url={api}></DocPreviewer>}
+
+ {(ext === 'ppt' || ext === 'pptx') && (
+ <PptPreviewer url={api} className="!h-dvh p-5"></PptPreviewer>
+ )}
</section>
);
};