Add type-aware backup job forms

This commit is contained in:
Mikei386
2026-06-14 12:46:11 +02:00
parent 92564a1620
commit 800cb60f83
13 changed files with 153 additions and 17 deletions
+7
View File
@@ -74,6 +74,13 @@ func ValidateJob(j Job) error {
return errors.New("source requires path or workloadId")
}
}
if j.Type == JobDocker || j.Type == JobVM {
for _, source := range j.Sources {
if source.WorkloadID == "" {
return errors.New("docker and vm jobs require workload selections")
}
}
}
if j.Compression != "auto" && j.Compression != "off" && j.Compression != "max" {
return errors.New("compression must be auto, off, or max")
}