Show disk, pool and unassigned Linux capacity in device fleet views

This commit is contained in:
2026-11-20 09:35:05 +01:00
parent eaaa6ff228
commit 79f236b3ea
4 changed files with 53 additions and 1 deletions
+7
View File
@@ -562,6 +562,13 @@ fn project(row: &PgRow, now: DateTime<Utc>, full: bool, hosts: &HashMap<Uuid, Ho
if full || observed(&data, "windows.volumes").is_object() {
item["volumes"] = volumes(&data);
}
if let Some(scope) = data["observations"].as_array().and_then(|scopes|
scopes.iter().find(|s| s["scope"] == "linux.disks")) {
item["disks"] = if scope["quality"] == "valid" && scope["data"].is_array() {
scope["data"].clone()
} else { Value::Null };
item["disks_truncated"] = json!(scope["truncated"] == true);
}
if device_type == Some(DeviceType::Virtual) && row.get::<String, _>("lifecycle") == "current" {
let assigned_id: Option<Uuid> = row.get("hypervisor_asset_id");
let assigned = assigned_id.and_then(|id| hosts.get(&id));