feat: PBS Datastores — Backup-Anzahl, neues Layout mit GC/Verify/Prune Buttons

This commit is contained in:
cynfo3000
2026-03-06 23:34:43 +01:00
parent a036849565
commit 67651a5aeb
2 changed files with 109 additions and 49 deletions
+14 -6
View File
@@ -16,12 +16,12 @@ type PBSInfo struct {
}
type PBSDatastore struct {
Name string `json:"name"`
Path string `json:"path,omitempty"`
Total int64 `json:"total"`
Used int64 `json:"used"`
Available int64 `json:"available"`
Namespaces int `json:"namespaces,omitempty"`
Name string `json:"name"`
Path string `json:"path,omitempty"`
Total int64 `json:"total"`
Used int64 `json:"used"`
Available int64 `json:"available"`
BackupCount int `json:"backup_count"`
}
type PBSTask struct {
@@ -87,6 +87,14 @@ func CollectPBS() *PBSInfo {
if avail, ok := d["avail"].(float64); ok {
ds.Available = int64(avail)
}
// Backup-Anzahl ermitteln
if snapOut, err := exec.Command("/usr/sbin/proxmox-backup-manager", "snapshot", "list", ds.Name, "--output-format", "json").Output(); err == nil {
var snaps []interface{}
if json.Unmarshal(snapOut, &snaps) == nil {
ds.BackupCount = len(snaps)
}
}
pbs.Datastores = append(pbs.Datastores, ds)
}
}