feat(backup): 新增 zstd 压缩选项 (#89)

备份压缩在 gzip 之外新增 zstd(更高压缩率、更快解压)。pkg/compress 新增 ZstdFile/UnzstdFile,Master 与 Agent 压缩/解压按后缀分流,任务校验与前端下拉同步;往返单测覆盖。
This commit is contained in:
Wu Qing
2026-05-27 19:15:06 +08:00
committed by GitHub
parent 90b58d58d6
commit 65cf3a04d4
9 changed files with 153 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ export const backupTaskTypeOptions = [
export const backupCompressionOptions = [
{ label: 'Gzip 压缩', value: 'gzip' },
{ label: 'Zstd 压缩(更快/更小)', value: 'zstd' },
{ label: '不压缩', value: 'none' },
] as const
@@ -89,7 +90,14 @@ export function getDefaultPort(type: BackupTaskType) {
}
export function getCompressionLabel(compression: BackupCompression) {
return compression === 'gzip' ? 'Gzip' : '无'
switch (compression) {
case 'gzip':
return 'Gzip'
case 'zstd':
return 'Zstd'
default:
return '无'
}
}
/** SAP HANA 备份级别选项 */

View File

@@ -1,6 +1,6 @@
export type BackupTaskType = 'file' | 'mysql' | 'sqlite' | 'postgresql' | 'saphana' | 'mongodb'
export type BackupTaskStatus = 'idle' | 'running' | 'success' | 'failed'
export type BackupCompression = 'gzip' | 'none'
export type BackupCompression = 'gzip' | 'zstd' | 'none'
export type BackupMode = 'full' | 'differential'
export interface BackupTaskSummary {