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

Bug #4123: Use disk_snapshot_total_size to calculate disk cost

(cherry picked from commit 182f3a28fc515d6cda4b0a10b96f2a379167fbcf)
This commit is contained in:
Carlos Martín 2015-11-02 17:37:23 +01:00
parent 0a435666ae
commit ceb6710f80

View File

@ -90,6 +90,9 @@ define(function(require){
if ($(this).attr('data-slider') > 0) {
cost += $(this).attr('data-slider') * 1024 * disk_cost;
}
var diskContext = $(this).closest(".diskContainer");
cost += diskContext.data('disk_snapshot_total_cost');
})
$(".cost_value", disksContext).html(cost.toFixed(2));
});
@ -110,6 +113,14 @@ define(function(require){
var sizeGB = disk.SIZE / 1024;
diskContext.data('original_size', sizeGB);
var disk_snapshot_total_size = 0;
if (disk.DISK_SNAPSHOT_TOTAL_SIZE != undefined) {
disk_snapshot_total_size = parseInt(disk.DISK_SNAPSHOT_TOTAL_SIZE);
}
diskContext.data('disk_snapshot_total_size', disk_snapshot_total_size);
diskContext.data('disk_snapshot_total_cost', disk_snapshot_total_size * disk_cost);
var label = disk.IMAGE ? disk.IMAGE : Locale.tr("Volatile Disk");
var enabled =
!( (disk.PERSISTENT && disk.PERSISTENT.toUpperCase() == "YES") ||