release: v1.3.0 — 整站备份恢复、跨后端同步与任务中心
ci / ci (22, ubuntu-latest) (push) Canceled after 0s
GitHub Release / release (push) Canceled after 0s
Publish Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Canceled after 0s
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Canceled after 0s
Publish Docker image / merge (push) Canceled after 0s
ci / ci (22, ubuntu-latest) (push) Canceled after 0s
GitHub Release / release (push) Canceled after 0s
Publish Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Canceled after 0s
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Canceled after 0s
Publish Docker image / merge (push) Canceled after 0s
This commit is contained in:
1 parent
b05d572221
commit
f17d79b236
72 files changed
+4312
-559
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import type { BackupJob } from '../../utils/backup/jobs'
|
||||
import { BACKUP_ARCHIVE_EXT } from '../../utils/backup/paths'
|
||||
|
||||
export function serializeBackupJob(job: BackupJob) {
|
||||
const archiveName = job.outputPath
|
||||
? job.outputPath.split(/[/\\]/).pop()
|
||||
: typeof job.payload.archiveName === 'string'
|
||||
? job.payload.archiveName
|
||||
: null
|
||||
|
||||
return {
|
||||
id: job.id,
|
||||
type: job.type,
|
||||
status: job.status,
|
||||
progress: job.progress,
|
||||
total: job.total,
|
||||
message: job.message,
|
||||
payload: job.payload,
|
||||
outputPath: job.outputPath,
|
||||
archiveName,
|
||||
downloadable: Boolean(
|
||||
job.type === 'full_export'
|
||||
&& job.status === 'done'
|
||||
&& job.outputPath
|
||||
&& archiveName?.endsWith(BACKUP_ARCHIVE_EXT)
|
||||
),
|
||||
error: job.error,
|
||||
createdAt: job.createdAt,
|
||||
finishedAt: job.finishedAt
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user