feat: 實作全域檔案傳輸機制與 .tar 封裝規範
## 主要變更 ### 新增全域檔案傳輸模組 (src/transfer/) - constants.ts: 定義傳輸常數(10MB 門檻、5MB chunk 大小) - types.ts: 傳輸類型定義 - uploadManager.ts: 後端上傳管理器(支援直傳與 chunk) - downloadManager.ts: 後端下載管理器(支援直傳與 chunk) - archiveManager.ts: 封裝管理器(僅允許 .tar) - index.ts: 統一匯出 ### 新增 API 端點 - uploadChunk.tsx: Chunk 上傳 API - downloadChunk.tsx: Chunk 下載 API ### 前端更新 - public/script.js: 整合智慧傳輸策略(≤10MB 直傳,>10MB chunk) - public/transfer.js: 前端傳輸管理模組 ### 轉換器更新 - mineru.ts: 改用 .tar 格式(不壓縮),禁止 .tar.gz - download.tsx: 使用統一的封裝管理器 ### 測試 - tests/transfer/: 完整傳輸機制測試套件 - tests/converters/mineru.test.ts: 更新以符合 .tar 規範 ### 文件 - README.md: 新增檔案傳輸機制說明 ## 設計原則 - 檔案 ≤10MB:直接傳輸 - 檔案 >10MB:使用 5MB chunks 分段傳輸 - 多檔輸出:僅允許 .tar 封裝(禁止 .tar.gz/.zip) - 引擎層不感知 chunk(僅傳輸層處理)
This commit is contained in:
parent
f7ebc084ea
commit
5322f85721
18 changed files with 2387 additions and 61 deletions
|
|
@ -11,11 +11,13 @@ import { convert } from "./pages/convert";
|
|||
import { deleteFile } from "./pages/deleteFile";
|
||||
import { deleteJob } from "./pages/deleteJob";
|
||||
import { download } from "./pages/download";
|
||||
import { downloadChunk } from "./pages/downloadChunk";
|
||||
import { history } from "./pages/history";
|
||||
import { listConverters } from "./pages/listConverters";
|
||||
import { results } from "./pages/results";
|
||||
import { root } from "./pages/root";
|
||||
import { upload } from "./pages/upload";
|
||||
import { uploadChunk, uploadInfo } from "./pages/uploadChunk";
|
||||
import { user } from "./pages/user";
|
||||
import { healthcheck } from "./pages/healthcheck";
|
||||
|
||||
|
|
@ -41,9 +43,12 @@ const app = new Elysia({
|
|||
.use(user)
|
||||
.use(root)
|
||||
.use(upload)
|
||||
.use(uploadChunk)
|
||||
.use(uploadInfo)
|
||||
.use(history)
|
||||
.use(convert)
|
||||
.use(download)
|
||||
.use(downloadChunk)
|
||||
.use(deleteJob)
|
||||
.use(results)
|
||||
.use(deleteFile)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue