1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Feature #3718: Add units to the onevm show disk and snapshot size columns

This commit is contained in:
Jaime Melis 2015-07-10 10:58:52 +02:00
parent 4c5410f447
commit 368f31a02d

View File

@ -594,8 +594,26 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
end
column :SIZE, "", :left, :size=>16 do |d|
size = d["SIZE"] || "-"
monitor_size = d["MONITOR_SIZE"] || "-"
if d["SIZE"]
size = OpenNebulaHelper.unit_to_str(
d['SIZE'].to_i,
{},
"M"
)
else
size = "-"
end
if d["MONITOR_SIZE"]
monitor_size = OpenNebulaHelper.unit_to_str(
d['MONITOR_SIZE'].to_i,
{},
"M"
)
else
monitor_size = "-"
end
"#{monitor_size}/#{size}"
end
@ -983,8 +1001,26 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
end
column :SIZE, "", :left, :size=>16 do |d|
size = d["SIZE"] || "-"
monitor_size = d["MONITOR_SIZE"] || "-"
if d["SIZE"]
size = OpenNebulaHelper.unit_to_str(
d['SIZE'].to_i,
{},
"M"
)
else
size = "-"
end
if d["MONITOR_SIZE"]
monitor_size = OpenNebulaHelper.unit_to_str(
d['MONITOR_SIZE'].to_i,
{},
"M"
)
else
monitor_size = "-"
end
"#{monitor_size}/#{size}"
end