Show disk, pool and unassigned Linux capacity in device fleet views
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user