feat: PBS Datastores — Backup-Anzahl, neues Layout mit GC/Verify/Prune Buttons
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user