1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

Bug #3920: Add snapshot size to images in CLI and sunstone

This commit is contained in:
Carlos Martín 2015-09-01 16:57:07 +02:00
parent de733dd13d
commit d18dd76f69
3 changed files with 19 additions and 6 deletions

View File

@ -339,7 +339,19 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
d["CHILDREN"]
end
column :NAME, "Snapshot Name", :left, :size=>45 do |d|
column :SIZE, "", :right, :size=>8 do |d|
if d["SIZE"]
OpenNebulaHelper.unit_to_str(
d['SIZE'].to_i,
{},
"M"
)
else
"-"
end
end
column :NAME, "Snapshot Name", :left, :size=>37 do |d|
d["NAME"]
end
@ -347,7 +359,7 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
OpenNebulaHelper.time_to_str(d["DATE"])
end
default :AC, :ID, :PARENT, :DATE, :CHILDREN, :NAME
default :AC, :ID, :PARENT, :DATE, :SIZE, :NAME
end
# Convert snapshot data to an array

View File

@ -1027,7 +1027,7 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
d["CHILDREN"]
end
column :SIZE, "", :left, :size=>9 do |d|
column :SIZE, "", :right, :size=>12 do |d|
if d["SIZE"]
size = OpenNebulaHelper.unit_to_str(
d['SIZE'].to_i,
@ -1051,15 +1051,15 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
"#{monitor_size}/#{size}"
end
column :NAME, "Snapshot Name", :left, :size=>26 do |d|
column :NAME, "Snapshot Name", :left, :size=>32 do |d|
d["NAME"]
end
column :DATE, "Snapshot creation date", :size=>10 do |d|
column :DATE, "Snapshot creation date", :size=>15 do |d|
OpenNebulaHelper.time_to_str(d["DATE"])
end
default :AC, :ID, :DISK, :PARENT, :DATE, :CHILDREN, :SIZE, :NAME
default :AC, :ID, :DISK, :PARENT, :DATE, :SIZE, :NAME
end
# Convert snapshot data to an array

View File

@ -184,6 +184,7 @@ define(function(require){
}
html += Humanize.prettyTime(snapshot.DATE) + SPACE +
Humanize.sizeFromMB(snapshot.SIZE) + SPACE +
(snapshot.NAME ? snapshot.NAME + SPACE : '');
html += '</div>';