Fix small bug in admin traffic summary, refs #492
Signed-off-by: Florian Aders (EleRas) <eleras@froxlor.org>
This commit is contained in:
@@ -4,13 +4,13 @@ $header
|
|||||||
$.tablesorter.addParser( {
|
$.tablesorter.addParser( {
|
||||||
id: 'filesize',
|
id: 'filesize',
|
||||||
is: function(s) {
|
is: function(s) {
|
||||||
return s.match( new RegExp( /[0-9]+(\.[0-9]+)?\ (KiB|Bi|GiB|MiB|TiB)/ ) );
|
return s.match( new RegExp( /[0-9]+(\.[0-9]+)?\ (KiB|B|GiB|MiB|TiB)/ ) );
|
||||||
},
|
},
|
||||||
format: function(s) {
|
format: function(s) {
|
||||||
var suf = s.match( new RegExp( /(KiB|Bi|GiB|MiB|TiB)/) )[1];
|
var suf = s.match( new RegExp( /(KiB|B|GiB|MiB|TiB)/) )[1];
|
||||||
var num = parseFloat( s.match( new RegExp( /^[0-9]+(\.[0-9]+)?/ ) )[0] );
|
var num = parseFloat( s.match( new RegExp( /^[0-9]+(\.[0-9]+)?/ ) )[0] );
|
||||||
switch( suf ) {
|
switch( suf ) {
|
||||||
case 'Bi':
|
case 'B':
|
||||||
return num;
|
return num;
|
||||||
case 'KiB':
|
case 'KiB':
|
||||||
return num * 1024;
|
return num * 1024;
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ $header
|
|||||||
$.tablesorter.addParser( {
|
$.tablesorter.addParser( {
|
||||||
id: 'filesize',
|
id: 'filesize',
|
||||||
is: function(s) {
|
is: function(s) {
|
||||||
return s.match( new RegExp( /[0-9]+(\.[0-9]+)?\ (KiB|Bi|GiB|MiB|TiB)/ ) );
|
return s.match( new RegExp( /[0-9]+(\.[0-9]+)?\ (KiB|B|GiB|MiB|TiB)/ ) );
|
||||||
},
|
},
|
||||||
format: function(s) {
|
format: function(s) {
|
||||||
var suf = s.match( new RegExp( /(KiB|Bi|GiB|MiB|TiB)/) )[1];
|
var suf = s.match( new RegExp( /(KiB|B|GiB|MiB|TiB)/) )[1];
|
||||||
var num = parseFloat( s.match( new RegExp( /^[0-9]+(\.[0-9]+)?/ ) )[0] );
|
var num = parseFloat( s.match( new RegExp( /^[0-9]+(\.[0-9]+)?/ ) )[0] );
|
||||||
switch( suf ) {
|
switch( suf ) {
|
||||||
case 'Bi':
|
case 'B':
|
||||||
return num;
|
return num;
|
||||||
case 'KiB':
|
case 'KiB':
|
||||||
return num * 1024;
|
return num * 1024;
|
||||||
|
|||||||
Reference in New Issue
Block a user