mirror of
https://github.com/ubicloud/ubicloud.git
synced 2025-10-05 14:23:03 +08:00
33 lines
970 B
Text
33 lines
970 B
Text
<div class="p-6">
|
|
<%== part(
|
|
"components/table_card",
|
|
title: "Disks",
|
|
headers: ["Disk", "Size", "Encryption", "Device Path"],
|
|
empty_state: "No disks attached",
|
|
rows: @vm.vm_storage_volumes_dataset.order(:disk_index).map do |volume|
|
|
name = "Disk ##{volume.disk_index}" + (volume.boot ? " (Boot)" : "")
|
|
encryption = volume.key_encryption_key_1 ? "Encrypted" : "Unencrypted"
|
|
[
|
|
[
|
|
name,
|
|
"#{volume.size_gib} GB",
|
|
encryption,
|
|
volume.device_path
|
|
],
|
|
{ id: "vm-storage-volume-#{volume.disk_index}" }
|
|
]
|
|
end + @vm.detachable_volumes.map do |volume|
|
|
name = volume.name + " (Data Disk)"
|
|
encryption = volume.encrypted? ? "Encrypted" : "Unencrypted"
|
|
[
|
|
[
|
|
name,
|
|
"#{volume.size_gib} GB",
|
|
encryption,
|
|
volume.device_path
|
|
],
|
|
{ id: "detachable-volume-#{volume.id}" }
|
|
]
|
|
end
|
|
) %>
|
|
</div>
|