Kitz ADSL Broadband Information
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
 

Difference between revisions of "CompactTrafficTotals"

From kitz wiki
Jump to: navigation, search
(Created page with "The traffic totals package in pfSense in my configuration has the data going off the side of the output area without any wrapping, to solve this problem I removed the ratio co...")
 
(No difference)

Latest revision as of 13:15, 7 June 2023

The traffic totals package in pfSense in my configuration has the data going off the side of the output area without any wrapping, to solve this problem I removed the ratio column which presents the download to upload ratio of traffic, this I felt is the least important column. If you have the same problem, this patch may be useful to you.




Paste the below code into the Patch Contents box.

Add a description such as 'Compact traffic totals output' in the Description box.

Set Path Strip Count to '0'.

Base Directory to '/'.

--- /usr/local/www/status_traffic_totals.php   2018-05-23 22:04:39.000000000 +0100
+++ /usr/local/www/status_traffic_totals.php     2019-08-30 12:37:10.926071000 +0100
@@ -1055,7 +1055,7 @@
                for(var i = 0; i < data.length; i += 2) {
                        var key = data[i].key.substring(0,data[i].key.length-5);
 
-                       header += '<th>' + key + ' TX</th><th>' + key + ' RX</th><th>' + key + ' Ratio</th><th>' + key + ' Total</th>';
+                       header += '<th>' + key + ' Total</th><th>' + key + ' RX</th><th>' + key + ' TX</th>';
                }
 
                header += '</tr>';
@@ -1147,7 +1147,7 @@
                                                totalUnit = 'TiB';
                                        }
 
-                                       body += '<td>' + tx.toFixed(2) + ' ' + txUnit + '</td><td>' + rx.toFixed(2) + ' ' + rxUnit + '</td><td>' + ratio.toFixed(2) + '</td><td>' + total.toFixed(2) + ' ' + totalUnit + '</td>';
+                                       body += '<td>' + total.toFixed(2) + ' ' + totalUnit + '</td><td>' + rx.toFixed(2) + ' ' + rxUnit + '</td><td>' + tx.toFixed(2) + ' ' + txUnit + '</td>';
 
                                }
 
@@ -1260,7 +1260,7 @@
                                                totalUnit = 'TiB';
                                        }
 
-                                       body += '<td>' + tx.toFixed(2) + ' ' + txUnit + '</td><td>' + rx.toFixed(2) + ' ' + rxUnit + '</td><td>' + ratio.toFixed(2) + '</td><td>' + total.toFixed(2) + ' ' + totalUnit + '</td>';
+                                       body += '<td>' + total.toFixed(2) + ' ' + totalUnit + '</td><td>' + rx.toFixed(2) + ' ' + rxUnit + '</td><td>' + tx.toFixed(2) + ' ' + txUnit + '</td>';
                                }
 
                                body += '</tr>';