Convert Virtual Machine pages to Laravel (#12287)

* Convert Virtual Machine pages to Laravel

* wip

* wip

* wip

* wip

* wip

* wip

* delete

* wip

* wip

* move powerStateLabel
This commit is contained in:
Jellyfrog
2020-11-11 01:15:20 +01:00
committed by GitHub
parent ac5920f45c
commit cfd9dce620
24 changed files with 363 additions and 237 deletions
+2 -19
View File
@@ -489,9 +489,7 @@ function formatRates($value, $round = '2', $sf = '3')
function formatStorage($value, $round = '2', $sf = '3')
{
$value = format_bi($value, $round) . 'B';
return $value;
return \LibreNMS\Util\Rewrite::formatStorage($value, $round, $sf);
}
function format_si($value, $round = '2', $sf = '3')
@@ -527,22 +525,7 @@ function format_si($value, $round = '2', $sf = '3')
function format_bi($value, $round = '2', $sf = '3')
{
if ($value < '0') {
$neg = 1;
$value = $value * -1;
}
$sizes = ['', 'k', 'M', 'G', 'T', 'P', 'E'];
$ext = $sizes[0];
for ($i = 1; (($i < count($sizes)) && ($value >= 1024)); $i++) {
$value = $value / 1024;
$ext = $sizes[$i];
}
if ($neg) {
$value = $value * -1;
}
return (number_format(round($value, $round), $sf, '.', '') + 0) . ' ' . $ext;
return \LibreNMS\Util\Rewrite::format_bi($value, $round, $sf);
}
function format_number($value, $base = '1000', $round = 2, $sf = 3)