mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Remove legacy function calls (#12651)
* massive inlines * fix style and wtf * remove rrdtool.inc.php include * fix CommonFunctions namespace issues * looking for missing class space, fix undefined class issues * style fixes
This commit is contained in:
@@ -184,12 +184,12 @@ function get_port_stats_by_port_hostname(Illuminate\Http\Request $request)
|
||||
return check_port_permission($port['port_id'], $device_id, function () use ($request, $port) {
|
||||
$in_rate = $port['ifInOctets_rate'] * 8;
|
||||
$out_rate = $port['ifOutOctets_rate'] * 8;
|
||||
$port['in_rate'] = formatRates($in_rate);
|
||||
$port['out_rate'] = formatRates($out_rate);
|
||||
$port['in_rate'] = \LibreNMS\Util\Number::formatSi($in_rate, 2, 3, 'bps');
|
||||
$port['out_rate'] = \LibreNMS\Util\Number::formatSi($out_rate, 2, 3, 'bps');
|
||||
$port['in_perc'] = number_format($in_rate / $port['ifSpeed'] * 100, 2, '.', '');
|
||||
$port['out_perc'] = number_format($out_rate / $port['ifSpeed'] * 100, 2, '.', '');
|
||||
$port['in_pps'] = format_bi($port['ifInUcastPkts_rate']);
|
||||
$port['out_pps'] = format_bi($port['ifOutUcastPkts_rate']);
|
||||
$port['in_pps'] = \LibreNMS\Util\Number::formatBi($port['ifInUcastPkts_rate'], 2, 3, '');
|
||||
$port['out_pps'] = \LibreNMS\Util\Number::formatBi($port['ifOutUcastPkts_rate'], 2, 3, '');
|
||||
|
||||
//only return requested columns
|
||||
if ($request->has('columns')) {
|
||||
@@ -1458,15 +1458,15 @@ function list_bills(Illuminate\Http\Request $request)
|
||||
$overuse = '';
|
||||
|
||||
if (strtolower($bill['bill_type']) == 'cdr') {
|
||||
$allowed = format_si($bill['bill_cdr']) . 'bps';
|
||||
$used = format_si($rate_data['rate_95th']) . 'bps';
|
||||
$allowed = \LibreNMS\Util\Number::formatSi($bill['bill_cdr'], 2, 3, '') . 'bps';
|
||||
$used = \LibreNMS\Util\Number::formatSi($rate_data['rate_95th'], 2, 3, '') . 'bps';
|
||||
if ($bill['bill_cdr'] > 0) {
|
||||
$percent = round(($rate_data['rate_95th'] / $bill['bill_cdr']) * 100, 2);
|
||||
} else {
|
||||
$percent = '-';
|
||||
}
|
||||
$overuse = $rate_data['rate_95th'] - $bill['bill_cdr'];
|
||||
$overuse = (($overuse <= 0) ? '-' : format_si($overuse));
|
||||
$overuse = (($overuse <= 0) ? '-' : \LibreNMS\Util\Number::formatSi($overuse, 2, 3, ''));
|
||||
} elseif (strtolower($bill['bill_type']) == 'quota') {
|
||||
$allowed = format_bytes_billing($bill['bill_quota']);
|
||||
$used = format_bytes_billing($rate_data['total_data']);
|
||||
|
||||
Reference in New Issue
Block a user