mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
feature #3718: Add Size to the disks table in the vm storage panel
This commit is contained in:
parent
915b20ea8b
commit
a933dd53c8
@ -60,6 +60,7 @@ define(function(require) {
|
||||
<th>' + Locale.tr("ID") + '</th>\
|
||||
<th>' + Locale.tr("Target") + '</th>\
|
||||
<th>' + Locale.tr("Image / Format-Size") + '</th>\
|
||||
<th>' + Locale.tr("Size") + '</th>\
|
||||
<th>' + Locale.tr("Persistent") + '</th>\
|
||||
<th>' + Locale.tr("Actions");
|
||||
|
||||
@ -150,6 +151,17 @@ define(function(require) {
|
||||
disks.push(context_disk);
|
||||
}
|
||||
|
||||
var disksSize = {};
|
||||
var monitoringDisks = [];
|
||||
if ($.isArray(that.element.MONITORING.DISK_SIZE))
|
||||
monitoringDisks = that.element.MONITORING.DISK_SIZE;
|
||||
else if (!$.isEmptyObject(that.element.MONITORING.DISK_SIZE))
|
||||
monitoringDisks = [that.element.MONITORING.DISK_SIZE];
|
||||
|
||||
$.each(monitoringDisks, function(index, monitoringDisk){
|
||||
disksSize[monitoringDisk.ID] = monitoringDisk.SIZE;
|
||||
})
|
||||
|
||||
var disk_dt_data = [];
|
||||
if (disks.length) {
|
||||
|
||||
@ -212,10 +224,24 @@ define(function(require) {
|
||||
}
|
||||
}
|
||||
|
||||
var sizeStr = "";
|
||||
if (disk.SIZE) {
|
||||
sizeStr += Humanize.sizeFromMB(disk.SIZE);
|
||||
} else {
|
||||
sizeStr += '-';
|
||||
}
|
||||
sizeStr += '/';
|
||||
if (disksSize[disk.DISK_ID]) {
|
||||
sizeStr += Humanize.sizeFromMB(disksSize[disk.DISK_ID]);
|
||||
} else {
|
||||
sizeStr += '-';
|
||||
}
|
||||
|
||||
disk_dt_data.push({
|
||||
DISK_ID : disk.DISK_ID,
|
||||
TARGET : disk.TARGET,
|
||||
IMAGE : (disk.IMAGE ? disk.IMAGE : (Humanize.sizeFromMB(disk.SIZE) + (disk.FORMAT ? (' - ' + disk.FORMAT) : ''))),
|
||||
SIZE: sizeStr,
|
||||
SAVE : ((disk.SAVE && disk.SAVE == 'YES') ? Locale.tr('YES') : Locale.tr('NO')),
|
||||
ACTIONS : actions,
|
||||
SNAPSHOTS : snapshotsHtml[disk.DISK_ID]
|
||||
@ -236,6 +262,7 @@ define(function(require) {
|
||||
{"data": "DISK_ID", "defaultContent": ""},
|
||||
{"data": "TARGET", "defaultContent": ""},
|
||||
{"data": "IMAGE", "defaultContent": "", "orderable": false},
|
||||
{"data": "SIZE", "defaultContent": ""},
|
||||
{"data": "SAVE", "defaultContent": "", "orderable": false},
|
||||
{"data": "ACTIONS", "defaultContent": "", "orderable": false}
|
||||
],
|
||||
@ -440,4 +467,4 @@ define(function(require) {
|
||||
subTree : subTree
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user