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

This commit is contained in:
Jaime Melis committed 2015-07-10 11:00:12 +02:00
1 parent 4c5410f447
commit 368f31a02d
1 file changed
+40 -4
+40 -4
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