X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=html%2Fcgi-bin%2Findex.cgi;h=9135b75f8bbea74012ba305f24e9d5b3dd94775c;hb=fd5c3064754c3bd6e0c65f49ca91c21ee8cd0411;hp=c984300e48ec57a97b81376c2510bb655fd1ab09;hpb=786f2c8a296f053a6db934993a0611f1dadb8db5;p=people%2Fteissler%2Fipfire-2.x.git diff --git a/html/cgi-bin/index.cgi b/html/cgi-bin/index.cgi index c984300e4..9135b75f8 100644 --- a/html/cgi-bin/index.cgi +++ b/html/cgi-bin/index.cgi @@ -37,6 +37,11 @@ $pppsettings{'PROFILENAME'} = 'None'; &General::readhash("${General::swroot}/ethernet/settings", \%netsettings); &General::readhash("${General::swroot}/ddns/settings", \%ddnssettings); +my %color = (); +my %mainsettings = (); +&General::readhash("${General::swroot}/main/settings", \%mainsettings); +&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color); + my $connstate = &Header::connectionstatus(); if ($connstate =~ /$Lang::tr{'dod waiting'}/ || -e "${General::swroot}/main/refreshindex") { $refresh = ""; @@ -67,7 +72,7 @@ my $dialButtonDisabled = "disabled='disabled'"; &Header::openbigbox('', 'center'); &Header::openbox('100%', 'center', &Header::cleanhtml(`/bin/uname -n`,"y")); -if ( ( $pppsettings{'VALID'} eq 'yes' && $modemsettings{'VALID'} eq 'yes' ) || ( $netsettings{'CONFIG_TYPE'} =~ /^(2|3|6|7)$/ && $netsettings{'RED_TYPE'} =~ /^(DHCP|STATIC)$/ )) { +if ( ( $pppsettings{'VALID'} eq 'yes' && $modemsettings{'VALID'} eq 'yes' ) || ( $netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/ && $netsettings{'RED_TYPE'} =~ /^(DHCP|STATIC)$/ )) { if (open(IPADDR,"${General::swroot}/ddns/ipcache")) { $ipaddr = ; close IPADDR; @@ -98,12 +103,15 @@ print < -
$Lang::tr{'network'} - IP - $Lang::tr{'status'} +
$Lang::tr{'network'} + IP + $Lang::tr{'status'}
$Lang::tr{'internet'}:
$ipaddr $connstate +END +print `/usr/local/bin/dialctrl.pl show`; +print <
$Lang::tr{'profile'}: @@ -282,7 +290,63 @@ if ($warnmessage) { } print < + END + +require "${General::swroot}/net-traffic/net-traffic-admin.pl"; + +if($NETTRAFF::settings{'SHOW_AT_HOME'} eq 'on') +{ + my %calc = (); + $calc{'CALC_VOLUME_TOTAL'} = 0; + $calc{'CALC_VOLUME_IN'} = 0; + $calc{'CALC_VOLUME_OUT'} = 0; + $calc{'CALC_WEEK_TOTAL'} = 0; + $calc{'CALC_WEEK_IN'} = 0; + $calc{'CALC_WEEK_OUT'} = 0; + $calc{'CALC_LAST_RUN'} = 0; + $calc{'CALC_PERCENT'} = 0; + + &General::readhash($NETTRAFF::logfile, \%calc); + + my $calctime = &NETTRAFF::getFormatedDate($calc{'CALC_LAST_RUN'}); + + print <
+ + + + + + + + + + + + + + + + + + + + + + + +END + + if($NETTRAFF::settings{'MONTHLY_VOLUME_ON'} eq 'on') + { +print ""; + } + print "
$Lang::tr{'traffic monitor'} ($Lang::tr{'traffic calc time'} $calctime)
$Lang::tr{'trafficin'}$Lang::tr{'trafficout'}$Lang::tr{'trafficsum'}
$Lang::tr{'this weeks volume'} (MB):$calc{'CALC_WEEK_IN'}$calc{'CALC_WEEK_OUT'}$calc{'CALC_WEEK_TOTAL'}
$Lang::tr{'this months volume'} (MB):$calc{'CALC_VOLUME_IN'}$calc{'CALC_VOLUME_OUT'}$calc{'CALC_VOLUME_TOTAL'}
max. $NETTRAFF::settings{'MONTHLY_VOLUME'} MB"; +&NETTRAFF::traffPercentbar("$calc{'CALC_PERCENT'}%"); +print "  $calc{'CALC_PERCENT'}%
"; +} + &Header::closebox(); &Header::closebigbox();