Fixed "Infinity" and "NaN" at web domain disk/bandwidth graph

This commit is contained in:
Malishev Dmitry 2011-12-29 14:15:39 +03:00
parent af3ee14057
commit e6e335027f

View file

@ -212,14 +212,14 @@ MAIL;
$cron['SUSPEND'] == 'yes' ? $totals['CRON']['blocked'] += 1 : false; $cron['SUSPEND'] == 'yes' ? $totals['CRON']['blocked'] += 1 : false;
} }
$rs1 = Vesta::execute(Vesta::V_GET_SYS_USER_VALUE, array('USER' => $this->getLoggedUser(), 'KEY' => 'BANDWIDTH')); $rs1 = Vesta::execute(Vesta::V_GET_SYS_USER_VALUE, array('USER' => $user['uid'], 'KEY' => 'BANDWIDTH'));
$bandwidth = $rs1['data']; $bandwidth = $rs1['data'];
$rs = Vesta::execute(Vesta::V_GET_SYS_USER_VALUE, array('USER' => $this->getLoggedUser(), 'KEY' => 'DISK_QUOTA')); $rs = Vesta::execute(Vesta::V_GET_SYS_USER_VALUE, array('USER' => $user['uid'], 'KEY' => 'DISK_QUOTA'));
$disk_quota = $rs['data']; $disk_quota = $rs['data'];
$reply = array( $reply = array(
'auth_user' => array('uid' => $this->getLoggedUser()), 'auth_user' => array('uid' => $this->getLoggedUser()),
'user_data' => array('BANDWIDTH' => json_encode($rs1)/*(int)$bandwidth*/, 'DISK_QUOTA' => (int)$disk_quota), 'user_data' => array('BANDWIDTH' => (int)$bandwidth, 'DISK_QUOTA' => (int)$disk_quota),
'WEB_DOMAIN' => $this->getWebDomainParams($data_web_domain, $global_data), 'WEB_DOMAIN' => $this->getWebDomainParams($data_web_domain, $global_data),
'CRON' => $this->getCronParams(), 'CRON' => $this->getCronParams(),
'IP' => $this->getIpParams($data_ip, $global_data), 'IP' => $this->getIpParams($data_ip, $global_data),