diff options
author | Jared Dillard <jdillard@netgate.com> | 2016-07-12 16:44:10 -0500 |
---|---|---|
committer | Jared Dillard <jdillard@netgate.com> | 2016-07-12 16:46:21 -0500 |
commit | 7a1f791d56fed700f9ed3ce304147bc0e6b977a6 (patch) | |
tree | bc2710dc864cea1913e4ca32671cc7a495128725 | |
parent | 382bcd67779b2d82a6a01a76ed210f6ae57fdc42 (diff) | |
download | FreeBSD-ports-7a1f791d56fed700f9ed3ce304147bc0e6b977a6.zip FreeBSD-ports-7a1f791d56fed700f9ed3ce304147bc0e6b977a6.tar.gz |
(Status > Traffic Totals) misc beta fixes
-rw-r--r-- | net/pfSense-pkg-Status_Traffic_Totals/files/usr/local/www/status_traffic_totals.php | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/net/pfSense-pkg-Status_Traffic_Totals/files/usr/local/www/status_traffic_totals.php b/net/pfSense-pkg-Status_Traffic_Totals/files/usr/local/www/status_traffic_totals.php index 45fb1bb..5bfab22 100644 --- a/net/pfSense-pkg-Status_Traffic_Totals/files/usr/local/www/status_traffic_totals.php +++ b/net/pfSense-pkg-Status_Traffic_Totals/files/usr/local/www/status_traffic_totals.php @@ -54,9 +54,6 @@ OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* TODOs */ -//disallow TOP 10 Days on multiple interfaces - require("guiconfig.inc"); function vnstat_write_conf($startDay = "1") { @@ -107,7 +104,7 @@ function vnstat_create_nic_dbs($portlist) { foreach($portlist as $interface => $details) { - exec('/usr/local/bin/vnstat -u -i ' . escapeshellarg($interface) . ' --create'); + exec('/usr/local/bin/vnstat -u -i ' . escapeshellarg($interface) . ' --nick ' . $details['friendly'] . ' --create'); } @@ -720,7 +717,17 @@ events.push(function() { json[index*2] = {}; - json[index*2]['key'] = interface + " (tx)"; + var ifNick = interface; + + $.each(raw_json.interfaces, function(index, value) { + + if(value.id === interface) { + ifNick = value.nick; + } + + }); + + json[index*2]['key'] = ifNick + " (tx)"; json[index*2]['type'] = graphtype; if(graphtype === "stacked") { json[index*2]['type'] = "bar"; } if(graphtype === "line") { json[index*2]['area'] = true; } @@ -730,7 +737,7 @@ events.push(function() { json[index*2+1] = {}; - json[index*2+1]['key'] = interface + " (rx)"; + json[index*2+1]['key'] = ifNick + " (rx)"; json[index*2+1]['type'] = graphtype; if(graphtype === "stacked") { json[index*2+1]['type'] = "bar"; } if(graphtype === "line") { json[index*2+1]['area'] = true; } @@ -851,17 +858,17 @@ events.push(function() { var trueValue = data.series[v].value; } - if(trueValue / 1024 > 1) { + if(trueValue >= 1000) { trueValue = trueValue / 1024; unit = 'MiB'; } - if(trueValue / 1024 > 1) { + if(trueValue >= 1000) { trueValue = trueValue / 1024; unit = 'GiB'; } - if(trueValue / 1024 > 1) { + if(trueValue >= 1000) { trueValue = trueValue / 1024; unit = 'TiB'; } @@ -959,47 +966,47 @@ events.push(function() { var rxUnit = 'KiB'; var totalUnit = 'KiB'; - if(tx / 1024 > 1) { + if(tx >= 1000) { tx = tx / 1024; txUnit = 'MiB'; } - if(tx / 1024 > 1) { + if(tx >= 1000) { tx = tx / 1024; txUnit = 'GiB'; } - if(tx / 1024 > 1) { + if(tx >= 1000) { tx = tx / 1024; txUnit = 'TiB'; } - if(rx / 1024 > 1) { + if(rx >= 1000) { rx = rx / 1024; rxUnit = 'MiB'; } - if(rx / 1024 > 1) { + if(rx >= 1000) { rx = rx / 1024; rxUnit = 'GiB'; } - if(rx / 1024 > 1) { + if(rx >= 1000) { rx = rx / 1024; rxUnit = 'TiB'; } - if(total / 1024 > 1) { + if(total >= 1000) { total = total / 1024; totalUnit = 'MiB'; } - if(total / 1024 > 1) { + if(total >= 1000) { total = total / 1024; totalUnit = 'GiB'; } - if(total / 1024 > 1) { + if(total >= 1000) { total = total / 1024; totalUnit = 'TiB'; } |