mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-19 03:35:11 +08:00
Fixed typos and added pptx preview for frontend (#12577)
### What problem does this PR solve? Previously, we added support for previewing PPT and PPTX files in the backend. Now, we are adding it to the frontend, so when the slides in the chat interface are referenced, they will no longer be blank. ### Type of change - Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -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",
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user