mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Support preview of HTML files #5096 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -6,6 +6,7 @@ import Docx from './docx';
|
||||
import Excel from './excel';
|
||||
import Pdf from './pdf';
|
||||
|
||||
import { previewHtmlFile } from '@/utils/file-util';
|
||||
import styles from './index.less';
|
||||
|
||||
// TODO: The interface returns an incorrect content-type for the SVG.
|
||||
@ -17,6 +18,11 @@ const DocumentViewer = () => {
|
||||
const prefix = currentQueryParameters.get('prefix');
|
||||
const api = `${api_host}/${prefix || 'file'}/get/${documentId}`;
|
||||
|
||||
if (ext === 'html' && documentId) {
|
||||
previewHtmlFile(documentId);
|
||||
return;
|
||||
}
|
||||
|
||||
return (
|
||||
<section className={styles.viewerWrapper}>
|
||||
{Images.includes(ext!) && (
|
||||
|
||||
Reference in New Issue
Block a user