fix division by zero
This commit is contained in:
parent
d73e3c4ea2
commit
da9bd9d547
|
@ -58,7 +58,7 @@ class OverViewController extends Controller
|
||||||
$output[$nodeId]->totalEarnings = 0;
|
$output[$nodeId]->totalEarnings = 0;
|
||||||
$output[$nodeId]->activeEarnings = 0;
|
$output[$nodeId]->activeEarnings = 0;
|
||||||
}
|
}
|
||||||
$counters['totalUsagePercent'] = round($counters['totalUsagePercent']/$nodes->count(), 2);
|
$counters['totalUsagePercent'] = ($nodes->count())?round($counters['totalUsagePercent']/$nodes->count(), 2):0;
|
||||||
|
|
||||||
foreach(Pterodactyl::getServers() as $server){ //gets all servers from Pterodactyl and calculates total of credit usage for each node separately + total
|
foreach(Pterodactyl::getServers() as $server){ //gets all servers from Pterodactyl and calculates total of credit usage for each node separately + total
|
||||||
$nodeId = $server['attributes']['node'];
|
$nodeId = $server['attributes']['node'];
|
||||||
|
|
Loading…
Reference in a new issue