/alcasar.sh |
---|
1491,7 → 1491,6 |
$SED "s?Interface.*?Interface \"$EXTIF\"?g" /etc/vnstat.conf |
[ -e $DIR_ACC/manager/stats/config.php.default ] || cp $DIR_ACC/manager/stats/config.php $DIR_ACC/manager/stats/config.php.default |
$SED "s?\$iface_list =.*?\$iface_list = array('$EXTIF');?g" $DIR_ACC/manager/stats/config.php |
$SED "s?\$iface_title.*?\$iface_title['$EXTIF'] = 'Internet outbound';?g" $DIR_ACC/manager/stats/config.php |
/usr/bin/vnstat -u -i $EXTIF |
} # End of vnstat |
################################################## |
/conf/etc/alcasar-bl-categories-enabled |
---|
2,6 → 2,7 |
agressif |
dangerous_material |
dating |
ddos |
drogue |
gambling |
hacking |
/scripts/sbin/alcasar-uninstall.sh |
---|
21,7 → 21,6 |
/usr/local/bin/alcasar-sms.sh --stop |
for i in alcasar-load_balancing havp freshclam ntpd dansguardian httpd radiusd mysqld dnsmasq dnsmasq-blacklist dnsmasq-whitelist dnsmasq-blackhole tinyproxy nfsen fail2ban iptables ulogd-ext-access ulogd-ssh ulogd-traceability vnstat |
do |
echo "$i" |
[ -e /lib/systemd/system/$i.service ] && /usr/bin/systemctl disable $i.service && /usr/bin/systemctl stop $i.service 1>/dev/null && sleep 1 |
done |
echo "Check the service clearing" |
/web/acc/manager/stats/README |
---|
26,8 → 26,8 |
3. LICENSE |
vnstat PHP frontend 1.5.1 |
Copyright (c)2006-2008 Bjorge Dijkstra (bjd@jooz.net) |
vnstat PHP frontend 1.5.2 |
Copyright (c)2006-2011 Bjorge Dijkstra (bjd@jooz.net) |
This program is free software; you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
/web/acc/manager/stats/config.php |
---|
27,11 → 27,28 |
// |
// edit these to reflect your particular situation |
// |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) |
{ |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']); |
$Language = strtolower(substr(chop($Langue[0]),0,2)); |
} |
if($Language == 'fr') |
{ |
$locale = 'fr_FR.UTF-8'; |
$language = 'fr'; |
$title = 'Traffic Internet sortant'; |
date_default_timezone_set("Europe/Paris"); |
} |
else |
{ |
$locale = 'en_US.UTF-8'; |
$language = 'en'; |
$title = 'Internet outbound'; |
date_default_timezone_set("Europe/London"); |
} |
// list of network interfaces monitored by vnStat |
$iface_list = array('eth0'); |
$iface_list = array('enp0s3'); |
// |
// optional names for interfaces |
38,7 → 55,7 |
// if there's no name set for an interface then the interface identifier |
// will be displayed instead |
// |
$iface_title['eth0'] = 'Wire'; |
$iface_title['enp0s3'] = $title; |
// |
// There are two possible sources for vnstat data. If the $vnstat_bin |
55,11 → 72,14 |
// |
$vnstat_bin = '/usr/bin/vnstat'; |
$data_dir = './dumps'; |
$data_dir = '/var/spool/vnstat'; |
// graphics format to use: svg or png |
$graph_format='svg'; |
// preferred byte notation. null auto chooses. otherwise use one of |
// 'TB','GB','MB','KB' |
$byte_notation = null; |
// Font to use for PNG graphs |
define('GRAPH_FONT',dirname(__FILE__).'/VeraBd.ttf'); |
69,4 → 89,7 |
// Default theme |
define('DEFAULT_COLORSCHEME', 'light'); |
// SVG Depth scaling factor |
define('SVG_DEPTH_SCALING', 1); |
?> |
/web/acc/manager/stats/graph.php |
---|
105,7 → 105,7 |
function draw_grid($x_ticks, $y_ticks) |
{ |
global $im, $cl, $iw, $ih, $xlm, $xrm, $ytm, $ybm; |
$x_step = ($iw - $xlm - $xrm) / $x_ticks; |
$x_step = ($iw - $xlm - $xrm) / ($x_ticks ?: 1); |
$y_step = ($ih - $ytm - $ybm) / $y_ticks; |
$depth = 10;//($x_step / 8) + 4; |
126,7 → 126,6 |
imageline($im, $xlm, $ih - $ybm, $iw - $xrm, $ih - $ybm, $cl['border']); |
} |
function draw_data($data) |
{ |
global $im,$cl,$iw,$ih,$xlm,$xrm,$ytm,$ybm; |
140,7 → 139,7 |
$unit = 'K'; |
$offset = 0; |
$gr_h = $ih - $ytm - $ybm; |
$x_step = ($iw - $xlm - $xrm) / $x_ticks; |
$x_step = ($iw - $xlm - $xrm) / ($x_ticks ?: 1); |
$y_step = ($ih - $ytm - $ybm) / $y_ticks; |
$bar_w = ($x_step / 2) ; |
185,9 → 184,9 |
imagesetthickness($im, 1); |
$sf = ($prescale * $y_scale * $y_ticks) / $gr_h; |
if ($data[0] == 'nodata') |
if (count($data) == 0) |
{ |
$text = 'no data available'; |
$text = T('no data available'); |
$bbox = imagettfbbox(10, 0, GRAPH_FONT, $text); |
$textwidth = $bbox[2] - $bbox[0]; |
imagettftext($im, 10, 0, ($iw-$textwidth)/2, $ytm + 80, $cl['text'], GRAPH_FONT, $text); |
265,11 → 264,11 |
// |
imagefilledrectangle($im, $xlm, $ih-$ybm+39, $xlm+8,$ih-$ybm+47,$cl['rx']); |
imagerectangle($im, $xlm, $ih-$ybm+39, $xlm+8,$ih-$ybm+47,$cl['text']); |
imagettftext($im, 8,0, $xlm+14, $ih-$ybm+48,$cl['text'], GRAPH_FONT,'bytes in'); |
imagettftext($im, 8,0, $xlm+14, $ih-$ybm+48,$cl['text'], GRAPH_FONT,T('bytes in')); |
imagefilledrectangle($im, $xlm+120 , $ih-$ybm+39, $xlm+128,$ih-$ybm+47,$cl['tx']); |
imagerectangle($im, $xlm+120, $ih-$ybm+39, $xlm+128,$ih-$ybm+47,$cl['text']); |
imagettftext($im, 8,0, $xlm+134, $ih-$ybm+48,$cl['text'], GRAPH_FONT,'bytes out'); |
imagettftext($im, 8,0, $xlm+134, $ih-$ybm+48,$cl['text'], GRAPH_FONT,T('bytes out')); |
} |
function output_image() |
/web/acc/manager/stats/graph_svg.php |
---|
145,7 → 145,7 |
svg_rect(0, 0, $iw, $ih, array( 'stroke' => 'none', 'stroke-width' => 0, 'fill' => $cl['image_background']['rgb']) ); |
svg_rect($xlm, $ytm, $iw-$xrm-$xlm, $ih-$ybm-$ytm, array( 'stroke' => 'none', 'stroke-width' => 0, 'fill' => $cl['background']['rgb']) ); |
$depth = 12; |
$depth = 12*SVG_DEPTH_SCALING; |
svg_group( array( 'stroke' => 'none', 'stroke-width' => 0, 'fill' => $cl['background_2']['rgb'], 'fill-opacity' => $cl['background_2']['opacity']) ); |
svg_poly(array($xlm, $ytm, $xlm, $ih - $ybm, $xlm - $depth, $ih - $ybm + $depth, $xlm - $depth, $ytm + $depth)); |
svg_poly(array($xlm, $ih - $ybm, $xlm - $depth, $ih - $ybm + $depth, $iw - $xrm - $depth, $ih - $ybm + $depth, $iw - $xrm, $ih - $ybm)); |
153,7 → 153,7 |
// draw title |
$text = T('Traffic data for')." $iface"; |
svg_text($iw / 2, ($ytm / 2), $text, array( 'stroke' => $cl['text'], 'fill' => $cl['text']['rgb'],'stroke-width' => 0, 'font-family' => SVG_FONT, 'font-weight' => 'bold', 'text-anchor' => 'middle' )); |
svg_text($iw / 2, ($ytm / 2), $text, array( 'stroke' => 'none', 'fill' => $cl['text']['rgb'],'stroke-width' => 0, 'font-family' => SVG_FONT, 'font-weight' => 'bold', 'text-anchor' => 'middle' )); |
} |
function draw_border() |
165,10 → 165,10 |
function draw_grid($x_ticks, $y_ticks) |
{ |
global $cl, $iw, $ih, $xlm, $xrm, $ytm, $ybm; |
$x_step = ($iw - $xlm - $xrm) / $x_ticks; |
$x_step = ($iw - $xlm - $xrm) / ($x_ticks ?: 1); |
$y_step = ($ih - $ytm - $ybm) / $y_ticks; |
$depth = 12; |
$depth = 12*SVG_DEPTH_SCALING; |
svg_group( array( 'stroke' => $cl['grid_stipple_1']['rgb'], 'stroke-opacity' => $cl['grid_stipple_1']['opacity'], 'stroke-width' => '1px', 'stroke-dasharray' => '1,1' ) ); |
for ($i = $xlm; $i <= ($iw - $xrm); $i += $x_step) |
203,7 → 203,7 |
$unit = 'K'; |
$offset = 0; |
$gr_h = $ih - $ytm - $ybm; |
$x_step = ($iw - $xlm - $xrm) / $x_ticks; |
$x_step = ($iw - $xlm - $xrm) / ($x_ticks ?: 1); |
$y_step = ($ih - $ytm - $ybm) / $y_ticks; |
$bar_w = ($x_step / 2) ; |
247,7 → 247,7 |
// |
$sf = ($prescale * $y_scale * $y_ticks) / $gr_h; |
if ($data[0] == 'nodata') |
if (count($data) == 0) |
{ |
$text = 'no data available'; |
svg_text($iw/2, $ytm + 80, $text, array( 'stroke' => $cl['text']['rgb'], 'fill' => $cl['text']['rgb'], 'stroke-width' => 0, 'font-family' => SVG_FONT, 'font-size' => '16pt', 'text-anchor' => 'middle') ); |
262,7 → 262,7 |
$x = $xlm + ($i * $x_step); |
$y = $ytm + ($ih - $ytm - $ybm) - (($data[$i]['rx'] - $offset) / $sf); |
$depth = ($x_ticks < 20) ? 8 : 6; |
$depth = ($x_ticks < 20) ? 8*SVG_DEPTH_SCALING : 6*SVG_DEPTH_SCALING; |
$space = 0; |
$x1 = (int)$x; |
/web/acc/manager/stats/index.php |
---|
39,7 → 39,12 |
print "<ul class=\"iface\">\n"; |
foreach ($iface_list as $if) |
{ |
if ($iface == $if) { |
print "<li class=\"iface active\">"; |
} else { |
print "<li class=\"iface\">"; |
} |
print "<a href=\"$script?if=$if$p\">"; |
if (isset($iface_title[$if])) |
{ |
print $iface_title[$if]; |
48,6 → 53,7 |
{ |
print $if; |
} |
print "</a>"; |
print "<ul class=\"page\">\n"; |
foreach ($page_list as $pg) |
{ |
54,7 → 60,6 |
print "<li class=\"page\"><a href=\"$script?if=$if$p&page=$pg\">".$page_title[$pg]."</a></li>\n"; |
} |
print "</ul></li>\n"; |
} |
print "</ul>\n"; |
} |
62,15 → 67,25 |
function kbytes_to_string($kb) |
{ |
global $byte_notation; |
$units = array('TB','GB','MB','KB'); |
$scale = 1024*1024*1024; |
$ui = 0; |
while (($kb < $scale) && ($scale > 1)) |
$custom_size = isset($byte_notation) && in_array($byte_notation, $units); |
while ((($kb < $scale) && ($scale > 1)) || $custom_size) |
{ |
$ui++; |
$scale = $scale / 1024; |
if ($custom_size && $units[$ui] == $byte_notation) { |
break; |
} |
} |
return sprintf("%0.2f %s", ($kb/$scale),$units[$ui]); |
} |
84,6 → 99,10 |
// |
// build array for write_data_table |
// |
$sum = array(); |
if (count($day) > 0 && count($hour) > 0 && count($month) > 0) { |
$sum[0]['act'] = 1; |
$sum[0]['label'] = T('This hour'); |
$sum[0]['rx'] = $hour[0]['rx']; |
103,6 → 122,7 |
$sum[3]['label'] = T('All time'); |
$sum[3]['rx'] = $trx; |
$sum[3]['tx'] = $ttx; |
} |
write_data_table(T('Summary'), $sum); |
print "<br/>\n"; |
160,7 → 180,7 |
<div id="wrap"> |
<div id="sidebar"><?php write_side_bar(); ?></div> |
<div id="content"> |
<div id="header"><?php print T('Traffic data for')." $iface_title[$iface] ($iface)";?></div> |
<div id="header"><?php print T('Traffic data for').(isset($iface_title[$iface]) ? $iface_title[$iface] : '')." ($iface)";?></div> |
<div id="main"> |
<?php |
$graph_params = "if=$iface&page=$page&style=$style"; |
189,7 → 209,7 |
} |
?> |
</div> |
<div id="footer"><a href="http://www.sqweek.com/">vnStat PHP frontend</a> 1.5.1 - ©2006-2010 Bjorge Dijkstra (bjd _at_ jooz.net)</div> |
<div id="footer"><a href="http://www.sqweek.com/">vnStat PHP frontend</a> 1.5.2 - ©2006-2011 Bjorge Dijkstra (bjd _at_ jooz.net)</div> |
</div> |
</div> |
/web/acc/manager/stats/json.php |
---|
0,0 → 1,81 |
<?php |
// |
// vnStat PHP frontend (c)2006-2010 Bjorge Dijkstra (bjd@jooz.net) |
// |
// This program is free software; you can redistribute it and/or modify |
// it under the terms of the GNU General Public License as published by |
// the Free Software Foundation; either version 2 of the License, or |
// (at your option) any later version. |
// |
// This program is distributed in the hope that it will be useful, |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// GNU General Public License for more details. |
// |
// You should have received a copy of the GNU General Public License |
// along with this program; if not, write to the Free Software |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// |
// |
// see file COPYING or at http://www.gnu.org/licenses/gpl.html |
// for more information. |
// |
require 'config.php'; |
require 'localize.php'; |
require 'vnstat.php'; |
validate_input(); |
require "./themes/$style/theme.php"; |
function write_summary() |
{ |
global $summary,$top,$day,$hour,$month; |
$trx = $summary['totalrx']*1024+$summary['totalrxk']; |
$ttx = $summary['totaltx']*1024+$summary['totaltxk']; |
// |
// build array for write_data_table |
// |
$sum['hour']['act'] = 1; |
$sum['hour']['rx'] = $hour[0]['rx']; |
$sum['hour']['tx'] = $hour[0]['tx']; |
$sum['day']['act'] = 1; |
$sum['day']['rx'] = $day[0]['rx']; |
$sum['day']['tx'] = $day[0]['tx']; |
$sum['month']['act'] = 1; |
$sum['month']['rx'] = $month[0]['rx']; |
$sum['month']['tx'] = $month[0]['tx']; |
$sum['total']['act'] = 1; |
$sum['total']['rx'] = $trx; |
$sum['total']['tx'] = $ttx; |
print json_encode($sum); |
} |
get_vnstat_data(false); |
header('Content-type: application/json; charset=utf-8'); |
$graph_params = "if=$iface&page=$page&style=$style"; |
if ($page == 's') |
{ |
write_summary(); |
} |
else if ($page == 'h') |
{ |
print json_encode(array('hours' => $hour)); |
} |
else if ($page == 'd') |
{ |
print json_encode(array('days' => $day)); |
} |
else if ($page == 'm') |
{ |
print json_encode(array('months' => $month)); |
} |
?> |
/web/acc/manager/stats/lang/br.php |
---|
0,0 → 1,39 |
<?php |
// sidebar labels |
$L['summary'] = 'sumario'; |
$L['hours'] = 'horas'; |
$L['days'] = 'dias'; |
$L['months'] = 'meses'; |
// main table headers |
$L['Summary'] = 'Sumario'; |
$L['Top 10 days'] = 'Top 10 - dias'; |
$L['Last 24 hours'] = 'Ultimas 24 horas'; |
$L['Last 30 days'] = 'Ultimos 30 dias'; |
$L['Last 12 months'] = 'Ultimos 12 meses'; |
// traffic table columns |
$L['In'] = 'Entrada'; |
$L['Out'] = 'Saida'; |
$L['Total'] = 'Total'; |
// summary rows |
$L['This hour'] = 'Esta hora'; |
$L['This day'] = 'Este dia'; |
$L['This month'] = 'Este mes'; |
$L['All time'] = 'Todos os tempos'; |
// graph text |
$L['Traffic data for'] = 'Trafego da'; |
$L['bytes in'] = 'bytes entrada'; |
$L['bytes out'] = 'bytes saida'; |
// date formats |
$L['datefmt_days'] = '%d %B'; |
$L['datefmt_days_img'] = '%d'; |
$L['datefmt_months'] = '%B %Y'; |
$L['datefmt_months_img'] = '%b'; |
$L['datefmt_hours'] = '%l%p'; |
$L['datefmt_hours_img'] = '%l'; |
$L['datefmt_top'] = '%d %B %Y'; |
/web/acc/manager/stats/lang/cn.php |
---|
0,0 → 1,40 |
<?php |
// sidebar labels |
$L['summary'] = '总计'; |
$L['hours'] = '每时'; |
$L['days'] = '每天'; |
$L['months'] = '每月'; |
// main table headers |
$L['Summary'] = '概览'; |
$L['Top 10 days'] = '最高流量的10天'; |
$L['Last 24 hours'] = '过去24小时'; |
$L['Last 30 days'] = '过去30天'; |
$L['Last 12 months'] = '过去12个月'; |
// traffic table columns |
$L['In'] = '流入'; |
$L['Out'] = '流出'; |
$L['Total'] = '总流量'; |
// summary rows |
$L['This hour'] = '本小时'; |
$L['This day'] = '本日'; |
$L['This month'] = '本月'; |
$L['All time'] = '总计'; |
// graph text |
$L['Traffic data for'] = '统计的网络:'; |
$L['bytes in'] = '流入bytes'; |
$L['bytes out'] = '流出bytes'; |
// date formats |
$L['datefmt_days'] = '%B%d日'; |
$L['datefmt_days_img'] = '%d'; |
$L['datefmt_months'] = '%Y年%B'; |
$L['datefmt_months_img'] = '%b'; |
$L['datefmt_hours'] = '%H:00'; |
$L['datefmt_hours_img'] = '%H'; |
$L['datefmt_top'] = '%Y年%m月%d日'; |
/web/acc/manager/stats/lang/cs.php |
---|
34,6 → 34,6 |
$L['datefmt_days_img'] = '%d'; |
$L['datefmt_months'] = '%B %Y'; |
$L['datefmt_months_img'] = '%b'; |
$L['datefmt_hours'] = '%k%P'; |
$L['datefmt_hours'] = '%k%p'; |
$L['datefmt_hours_img'] = '%k'; |
$L['datefmt_top'] = '%d. %B %Y'; |
/web/acc/manager/stats/lang/de.php |
---|
0,0 → 1,40 |
<?php |
// sidebar labels |
$L['summary'] = 'Übersicht'; |
$L['hours'] = 'Stunden'; |
$L['days'] = 'Tage'; |
$L['months'] = 'Monate'; |
// main table headers |
$L['Summary'] = 'Übersicht'; |
$L['Top 10 days'] = 'Top 10 nach Tagen'; |
$L['Last 24 hours'] = 'Letzte 24 Stunden'; |
$L['Last 30 days'] = 'Letzte 30 Tage'; |
$L['Last 12 months'] = 'Letzte 12 Monate'; |
// traffic table columns |
$L['In'] = 'Rein'; |
$L['Out'] = 'Raus'; |
$L['Total'] = 'Total'; |
// summary rows |
$L['This hour'] = 'Diese Stunde'; |
$L['This day'] = 'Dieser Tag'; |
$L['This month'] = 'Dieser Monat'; |
$L['All time'] = 'Alles'; |
// graph text |
$L['Traffic data for'] = 'Trafficdaten für'; |
$L['bytes in'] = 'Bytes rein'; |
$L['bytes out'] = 'Bytes raus'; |
// date formats |
$L['datefmt_days'] = '%d.%B'; |
$L['datefmt_days_img'] = '%d'; |
$L['datefmt_months'] = '%B.%Y'; |
$L['datefmt_months_img'] = '%b'; |
$L['datefmt_hours'] = '%H:%M'; |
$L['datefmt_hours_img'] = '%H'; |
$L['datefmt_top'] = '%d.%B.%Y'; |
/web/acc/manager/stats/lang/en.php |
---|
34,6 → 34,6 |
$L['datefmt_days_img'] = '%d'; |
$L['datefmt_months'] = '%B %Y'; |
$L['datefmt_months_img'] = '%b'; |
$L['datefmt_hours'] = '%l%P'; |
$L['datefmt_hours'] = '%l%p'; |
$L['datefmt_hours_img'] = '%l'; |
$L['datefmt_top'] = '%d %B %Y'; |
/web/acc/manager/stats/lang/es.php |
---|
0,0 → 1,41 |
<?php |
// sidebar labels |
$L['summary'] = 'sumario'; |
$L['hours'] = 'horas'; |
$L['days'] = 'días'; |
$L['months'] = 'meses'; |
// main table headers |
$L['Summary'] = 'Sumario'; |
$L['Top 10 days'] = 'Últimos 10 días'; |
$L['Last 24 hours'] = 'Últimas 24 horas'; |
$L['Last 30 days'] = 'Últimos 30 días'; |
$L['Last 12 months'] = 'Últimos 12 meses'; |
// traffic table columns |
$L['In'] = 'Entrada'; |
$L['Out'] = 'Salida'; |
$L['Total'] = 'Total'; |
// summary rows |
$L['This hour'] = 'Esta hora'; |
$L['This day'] = 'Este día'; |
$L['This month'] = 'Este mes'; |
$L['All time'] = 'Todo el tiempo'; |
// graph text |
$L['Traffic data for'] = 'Trafico de datos para'; |
$L['bytes in'] = 'entrada de bytes'; |
$L['bytes out'] = 'salida de bytes'; |
// date formats |
$L['datefmt_days'] = '%d %B'; |
$L['datefmt_days_img'] = '%d'; |
$L['datefmt_months'] = '%B %Y'; |
$L['datefmt_months_img'] = '%b'; |
$L['datefmt_hours'] = '%H:%M'; |
$L['datefmt_hours_img'] = '%H'; |
$L['datefmt_top'] = '%d %B %Y'; |
// spanish version by Carlos Troetsch |
/web/acc/manager/stats/lang/fi.php |
---|
0,0 → 1,39 |
<?php |
// sidebar labels |
$L['summary'] = 'yhteenveto'; |
$L['hours'] = 'tunnit'; |
$L['days'] = 'päivät'; |
$L['months'] = 'kuukaudet'; |
// main table headers |
$L['Summary'] = 'Yhteenveto'; |
$L['Top 10 days'] = 'Top 10 päivää'; |
$L['Last 24 hours'] = 'Viimeiset 24 tuntia'; |
$L['Last 30 days'] = 'Viimeiset 30 päivää'; |
$L['Last 12 months'] = 'Viimeiset 12 kuukautta'; |
// traffic table columns |
$L['In'] = 'Sisään'; |
$L['Out'] = 'Ulos'; |
$L['Total'] = 'Yhteensä'; |
// summary rows |
$L['This hour'] = 'Viimeisin tunti'; |
$L['This day'] = 'Viimeisin päivä'; |
$L['This month'] = 'Viimeisin kuukausi'; |
$L['All time'] = 'Kaikkiaan'; |
// graph text |
$L['Traffic data for'] = 'Liikennemäärä'; |
$L['bytes in'] = 'tavua sisään'; |
$L['bytes out'] = 'tavua ulos'; |
// date formats |
$L['datefmt_days'] = '%d. %B'; |
$L['datefmt_days_img'] = '%d'; |
$L['datefmt_months'] = '%B %Y'; |
$L['datefmt_months_img'] = '%b'; |
$L['datefmt_hours'] = '%H'; |
$L['datefmt_hours_img'] = '%H'; |
$L['datefmt_top'] = '%a %d. %b %Y'; |
/web/acc/manager/stats/lang/fr.php |
---|
0,0 → 1,39 |
<?php |
// sidebar labels |
$L['summary'] = 'Sommaire'; |
$L['hours'] = 'Heures'; |
$L['days'] = 'Jours'; |
$L['months'] = 'Mois'; |
// main table headers |
$L['Summary'] = 'Sommaire'; |
$L['Top 10 days'] = 'Les 10 meilleurs jours'; |
$L['Last 24 hours'] = 'Dernières 24 heures'; |
$L['Last 30 days'] = 'Derniers 30 jours'; |
$L['Last 12 months'] = 'Les 12 derniers mois'; |
// traffic table columns |
$L['In'] = 'Entrant'; |
$L['Out'] = 'Sortant'; |
$L['Total'] = 'Total'; |
// summary rows |
$L['This hour'] = 'Cette heure'; |
$L['This day'] = 'Aujourd\' hui'; |
$L['This month'] = 'Ce mois'; |
$L['All time'] = 'Tout temps'; |
// graph text |
$L['Traffic data for'] = 'Traffic de donnée pour :'; |
$L['bytes in'] = 'bytes entrants'; |
$L['bytes out'] = 'bytes sortants'; |
// date formats |
$L['datefmt_days'] = '%d %B'; |
$L['datefmt_days_img'] = '%d'; |
$L['datefmt_months'] = '%B %Y'; |
$L['datefmt_months_img'] = '%b'; |
$L['datefmt_hours'] = '%Hh%M'; |
$L['datefmt_hours_img'] = '%H'; |
$L['datefmt_top'] = '%d %B %Y'; |
/web/acc/manager/stats/lang/hr.php |
---|
0,0 → 1,39 |
<?php |
// sidebar labels |
$L['summary'] = 'sažetak'; // summary |
$L['hours'] = 'sati'; |
$L['days'] = 'dani'; |
$L['months'] = 'mjeseci'; |
// main table headers |
$L['Summary'] = 'Sažetak'; |
$L['Top 10 days'] = '10 naprometnijih dana'; |
$L['Last 24 hours'] = 'Zadnja 24 sata'; |
$L['Last 30 days'] = 'Zadnjih 30 dana'; |
$L['Last 12 months'] = 'Zadnjih 12 mjeseci'; |
// traffic table columns |
$L['In'] = 'Primljeno'; |
$L['Out'] = 'Poslano'; |
$L['Total'] = 'Ukupno'; // Total |
// summary rows |
$L['This hour'] = 'Tekući sat'; |
$L['This day'] = 'Danas'; |
$L['This month'] = 'Tekući mjesec'; |
$L['All time'] = 'Sveukupno'; |
// graph text |
$L['Traffic data for'] = 'Promet za'; |
$L['bytes in'] = 'bajta primljeno'; |
$L['bytes out'] = 'bajta poslano'; |
// date formats |
$L['datefmt_days'] = '%d. %m'; |
$L['datefmt_days_img'] = '%d'; |
$L['datefmt_months'] = '%m.%Y'; |
$L['datefmt_months_img'] = '%b'; |
$L['datefmt_hours'] = '%H'; // %k |
$L['datefmt_hours_img'] = '%H'; |
$L['datefmt_top'] = '%d.%m.%Y'; |
/web/acc/manager/stats/lang/hu.php |
---|
0,0 → 1,39 |
<?php |
// sidebar labels |
$L['summary'] = 'Összegzés'; |
$L['hours'] = 'órák'; |
$L['days'] = 'napok'; |
$L['months'] = 'hónapok'; |
// main table headers |
$L['Summary'] = 'Öszegzés'; |
$L['Top 10 days'] = 'Legjobb 10 nap'; |
$L['Last 24 hours'] = 'Utolsó 24 óra'; |
$L['Last 30 days'] = 'Utolsó 30 nap'; |
$L['Last 12 months'] = 'Utolsó 12 hónap'; |
// traffic table columns |
$L['In'] = 'Bejövő'; |
$L['Out'] = 'Kimenő'; |
$L['Total'] = 'Összesen'; |
// summary rows |
$L['This hour'] = 'Ebben az órában'; |
$L['This day'] = 'Ezen a napon'; |
$L['This month'] = 'Ebben a hónapban'; |
$L['All time'] = 'Összesen'; |
// graph text |
$L['Traffic data for'] = 'Forgalmi adatok: '; |
$L['bytes in'] = 'bejövő bájtok'; |
$L['bytes out'] = 'kimenő bájtok'; |
// date formats |
$L['datefmt_days'] = '%d %B'; |
$L['datefmt_days_img'] = '%d'; |
$L['datefmt_months'] = '%B %Y'; |
$L['datefmt_months_img'] = '%b'; |
$L['datefmt_hours'] = '%l%p'; |
$L['datefmt_hours_img'] = '%l'; |
$L['datefmt_top'] = '%d %B %Y'; |
/web/acc/manager/stats/lang/it.php |
---|
0,0 → 1,39 |
<?php |
// sidebar labels |
$L['summary'] = 'Riepilogo'; |
$L['hours'] = 'Ore'; |
$L['days'] = 'Giorni'; |
$L['months'] = 'Mesi'; |
// main table headers |
$L['Summary'] = 'Riepilogo'; |
$L['Top 10 days'] = '10 giorni piu intensivi'; |
$L['Last 24 hours'] = 'Ultime 24 ore'; |
$L['Last 30 days'] = 'Ultimi 30 giorni'; |
$L['Last 12 months'] = 'Ultimi 12 mesi'; |
// traffic table columns |
$L['In'] = 'Entrata'; |
$L['Out'] = 'Uscita'; |
$L['Total'] = 'Totale'; |
// summary rows |
$L['This hour'] = 'Quest ora'; |
$L['This day'] = 'Oggi'; |
$L['This month'] = 'Questo mese'; |
$L['All time'] = 'Sempre'; |
// graph text |
$L['Traffic data for'] = 'Dati per'; |
$L['bytes in'] = 'bytes entrati'; |
$L['bytes out'] = 'bytes usciti'; |
// date formats |
$L['datefmt_days'] = '%d %B'; |
$L['datefmt_days_img'] = '%d'; |
$L['datefmt_months'] = '%B %Y'; |
$L['datefmt_months_img'] = '%b'; |
$L['datefmt_hours'] = '%l%p'; |
$L['datefmt_hours_img'] = '%l'; |
$L['datefmt_top'] = '%d %B %Y'; |
/web/acc/manager/stats/lang/no.php |
---|
0,0 → 1,39 |
<?php |
// sidebar labels |
$L['summary'] = 'Sammendrag'; |
$L['hours'] = 'Timer'; |
$L['days'] = 'Dager'; |
$L['months'] = 'Måneder'; |
// main table headers |
$L['Summary'] = 'Sammendrag'; |
$L['Top 10 days'] = 'Topp 10 dager'; |
$L['Last 24 hours'] = 'Siste 24 timer'; |
$L['Last 30 days'] = 'Siste 30 dager'; |
$L['Last 12 months'] = 'Siste 12 måneder'; |
// traffic table columns |
$L['In'] = 'Inn'; |
$L['Out'] = 'Ut'; |
$L['Total'] = 'Totalt'; |
// summary rows |
$L['This hour'] = 'Denne time'; |
$L['This day'] = 'Idag'; |
$L['This month'] = 'Denne måneden'; |
$L['All time'] = 'Totalt'; |
// graph text |
$L['Traffic data for'] = 'Trafikkdata for'; |
$L['bytes in'] = 'bytes inn'; |
$L['bytes out'] = 'bytes ut'; |
// date formats |
$L['datefmt_days'] = '%d %B'; |
$L['datefmt_days_img'] = '%d'; |
$L['datefmt_months'] = '%B %Y'; |
$L['datefmt_months_img'] = '%b'; |
$L['datefmt_hours'] = '%H:%M'; |
$L['datefmt_hours_img'] = '%H'; |
$L['datefmt_top'] = '%d %B %Y'; |
/web/acc/manager/stats/lang/pl.php |
---|
0,0 → 1,39 |
<?php |
// sidebar labels |
$L['summary'] = 'podsumowanie'; |
$L['hours'] = 'godziny'; |
$L['days'] = 'dni'; |
$L['months'] = 'miesiące'; |
// main table headers |
$L['Summary'] = 'Podsumowanie'; |
$L['Top 10 days'] = 'Top 10 dni'; |
$L['Last 24 hours'] = 'Ostatnie 24 godziny'; |
$L['Last 30 days'] = 'Ostatnie 30 dni'; |
$L['Last 12 months'] = 'Ostatnie 12 miesięcy'; |
// traffic table columns |
$L['In'] = 'Wyjście'; |
$L['Out'] = 'Wejście'; |
$L['Total'] = 'Suma'; |
// summary rows |
$L['This hour'] = 'Ta godzina'; |
$L['This day'] = 'Ten dzień'; |
$L['This month'] = 'Ten miesiąc'; |
$L['All time'] = 'Całość'; |
// graph text |
$L['Traffic data for'] = 'Transfer dla'; |
$L['bytes in'] = 'Wysłane'; |
$L['bytes out'] = 'Odebrane'; |
// date formats |
$L['datefmt_days'] = '%d %B'; |
$L['datefmt_days_img'] = '%d'; |
$L['datefmt_months'] = '%B %Y'; |
$L['datefmt_months_img'] = '%b'; |
$L['datefmt_hours'] = '%l%p'; |
$L['datefmt_hours_img'] = '%l'; |
$L['datefmt_top'] = '%d %B %Y'; |
/web/acc/manager/stats/lang/ru.php |
---|
0,0 → 1,39 |
<?php |
// sidebar labels |
$L['summary'] = 'сводка'; |
$L['hours'] = 'по часам'; |
$L['days'] = 'по дням'; |
$L['months'] = 'по месяцам'; |
// main table headers |
$L['Summary'] = 'Сводка'; |
$L['Top 10 days'] = 'Топ 10 дней'; |
$L['Last 24 hours'] = 'Последние 24 часа'; |
$L['Last 30 days'] = 'Последние 30 дней'; |
$L['Last 12 months'] = 'Последние 12 месяцев'; |
// traffic table columns |
$L['In'] = 'Входящий'; |
$L['Out'] = 'Исходящий'; |
$L['Total'] = 'Общий'; |
// summary rows |
$L['This hour'] = 'Текущий час'; |
$L['This day'] = 'Текущий день'; |
$L['This month'] = 'Текущий месяц'; |
$L['All time'] = 'За все время'; |
// graph text |
$L['Traffic data for'] = 'Статистика трафика для'; |
$L['bytes in'] = 'получено'; |
$L['bytes out'] = 'передано'; |
// date formats |
$L['datefmt_days'] = '%d %B'; |
$L['datefmt_days_img'] = '%d'; |
$L['datefmt_months'] = '%B %Y'; |
$L['datefmt_months_img'] = '%b'; |
$L['datefmt_hours'] = '%H:%M'; |
$L['datefmt_hours_img'] = '%H'; |
$L['datefmt_top'] = '%d %B %Y'; |
/web/acc/manager/stats/lang/sk.php |
---|
0,0 → 1,39 |
<?php |
// sidebar labels |
$L['summary'] = 'zhrnutie'; |
$L['hours'] = 'hodiny'; |
$L['days'] = 'dni'; |
$L['months'] = 'mesiace'; |
// main table headers |
$L['Summary'] = 'Zhrnutie'; |
$L['Top 10 days'] = 'Naj 10 dni'; |
$L['Last 24 hours'] = 'Posledných 24 hodin'; |
$L['Last 30 days'] = 'Posledných 30 dni'; |
$L['Last 12 months'] = 'Posledných 12 mesiacov'; |
// traffic table columns |
$L['In'] = 'Sťahovanie'; |
$L['Out'] = 'Posielanie'; |
$L['Total'] = 'Celkom'; |
// summary rows |
$L['This hour'] = 'Túto hodinu'; |
$L['This day'] = 'Tento deň'; |
$L['This month'] = 'Tento mesiac'; |
$L['All time'] = 'Celkom'; |
// graph text |
$L['Traffic data for'] = 'Prehlad pre'; |
$L['bytes in'] = 'bajtov stiahnuté'; |
$L['bytes out'] = 'bajtov poslané'; |
// date formats |
$L['datefmt_days'] = '%d %B'; |
$L['datefmt_days_img'] = '%d'; |
$L['datefmt_months'] = '%B %Y'; |
$L['datefmt_months_img'] = '%b'; |
$L['datefmt_hours'] = '%l%p'; |
$L['datefmt_hours_img'] = '%l'; |
$L['datefmt_top'] = '%d %B %Y'; |
/web/acc/manager/stats/themes/light/style.css |
---|
4,6 → 4,18 |
padding: 0; |
} |
a[href]:link, |
a[href]:visited { |
color: #00f; |
text-decoration: none; |
} |
a[href]:hover, |
a[href]:active, |
a[href]:focus { |
color: #c00; |
text-decoration: none; |
} |
#wrap |
{ |
xwidth: 868px; |
26,13 → 38,24 |
background-color: #eef; |
} |
#sidebar li.iface ul |
{ |
display: none; |
} |
#sidebar li.iface.active ul |
{ |
display: block; |
} |
#sidebar li.iface:hover ul |
{ |
display: block; |
} |
#sidebar li.iface |
{ |
margin: 0; |
margin: 2px; |
padding: 0; |
list-style-type: none; |
font-family: 'Trebuchet MS', Verdana, sans-serif; |
font-size: 1em; |
font-size: 12px; |
font-weight: bold; |
xborder-top: 1px solid #99b; |
border-bottom: 1px solid #99b; |
106,6 → 129,7 |
padding: 8px; |
border-left: 1px solid #99b; |
border-right: 1px solid #99b; |
border-bottom: 1px solid #99b; |
border-collapse: collapse; |
} |
/web/acc/manager/stats/vnstat.php |
---|
83,7 → 83,7 |
} |
$tp = "./themes/$style"; |
if (!is_dir($tp) || !file_exists("$tp/theme.php")) |
if (!is_dir($tp) || !file_exists("$tp/theme.php") || !preg_match('/^[a-z0-9-_]+$/i', $style)) |
{ |
$style = DEFAULT_COLORSCHEME; |
} |
90,7 → 90,7 |
} |
function get_vnstat_data() |
function get_vnstat_data($use_label=true) |
{ |
global $iface, $vnstat_bin, $data_dir; |
global $hour,$day,$month,$top,$summary; |
123,6 → 123,10 |
$month = array(); |
$top = array(); |
if (strpos($vnstat_data[0], 'Error') !== false) { |
return; |
} |
// |
// extract data |
// |
135,12 → 139,12 |
$day[$d[1]]['rx'] = $d[3] * 1024 + $d[5]; |
$day[$d[1]]['tx'] = $d[4] * 1024 + $d[6]; |
$day[$d[1]]['act'] = $d[7]; |
if ($d[2] != 0) |
if ($d[2] != 0 && $use_label) |
{ |
$day[$d[1]]['label'] = strftime(T('datefmt_days'),$d[2]); |
$day[$d[1]]['img_label'] = strftime(T('datefmt_days_img'), $d[2]); |
} |
else |
elseif($use_label) |
{ |
$day[$d[1]]['label'] = ''; |
$day[$d[1]]['img_label'] = ''; |
152,12 → 156,12 |
$month[$d[1]]['rx'] = $d[3] * 1024 + $d[5]; |
$month[$d[1]]['tx'] = $d[4] * 1024 + $d[6]; |
$month[$d[1]]['act'] = $d[7]; |
if ($d[2] != 0) |
if ($d[2] != 0 && $use_label) |
{ |
$month[$d[1]]['label'] = strftime(T('datefmt_months'), $d[2]); |
$month[$d[1]]['img_label'] = strftime(T('datefmt_months_img'), $d[2]); |
} |
else |
else if ($use_label) |
{ |
$month[$d[1]]['label'] = ''; |
$month[$d[1]]['img_label'] = ''; |
169,7 → 173,7 |
$hour[$d[1]]['rx'] = $d[3]; |
$hour[$d[1]]['tx'] = $d[4]; |
$hour[$d[1]]['act'] = 1; |
if ($d[2] != 0) |
if ($d[2] != 0 && $use_label) |
{ |
$st = $d[2] - ($d[2] % 3600); |
$et = $st + 3600; |
176,7 → 180,7 |
$hour[$d[1]]['label'] = strftime(T('datefmt_hours'), $st).' - '.strftime(T('datefmt_hours'), $et); |
$hour[$d[1]]['img_label'] = strftime(T('datefmt_hours_img'), $d[2]); |
} |
else |
else if ($use_label) |
{ |
$hour[$d[1]]['label'] = ''; |
$hour[$d[1]]['img_label'] = ''; |
188,24 → 192,20 |
$top[$d[1]]['rx'] = $d[3] * 1024 + $d[5]; |
$top[$d[1]]['tx'] = $d[4] * 1024 + $d[6]; |
$top[$d[1]]['act'] = $d[7]; |
if($use_label) |
{ |
$top[$d[1]]['label'] = strftime(T('datefmt_top'), $d[2]); |
$top[$d[1]]['img_label'] = ''; |
} |
} |
else |
{ |
$summary[$d[0]] = isset($d[1]) ? $d[1] : ''; |
} |
} |
if (count($day) == 0) |
$day[0] = 'nodata'; |
rsort($day); |
if (count($month) == 0) |
$month[0] = 'nodata'; |
rsort($month); |
if (count($hour) == 0) |
$hour[0] = 'nodata'; |
rsort($hour); |
} |
?> |