feat(预览): 支持更多文本文件类型预览并增强URL处理

添加对js和html文件类型的文本预览支持,并改进预览组件的URL处理逻辑。现在能自动补全相对路径为完整URL,同时增加详细的日志记录以便调试。
This commit is contained in:
2025-10-29 22:27:39 +08:00
parent 32b3b7b29a
commit ead93c1e49
2 changed files with 59 additions and 3 deletions

View File

@@ -83,7 +83,7 @@ class FileCard(CardWidget):
"gif",
]:
signalBus.imagePreviewSignal.emit(self._id)
if self.fileType == "file" and self.suffix in ["txt", "py", "md"]:
if self.fileType == "file" and self.suffix in ["txt", "py", "md", "js", "html"]:
signalBus.txtPreviewSignal.emit(self._id)
def downloadFile(self):