added dynamic package description tootips

updated tablesorter to v2.25.0
add tablesorter widgets
(filter, saveSort, stickyHeaders, hover highlight)
added cli options to packagemanager script
This commit is contained in:
Derek Macias
2016-01-10 03:23:15 -07:00
parent 71e7008acd
commit 0495315d4f
13 changed files with 7204 additions and 50 deletions

View File

@ -0,0 +1,35 @@
<?php
function format_size($value, $decimals, $unit='?') {
if ($value == '')
return 'unknown';
/* Autodetect unit that's appropriate */
if ($unit == '?') {
if ($value >= 1099511627776)
$unit = 'T';
else
if ($value >= (1 << 30))
$unit = 'G';
else
if ($value >= (1 << 20))
$unit = 'M';
else
if ($value >= (1 << 10))
$unit = 'K';
else
$unit = 'B';
}
$unit = strtoupper($unit);
switch ($unit) {
case 'T': return number_format($value / (float)1099511627776, $decimals).' TB';
case 'G': return number_format($value / (float)(1 << 30), $decimals).' GB';
case 'M': return number_format($value / (float)(1 << 20), $decimals).' MB';
case 'K': return number_format($value / (float)(1 << 10), $decimals).' kB';
case 'B': return $value.' B';
}
return false;
}
?>