Private
Public Access
1
0

修复:大文件点击卡死 + Dockerfile高亮支持

- useFileEdit: 新增 KNOWN_BINARY_EXTS 集合,exe/dll/zip 等 28 种二进制扩展名直接判定,不再读取文件内容
- index.vue: loadFileContent 增加大文件预检,基于 fileSize 超过阈值直接拦截
- service.go: ReadFile 增加 10MB 读取上限,超限返回错误
- Dockerfile 支持:CODE 分类、🐳图标、CodeMirror shell 模式高亮、languageMap 映射
This commit is contained in:
2026-04-07 11:39:50 +08:00
parent e5dbe89a6f
commit fb12ec48e8
7 changed files with 71 additions and 22 deletions

View File

@@ -82,7 +82,8 @@ const extensionToLanguage: Record<string, { hljs?: string; cm?: string }> = {
adoc: { hljs: 'plaintext', cm: 'text' },
// === 构建工具 / 配置 ===
dockerfile: { hljs: 'dockerfile', cm: 'text' },
// CodeMirror 6 无内置 Dockerfile 支持,用 shell 模式近似Dockerfile 本质是类 shell 指令)
dockerfile: { hljs: 'dockerfile', cm: 'shell' },
makefile: { hljs: 'makefile', cm: 'text' },
mk: { hljs: 'makefile', cm: 'text' },
cmake: { hljs: 'cmake', cm: 'text' },