summaryrefslogtreecommitdiffstats
path: root/src/usr/local
diff options
context:
space:
mode:
authorSteve Beaver <sbeaver@netgate.com>2017-08-21 10:36:07 -0400
committerSteve Beaver <sbeaver@netgate.com>2017-08-21 10:36:52 -0400
commit908b19969098c98145bab9866b7c4fb2d07a656d (patch)
tree98a04e1b4192c185e6e4ba3e4a2468396855022a /src/usr/local
parente3504522a4cececd670aa8b49e7d265a0e61a12a (diff)
downloadpfsense-908b19969098c98145bab9866b7c4fb2d07a656d.zip
pfsense-908b19969098c98145bab9866b7c4fb2d07a656d.tar.gz
Backport 2.4 getstats format for ease of maintenance
(cherry picked from commit 96d3d096a3c4c4d4cbc81befde9dbb3977c30a55)
Diffstat (limited to 'src/usr/local')
-rw-r--r--src/usr/local/www/includes/functions.inc.php2
-rw-r--r--src/usr/local/www/widgets/widgets/system_information.widget.php62
2 files changed, 5 insertions, 59 deletions
diff --git a/src/usr/local/www/includes/functions.inc.php b/src/usr/local/www/includes/functions.inc.php
index b53d2b4..46cfb24 100644
--- a/src/usr/local/www/includes/functions.inc.php
+++ b/src/usr/local/www/includes/functions.inc.php
@@ -65,8 +65,6 @@ function get_stats() {
$stats['states'] = get_pfstate();
$stats['temp'] = get_temp();
$stats['datetime'] = update_date_time();
- $stats['interfacestatistics'] = get_interfacestats();
- $stats['interfacestatus'] = get_interfacestatus();
$stats['cpufreq'] = get_cpufreq();
$stats['load_average'] = get_load_average();
$stats['mbuf'] = get_mbuf();
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")) {
OpenPOWER on IntegriCloud