1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-23 17:33:56 +03:00

B #1946: networks is not array (#4877)

Signed-off-by: Jorge Lobo <jlobo@opennebula.io>
This commit is contained in:
Jorge Miguel Lobo Escalona 2020-06-03 18:14:16 +02:00 committed by GitHub
parent 0e7de61282
commit a941932544
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -505,8 +505,9 @@ define(function(require) {
){
var used = 0;
var size = 0;
if(Array.isArray(user.NETWORK_QUOTA.NETWORK)){
user.NETWORK_QUOTA.NETWORK.map(function(network){
var nets = user.NETWORK_QUOTA.NETWORK
if(Array.isArray(nets)){
nets.map(function(network){
if(network.LEASES_USED){
used = used+parseInt(network.LEASES_USED,10);
}
@ -515,10 +516,14 @@ define(function(require) {
}
});
var ipLeases = QuotaWidgets.quotaInfo(used, size);
$("#provision_dashboard_ips_percentage").html(ipLeases["percentage"]);
$("#provision_dashboard_ips_str").html(ipLeases["str"]);
$("#provision_dashboard_ips_meter").val(ipLeases["percentage"]);
}else{
used = parseInt(nets.LEASES_USED,10);
size = parseInt(nets.LEASES,10);
}
var ipLeases = QuotaWidgets.quotaInfo(used, size);
$("#provision_dashboard_ips_percentage").html(ipLeases["percentage"]);
$("#provision_dashboard_ips_str").html(ipLeases["str"]);
$("#provision_dashboard_ips_meter").val(ipLeases["percentage"]);
}
//SYSTEM DISK
if(