From 9185f26b8336e9f611fd10166ec5adae9e26707f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E5=B0=8F=E4=B8=98?= Date: Thu, 26 Feb 2026 12:50:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20EPUB=20=E9=98=85?= =?UTF-8?q?=E8=AF=BB=E5=99=A8=E3=80=813D=20=E6=A8=A1=E5=9E=8B=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=92=8C=E5=AD=97=E4=BD=93=E6=9F=A5=E7=9C=8B=E5=99=A8?= =?UTF-8?q?=E5=BA=94=E7=94=A8=EF=BC=8C=E5=90=AF=E7=94=A8=20Office=20?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ee | 2 +- sqlmodels/migration.py | 51 ++++++++++++++++++++++++------------------ 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/ee b/ee index 52921f9..9dd69bd 160000 --- a/ee +++ b/ee @@ -1 +1 @@ -Subproject commit 52921f9ffe5e5cef2938a6b75f62f281b4c5a6ba +Subproject commit 9dd69bd25760a3122fe10264d7e833aed81d860d diff --git a/sqlmodels/migration.py b/sqlmodels/migration.py index 2f11347..a55bc9c 100644 --- a/sqlmodels/migration.py +++ b/sqlmodels/migration.py @@ -446,36 +446,43 @@ _DEFAULT_FILE_APPS: list[dict] = [ "is_enabled": True, "extensions": ["mp3", "wav", "ogg", "flac", "aac", "m4a", "opus"], }, - # iframe 应用(默认禁用) + { + "name": "EPUB 阅读器", + "app_key": "epub_reader", + "type": "builtin", + "icon": "book-open", + "description": "阅读 EPUB 电子书", + "is_enabled": True, + "extensions": ["epub"], + }, + { + "name": "3D 模型预览", + "app_key": "model_viewer", + "type": "builtin", + "icon": "cube", + "description": "预览 3D 模型", + "is_enabled": True, + "extensions": ["gltf", "glb", "stl", "obj", "fbx", "ply", "3mf"], + }, + { + "name": "Font Viewer", + "app_key": "font_viewer", + "type": "builtin", + "icon": "type", + "description": "预览字体文件并显示元数据和文本样本", + "is_enabled": True, + "extensions": ["ttf", "otf", "woff", "woff2"], + }, { "name": "Office 在线预览", "app_key": "office_viewer", "type": "iframe", "icon": "file-word", "description": "使用 Microsoft Office Online 预览文档", - "is_enabled": False, + "is_enabled": True, "iframe_url_template": "https://view.officeapps.live.com/op/embed.aspx?src={file_url}", "extensions": ["doc", "docx", "xls", "xlsx", "ppt", "pptx"], }, - # WOPI 应用(默认禁用) - { - "name": "Collabora Online", - "app_key": "collabora", - "type": "wopi", - "icon": "file-text", - "description": "Collabora Online 文档编辑器(需自行部署)", - "is_enabled": False, - "extensions": ["doc", "docx", "xls", "xlsx", "ppt", "pptx", "odt", "ods", "odp"], - }, - { - "name": "OnlyOffice", - "app_key": "onlyoffice", - "type": "wopi", - "icon": "file-text", - "description": "OnlyOffice 文档编辑器(需自行部署)", - "is_enabled": False, - "extensions": ["doc", "docx", "xls", "xlsx", "ppt", "pptx"], - }, ] @@ -493,7 +500,7 @@ async def init_default_file_apps() -> None: return for app_data in _DEFAULT_FILE_APPS: - extensions = app_data.pop("extensions") + extensions = app_data["extensions"] app = FileApp( name=app_data["name"],