aboutsummaryrefslogtreecommitdiffstats
path: root/config/vnstat2/www
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2015-07-14 11:17:28 -0500
committerChris Buechler <cmb@pfsense.org>2015-07-14 11:17:28 -0500
commit53e31d1f8df4405abc8f462cbe67965e349f17fd (patch)
treecda9bc04f63f31ed0bdb06beceb98de319d2fe2c /config/vnstat2/www
parent3f78716f7ec83ba25ea623588dc8788de51b5ca9 (diff)
parent1f3536e071b893176cfef5c9c5580ea8e961fb6b (diff)
downloadpfsense-packages-53e31d1f8df4405abc8f462cbe67965e349f17fd.tar.gz
pfsense-packages-53e31d1f8df4405abc8f462cbe67965e349f17fd.tar.bz2
pfsense-packages-53e31d1f8df4405abc8f462cbe67965e349f17fd.zip
Merge pull request #901 from k-paulius/vnstat
Diffstat (limited to 'config/vnstat2/www')
-rw-r--r--config/vnstat2/www/diag_vnstat.php84
-rw-r--r--config/vnstat2/www/diag_vnstat2.php106
-rw-r--r--config/vnstat2/www/vnstati.php1
3 files changed, 99 insertions, 92 deletions
diff --git a/config/vnstat2/www/diag_vnstat.php b/config/vnstat2/www/diag_vnstat.php
index 04e03911..5e6524c7 100644
--- a/config/vnstat2/www/diag_vnstat.php
+++ b/config/vnstat2/www/diag_vnstat.php
@@ -1,30 +1,30 @@
<?php
/* $Id$ */
/*
- diag_pf_info.php
- Copyright (C) 2010 Scott Ullrich
- All rights reserved.
+ diag_pf_info.php
+ Copyright (C) 2010 Scott Ullrich
+ All rights reserved.
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
+ 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.
+ 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.
+ 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.
+ 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.
*/
/*
@@ -44,7 +44,7 @@ require("guiconfig.inc");
$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
$pgtitle = gettext("Vnstat2 summary ");
-if($_REQUEST['getactivity']) {
+if ($_REQUEST['getactivity']) {
$text = `vnstat`;
$text .= "<p/>";
echo $text;
@@ -80,7 +80,7 @@ include("head.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 />";
- if($savemsg) {
+ if ($savemsg) {
echo "<div id='savemsg'>";
print_info_box($savemsg);
echo "</div>";
@@ -89,25 +89,27 @@ include("head.inc");
print_input_errors($input_errors);
?>
<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...");?>
- </div>
- </td></tr>
- </table>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
+ <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...");?>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
</table>
</form>
<?php include("fend.inc"); ?>
diff --git a/config/vnstat2/www/diag_vnstat2.php b/config/vnstat2/www/diag_vnstat2.php
index e5ce1de5..504fd534 100644
--- a/config/vnstat2/www/diag_vnstat2.php
+++ b/config/vnstat2/www/diag_vnstat2.php
@@ -1,30 +1,30 @@
<?php
/* $Id$ */
/*
- diag_system_pftop.php
- Copyright (C) 2008-2009 Scott Ullrich
- All rights reserved.
+ diag_system_pftop.php
+ Copyright (C) 2008-2009 Scott Ullrich
+ All rights reserved.
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
+ 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.
+ 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.
+ 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.
+ 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.
*/
/*
@@ -46,11 +46,12 @@ $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']) {
- if($_REQUEST['sorttype'])
+if ($_REQUEST['getactivity']) {
+ if ($_REQUEST['sorttype']) {
$sorttype = escapeshellarg($_REQUEST['sorttype']);
- else
- $sorttype = gettext("-h");
+ } else {
+ $sorttype = gettext("-h");
+ }
$text = `vnstat -i $aaaa {$sorttype}`;
echo $text;
exit;
@@ -58,10 +59,11 @@ if($_REQUEST['getactivity']) {
include("head.inc");
-if($_REQUEST['sorttype'])
+if ($_REQUEST['sorttype']) {
$sorttype = htmlentities($_REQUEST['sorttype']);
-else
+} else {
$sorttype = "-h";
+}
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
@@ -87,16 +89,18 @@ else
<div id='maincontent'>
<?php
include("fbegin.inc");
- if ($pf_version < 2.0)
+ 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 />";
- if($savemsg) {
+ }
+ echo "<a href=$myurl/pkg_edit.php?xml=vnstatoutput.xml&id=0>Go Back</a><br />";
+ if ($savemsg) {
echo "<div id='savemsg'>";
print_info_box($savemsg);
echo "</div>";
}
- if ($input_errors)
+ if ($input_errors) {
print_input_errors($input_errors);
+ }
?>
<form method="post">
<?=gettext("Sort type:"); ?>
@@ -107,29 +111,31 @@ else
<option value='-m'><?=gettext("Show traffic for months.");?></option>
<option value='-t'><?=gettext("Show all time top10 traffic.");?></option>
<option value='-tr'><?=gettext("Calculate 5sec. of traffic.");?></option>
- <option value='-w'><?=gettext("Show traffic for 7 days, current and previous week.");?></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">
- <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...");?>
- </div>
- </td></tr>
- </table>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
+ <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...");?>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
</table>
</form>
<?php include("fend.inc"); ?>
diff --git a/config/vnstat2/www/vnstati.php b/config/vnstat2/www/vnstati.php
index e5ddcd21..01eca208 100644
--- a/config/vnstat2/www/vnstati.php
+++ b/config/vnstat2/www/vnstati.php
@@ -14,4 +14,3 @@ echo "<center><p class=\"pgtitle\">{$pgtitle}</p>";
<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 />
<?php include("fend.inc"); ?>
-