diff options
author | Steve Beaver <sbeaver@netgate.com> | 2017-08-21 10:36:07 -0400 |
---|---|---|
committer | Steve Beaver <sbeaver@netgate.com> | 2017-08-21 10:36:07 -0400 |
commit | 96d3d096a3c4c4d4cbc81befde9dbb3977c30a55 (patch) | |
tree | ee63aecd2fae4278f7385459792020bd82c9df92 /src/usr/local/www/widgets | |
parent | 135da15564e9efb33044195719e4296e86951d87 (diff) | |
download | pfsense-96d3d096a3c4c4d4cbc81befde9dbb3977c30a55.zip pfsense-96d3d096a3c4c4d4cbc81befde9dbb3977c30a55.tar.gz |
Backport 2.4 getstats format for ease of maintenance
Diffstat (limited to 'src/usr/local/www/widgets')
-rw-r--r-- | src/usr/local/www/widgets/widgets/system_information.widget.php | 62 |
1 files changed, 5 insertions, 57 deletions
diff --git a/src/usr/local/www/widgets/widgets/system_information.widget.php b/src/usr/local/www/widgets/widgets/system_information.widget.php index 3a23353..122b9a9 100644 --- a/src/usr/local/www/widgets/widgets/system_information.widget.php +++ b/src/usr/local/www/widgets/widgets/system_information.widget.php @@ -600,13 +600,11 @@ function stats(x) { updateMemory(values[2]); updateState(values[4]); updateTemp(values[5]); - updateInterfaceStats(values[7]); - updateInterfaces(values[8]); - updateCpuFreq(values[9]); - updateLoadAverage(values[10]); - updateMbuf(values[11]); - updateMbufMeter(values[12]); - updateStateMeter(values[13]); + updateCpuFreq(values[7]); + updateLoadAverage(values[8]); + updateMbuf(values[9]); + updateMbufMeter(values[10]); + updateStateMeter(values[11]); } @@ -710,56 +708,6 @@ function updateLoadAverage(x) { } } -function updateInterfaceStats(x) { - if (widgetActive("interface_statistics")) { - statistics_split = x.split(","); - var counter = 1; - for (var y=0; y<statistics_split.length-1; y++) { - if ($('#stat' + counter)) { - $('#stat' + counter).html(statistics_split[y]); - counter++; - } - } - } -} - -function updateInterfaces(x) { - if (widgetActive("interfaces")) { - interfaces_split = x.split("~"); - interfaces_split.each(function(iface){ - details = iface.split("^"); - if (details[2] == '') { - ipv4_details = ''; - } else { - ipv4_details = details[2] + '<br />'; - } - switch (details[1]) { - case "up": - $('#' + details[0] + '-up').css("display","inline"); - $('#' + details[0] + '-down').css("display","none"); - $('#' + details[0] + '-block').css("display","none"); - $('#' + details[0] + '-ip').html(ipv4_details); - $('#' + details[0] + '-ipv6').html(details[3]); - $('#' + details[0] + '-media').html(details[4]); - break; - case "down": - $('#' + details[0] + '-down').css("display","inline"); - $('#' + details[0] + '-up').css("display","none"); - $('#' + details[0] + '-block').css("display","none"); - $('#' + details[0] + '-ip').html(ipv4_details); - $('#' + details[0] + '-ipv6').html(details[3]); - $('#' + details[0] + '-media').html(details[4]); - break; - case "block": - $('#' + details[0] + '-block').css("display","inline"); - $('#' + details[0] + '-down').css("display","none"); - $('#' + details[0] + '-up').css("display","none"); - break; - } - }); - } -} - function widgetActive(x) { var widget = $('#' + x + '-container'); if ((widget != null) && (widget.css('display') != null) && (widget.css('display') != "none")) { |