summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPiBa-NL <pba_2k3@yahoo.com>2017-03-29 21:13:14 +0200
committerPiBa-NL <pba_2k3@yahoo.com>2017-03-29 21:13:14 +0200
commit2e56abd118b26e99a5c26c996d83e2fdf3f74423 (patch)
tree414c462eea9543d7fbb5c1fda6f6ae078aac1c4f /src
parent257dff159db8ada16622e8e3ea0ed4700dd377a2 (diff)
downloadpfsense-2e56abd118b26e99a5c26c996d83e2fdf3f74423.zip
pfsense-2e56abd118b26e99a5c26c996d83e2fdf3f74423.tar.gz
getstats, further cleanup unused code, e.g. removing updateInterfaceStats and updateInterfaces javascript functions
Diffstat (limited to 'src')
-rw-r--r--src/usr/local/www/includes/functions.inc.php6
-rw-r--r--src/usr/local/www/widgets/widgets/system_information.widget.php62
2 files changed, 6 insertions, 62 deletions
diff --git a/src/usr/local/www/includes/functions.inc.php b/src/usr/local/www/includes/functions.inc.php
index abb651b..91b0a13 100644
--- a/src/usr/local/www/includes/functions.inc.php
+++ b/src/usr/local/www/includes/functions.inc.php
@@ -33,13 +33,9 @@ function get_stats() {
$stats['states'] = get_pfstate();
$stats['temp'] = get_temp();
$stats['datetime'] = update_date_time();
- $stats['interfacestatistics'] = 0;//get_interfacestats();//unused
- $stats['interfacestatus'] = 0;//get_interfacestatus();//unused
$stats['cpufreq'] = get_cpufreq();
$stats['load_average'] = get_load_average();
- get_mbuf($mbuf, $mbufpercent);
- $stats['mbuf'] = $mbuf;
- $stats['mbufpercent'] = $mbufpercent;
+ get_mbuf($stats['mbuf'], $stats['mbufpercent']);
$stats['statepercent'] = get_pfstate(true);
$stats = join("|", $stats);
return $stats;
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 f483d40..4de6d4a 100644
--- a/src/usr/local/www/widgets/widgets/system_information.widget.php
+++ b/src/usr/local/www/widgets/widgets/system_information.widget.php
@@ -539,13 +539,11 @@ function stats(x) {
updateMemory(values[1]);
updateState(values[3]);
updateTemp(values[4]);
- updateInterfaceStats(values[6]);
- updateInterfaces(values[7]);
- updateCpuFreq(values[8]);
- updateLoadAverage(values[9]);
- updateMbuf(values[10]);
- updateMbufMeter(values[11]);
- updateStateMeter(values[12]);
+ updateCpuFreq(values[6]);
+ updateLoadAverage(values[7]);
+ updateMbuf(values[8]);
+ updateMbufMeter(values[9]);
+ updateStateMeter(values[10]);
}
function updateMemory(x) {
@@ -635,56 +633,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)) {
- $('[id="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":
- $('[id="' + details[0] + '-up"]').css("display","inline");
- $('[id="' + details[0] + '-down"]').css("display","none");
- $('[id="' + details[0] + '-block"]').css("display","none");
- $('[id="' + details[0] + '-ip"]').html(ipv4_details);
- $('[id="' + details[0] + '-ipv6"]').html(details[3]);
- $('[id="' + details[0] + '-media"]').html(details[4]);
- break;
- case "down":
- $('[id="' + details[0] + '-down"]').css("display","inline");
- $('[id="' + details[0] + '-up"]').css("display","none");
- $('[id="' + details[0] + '-block"]').css("display","none");
- $('[id="' + details[0] + '-ip"]').html(ipv4_details);
- $('[id="' + details[0] + '-ipv6"]').html(details[3]);
- $('[id="' + details[0] + '-media"]').html(details[4]);
- break;
- case "block":
- $('[id="' + details[0] + '-block"]').css("display","inline");
- $('[id="' + details[0] + '-down"]').css("display","none");
- $('[id="' + 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