aboutsummaryrefslogtreecommitdiffstats
path: root/config/vnstat2/www
diff options
context:
space:
mode:
Diffstat (limited to 'config/vnstat2/www')
-rw-r--r--config/vnstat2/www/diag_vnstat.php55
-rw-r--r--config/vnstat2/www/diag_vnstat2.php53
-rw-r--r--config/vnstat2/www/vnstat2_img.php28
-rw-r--r--config/vnstat2/www/vnstati.php41
4 files changed, 100 insertions, 77 deletions
diff --git a/config/vnstat2/www/diag_vnstat.php b/config/vnstat2/www/diag_vnstat.php
index 5e6524c7..e5014120 100644
--- a/config/vnstat2/www/diag_vnstat.php
+++ b/config/vnstat2/www/diag_vnstat.php
@@ -1,8 +1,9 @@
<?php
-/* $Id$ */
/*
- diag_pf_info.php
- Copyright (C) 2010 Scott Ullrich
+ diag_vnstat.php
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2009 PerryMason
+ Copyright (C) 2015 ESF, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -26,26 +27,10 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-
-/*
- pfSense_BUILDER_BINARIES: /usr/bin/top
- pfSense_MODULE: system
-*/
-
-##|+PRIV
-##|*IDENT=page-diag-system-activity
-##|*NAME=Diagnostics: System Activity
-##|*DESCR=Allows access to the 'Diagnostics: System Activity' page
-##|*MATCH=diag_system_activity*
-##|-PRIV
-
-require("guiconfig.inc");
-
-$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
-
-$pgtitle = gettext("Vnstat2 summary ");
+require_once("guiconfig.inc");
+$pgtitle = gettext("Vnstat2 summary");
if ($_REQUEST['getactivity']) {
- $text = `vnstat`;
+ $text = shell_exec("/usr/local/bin/vnstat");
$text .= "<p/>";
echo $text;
exit;
@@ -55,8 +40,8 @@ include("head.inc");
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-
<script type="text/javascript">
+//<![CDATA[
function getcpuactivity() {
var url = "/diag_vnstat.php";
var pars = 'getactivity=yes';
@@ -69,37 +54,36 @@ include("head.inc");
});
}
function activitycallback(transport) {
- $('cpuactivitydiv').innerHTML = '<font face="Courier"><font size="2"><b><pre>' + transport.responseText + '</pre></font>';
- setTimeout('getcpuactivity()', 2000);
+ $('cpuactivitydiv').innerHTML = '<font face="Courier"><font size="2"><b><pre>' + transport.responseText + '</pre></font>';
+ setTimeout('getcpuactivity()', 2000);
}
- setTimeout('getcpuactivity()', 5000);
+ setTimeout('getcpuactivity()', 5000);
+//]]>
</script>
<div id='maincontent'>
<?php
- include("fbegin.inc");
- if ($pf_version < 2.0)
- echo "<p class=\"pgtitle\">{$pgtitle}</p>";
- echo "<a href=$myurl/pkg_edit.php?xml=vnstatoutput.xml&id=0>Go Back</a><br />";
+ include("fbegin.inc");
+
if ($savemsg) {
echo "<div id='savemsg'>";
print_info_box($savemsg);
- echo "</div>";
+ echo "</div>";
}
- if ($input_errors)
+ if ($input_errors) {
print_input_errors($input_errors);
+ }
?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table id="backuptable" class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td>
- <center>
<table>
<tr>
<td>
<div name='cpuactivitydiv' id='cpuactivitydiv'>
- <b><?=gettext("Gathering vnstat information, please wait...");?>
+ <strong><?=gettext("Gathering vnstat information, please wait...");?></strong>
</div>
</td>
</tr>
@@ -107,7 +91,6 @@ include("head.inc");
</td>
</tr>
</table>
- </div>
</td>
</tr>
</table>
diff --git a/config/vnstat2/www/diag_vnstat2.php b/config/vnstat2/www/diag_vnstat2.php
index 504fd534..2153cc18 100644
--- a/config/vnstat2/www/diag_vnstat2.php
+++ b/config/vnstat2/www/diag_vnstat2.php
@@ -1,8 +1,9 @@
<?php
-/* $Id$ */
/*
- diag_system_pftop.php
- Copyright (C) 2008-2009 Scott Ullrich
+ diag_vnstat2.php
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2009 PerryMason
+ Copyright (C) 2015 ESF, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -26,24 +27,10 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-
-/*
- pfSense_MODULE: filter
-*/
-
-##|+PRIV
-##|*IDENT=page-diag-system-activity
-##|*NAME=Diagnostics: System Activity
-##|*DESCR=Allows access to the 'Diagnostics: System Activity' page
-##|*MATCH=diag_system_pftop*
-##|-PRIV
-
-require("guiconfig.inc");
+require_once("guiconfig.inc");
global $config;
$aaaa = $config['installedpackages']['vnstat2']['config'][0]['vnstat_interface2'];
$bbbb = convert_real_interface_to_friendly_descr($aaaa);
-
-$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
$pgtitle = gettext("Vnstat2 info for $bbbb ($aaaa)");
if ($_REQUEST['getactivity']) {
@@ -51,9 +38,9 @@ if ($_REQUEST['getactivity']) {
$sorttype = escapeshellarg($_REQUEST['sorttype']);
} else {
$sorttype = gettext("-h");
+ $text = shell_exec("/usr/local/bin/vnstat -i {$aaaa} {$sorttype}");
+ echo $text;
}
- $text = `vnstat -i $aaaa {$sorttype}`;
- echo $text;
exit;
}
@@ -69,6 +56,7 @@ if ($_REQUEST['sorttype']) {
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<form method="post" action="diag_vnstat2.php">
<script type="text/javascript">
+//<![CDATA[
function getcpuactivity() {
var url = "/diag_vnstat2.php";
var pars = 'getactivity=yes&sorttype=' + $('sorttype').value;
@@ -81,22 +69,19 @@ if ($_REQUEST['sorttype']) {
});
}
function activitycallback(transport) {
- $('cpuactivitydiv').innerHTML = '<font face="Courier"><font size="2"><b><pre>' + transport.responseText + '</pre></font>';
- setTimeout('getcpuactivity()', 2500);
+ $('cpuactivitydiv').innerHTML = '<font face="Courier"><font size="2"><b><pre>' + transport.responseText + '</pre></font>';
+ setTimeout('getcpuactivity()', 2500);
}
- setTimeout('getcpuactivity()', 1000);
+ setTimeout('getcpuactivity()', 1000);
+//]]>
</script>
<div id='maincontent'>
<?php
- include("fbegin.inc");
- if ($pf_version < 2.0) {
- echo "<p class=\"pgtitle\">{$pgtitle}</p>";
- }
- echo "<a href=$myurl/pkg_edit.php?xml=vnstatoutput.xml&id=0>Go Back</a><br />";
+ include("fbegin.inc");
if ($savemsg) {
echo "<div id='savemsg'>";
print_info_box($savemsg);
- echo "</div>";
+ echo "</div>";
}
if ($input_errors) {
print_input_errors($input_errors);
@@ -104,7 +89,7 @@ if ($_REQUEST['sorttype']) {
?>
<form method="post">
<?=gettext("Sort type:"); ?>
- <select name='sorttype' id='sorttype' onChange='this.form.submit();'>
+ <select name='sorttype' id='sorttype' onchange='this.form.submit();'>
<option value='<?=$sorttype?>'><?=$sorttype?></option>
<option value='-h'><?=gettext("Show traffic for the last 24 hours.");?></option>
<option value='-d'><?=gettext("Show traffic for days.");?></option>
@@ -113,19 +98,18 @@ if ($_REQUEST['sorttype']) {
<option value='-tr'><?=gettext("Calculate 5sec. of traffic.");?></option>
<option value='-w'><?=gettext("Show traffic for 7 days, current and previous week.");?></option>
</select>
- <p/>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <p />
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table id="backuptable" class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td>
- <center>
<table>
<tr>
<td>
<div name='cpuactivitydiv' id='cpuactivitydiv'>
- <b><?=gettext("Gathering vnstat activity, please wait...");?>
+ <strong><?=gettext("Gathering vnstat activity, please wait...");?></strong>
</div>
</td>
</tr>
@@ -133,7 +117,6 @@ if ($_REQUEST['sorttype']) {
</td>
</tr>
</table>
- </div>
</td>
</tr>
</table>
diff --git a/config/vnstat2/www/vnstat2_img.php b/config/vnstat2/www/vnstat2_img.php
index a83c3b06..fce29a4c 100644
--- a/config/vnstat2/www/vnstat2_img.php
+++ b/config/vnstat2/www/vnstat2_img.php
@@ -1,4 +1,32 @@
<?php
+/*
+ vnstat2_img.php
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2009 PerryMason
+ Copyright (C) 2015 ESF, LLC
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
require_once("guiconfig.inc");
$image = basename($_GET['image']);
header("Content-type: image/png");
diff --git a/config/vnstat2/www/vnstati.php b/config/vnstat2/www/vnstati.php
index 01eca208..d5f8d9bf 100644
--- a/config/vnstat2/www/vnstati.php
+++ b/config/vnstat2/www/vnstati.php
@@ -1,16 +1,45 @@
<?php
+/*
+ vnstati.php
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2009 PerryMason
+ Copyright (C) 2015 ESF, LLC
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
require_once("guiconfig.inc");
global $config;
include("head.inc");
+echo '<body link="#0000CC" vlink="#0000CC" alink="#0000CC">';
include("fbegin.inc");
$aaaa = $config['installedpackages']['vnstat2']['config'][0]['vnstat_interface'];
$cccc = convert_real_interface_to_friendly_descr($aaaa);
$pgtitle = gettext("Vnstati info for $cccc ($aaaa)");
-echo "<a href=$myurl/pkg_edit.php?xml=vnstati.xml&id=0>Go Back</a><br />";
-echo "<center><p class=\"pgtitle\">{$pgtitle}</p>";
?>
-<center><img src="vnstat2_img.php?image=newpicture1.png" style="border:1px solid black; center;"><br />
-<center><img src="vnstat2_img.php?image=newpicture2.png" style="border:1px solid black; center;"><br />
-<center><img src="vnstat2_img.php?image=newpicture3.png" style="border:1px solid black; center;"><br />
-<center><img src="vnstat2_img.php?image=newpicture4.png" style="border:1px solid black; center;"><br />
+<p style="text-align: center"><img src="vnstat2_img.php?image=newpicture1.png" alt="" style="border:1px solid black; center;" /></p>
+<p style="text-align: center"><img src="vnstat2_img.php?image=newpicture2.png" alt="" style="border:1px solid black; center;" /></p>
+<p style="text-align: center"><img src="vnstat2_img.php?image=newpicture3.png" alt="" style="border:1px solid black; center;" /></p>
+<p style="text-align: center"><img src="vnstat2_img.php?image=newpicture4.png" alt="" style="border:1px solid black; center;" /></p>
<?php include("fend.inc"); ?>
+</body>
+</html>