public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Leo Hofmann <hofmann@leo-andres.de>
To: development@lists.ipfire.org
Subject: Re: [PATCH] rrd graphs: Remove unused individual graph output
Date: Wed, 14 Jul 2021 22:38:52 +0200	[thread overview]
Message-ID: <ccbff4bb-858a-9299-e58a-31c0b4a9694c@leo-andres.de> (raw)
In-Reply-To: <77952DA6-9D66-44AD-89D1-E3467EB25BB1@ipfire.org>

[-- Attachment #1: Type: text/plain, Size: 13982 bytes --]

Hi,

Am 14.07.2021 um 18:09 schrieb Michael Tremer:
> Hello,
>
> Thank you for tidying up the web user interface :)
>
>> On 13 Jul 2021, at 20:32, Leo-Andres Hofmann <hofmann(a)leo-andres.de> wrote:
>>
>> PNG generation has been moved to getrrdimage.cgi
>>
>> Signed-off-by: Leo-Andres Hofmann <hofmann(a)leo-andres.de>
>> ---
>>
>> Hi all,
>>
>> this patch is related to this thread from april:
>> https://lists.ipfire.org/pipermail/development/2021-April/009721.html
>>
>> I mentioned that the graph output can be removed, but until
>> now I didn't have time to do finish this.
>>
>> Kind regards,
>> Leo
>>
>> html/cgi-bin/entropy.cgi        | 11 -----------
>> html/cgi-bin/hardwaregraphs.cgi | 32 --------------------------------
>> html/cgi-bin/media.cgi          | 11 -----------
>> html/cgi-bin/memory.cgi         | 14 --------------
>> html/cgi-bin/netexternal.cgi    | 11 -----------
>> html/cgi-bin/netinternal.cgi    | 17 -----------------
>> html/cgi-bin/netother.cgi       | 19 -------------------
>> html/cgi-bin/netovpnrw.cgi      | 10 ----------
>> html/cgi-bin/netovpnsrv.cgi     | 14 --------------
>> html/cgi-bin/qos.cgi            | 11 -----------
>> html/cgi-bin/system.cgi         | 18 ------------------
>> 11 files changed, 168 deletions(-)
>>
>> diff --git a/html/cgi-bin/entropy.cgi b/html/cgi-bin/entropy.cgi
>> index f8045db5a..6cfcadd1c 100644
>> --- a/html/cgi-bin/entropy.cgi
>> +++ b/html/cgi-bin/entropy.cgi
>> @@ -30,16 +30,6 @@ require "${General::swroot}/lang.pl";
>> require "${General::swroot}/header.pl";
>> require "${General::swroot}/graphs.pl";
>>
>> -my @querry = split(/\?/,$ENV{'QUERY_STRING'});
>> -$querry[0] = '' unless defined $querry[0];
>> -$querry[1] = 'hour' unless defined $querry[1];
>> -
>> -if ( $querry[0] ne~ "") {
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updateentropygraph($querry[1]);
>> -
>> -} else {
>> 	&Header::showhttpheaders();
>> 	&Header::openpage($Lang::tr{'entropy'}, 1, '');
>> 	&Header::openbigbox('100%', 'left');
>> @@ -86,7 +76,6 @@ EOF
>>
>> 	&Header::closebigbox();
>> 	&Header::closepage();
>> -}
>>
>> sub has_rdrand() {
>> 	open(FILE, "/proc/cpuinfo") or return 0;
>> diff --git a/html/cgi-bin/hardwaregraphs.cgi b/html/cgi-bin/hardwaregraphs.cgi
>> index e8f0fa362..be45a8c99 100644
>> --- a/html/cgi-bin/hardwaregraphs.cgi
>> +++ b/html/cgi-bin/hardwaregraphs.cgi
>> @@ -90,35 +90,6 @@ if (@thermal_zone_sensors) {
>> 	}
>> }
>>
>> -my @querry = split(/\?/,$ENV{'QUERY_STRING'});
>> -$querry[0] = '' unless defined $querry[0];
>> -$querry[1] = 'hour' unless defined $querry[1];
>> -
>> -if ( $querry[0] =~ "hwtemp"){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updatehwtempgraph($querry[1]);
>> -}elsif ( $querry[0] =~ "hwfan"){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updatehwfangraph($querry[1]);
>> -}elsif ( $querry[0] =~ "hwvolt"){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updatehwvoltgraph($querry[1]);
>> -}elsif ( $querry[0] =~ "thermaltemp"){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updatethermaltempgraph($querry[1]);
>> -}elsif ( $querry[0] =~ "sd?" ){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updatehddgraph($querry[0],$querry[1]);
>> -}elsif ( $querry[0] =~ "nvme?" ){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updatehddgraph($querry[0],$querry[1]);
>> -}else{
>> 	&Header::showhttpheaders();
>> 	&Header::openpage($Lang::tr{'hardware graphs'}, 1, '');
>> 	&Header::openbigbox('100%', 'left');
>> @@ -184,9 +155,6 @@ if ( $querry[0] =~ "hwtemp"){
>> 	&Header::closebigbox();
>> 	&Header::closepage();
> Shouldn’t this be out-dented again?

Yes that's right. I'll submit this again with a second patch to correct the formatting.

Regards
Leo

>
>> -}
>> -
>> -
>> sub sensorsbox {
>> 	&Header::openbox('100%', 'center', "$Lang::tr{'mbmon settings'}");
>>
>> diff --git a/html/cgi-bin/media.cgi b/html/cgi-bin/media.cgi
>> index f574729ed..835565811 100644
>> --- a/html/cgi-bin/media.cgi
>> +++ b/html/cgi-bin/media.cgi
>> @@ -41,18 +41,8 @@ undef (@dummy);
>>
>> my %cgiparams=();
>>
>> -my @querry = split(/\?/,$ENV{'QUERY_STRING'});
>> -$querry[0] = '' unless defined $querry[0];
>> -$querry[1] = 'hour' unless defined $querry[1];
>> -
>> my @devices = `ls -1 /sys/block | grep -E '^sd|^mmcblk|^nvme|^xvd|^vd|^md' | sort | uniq`;
>>
>> -if ( $querry[0] =~ "sd?" || $querry[0] =~ "mmcblk?" || $querry[0] =~ "nvme?n?" || $querry[0] =~ "xvd??" || $querry[0] =~ "vd?" || $querry[0] =~ "md*" ){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	
>> -	&Graphs::updatediskgraph($querry[0],$querry[1]);
>> -}else{
>> 	&Header::showhttpheaders();
>> 	&Header::openpage($Lang::tr{'media information'}, 1, '');
>> 	&Header::openbigbox('100%', 'left');
>> @@ -162,7 +152,6 @@ END
>>
>> 	&Header::closebigbox();
>> 	&Header::closepage();
> Likewise.
>
>> -}
>>
>> sub percentbar
>> {
>> diff --git a/html/cgi-bin/memory.cgi b/html/cgi-bin/memory.cgi
>> index 441b1d4e7..037d5800b 100644
>> --- a/html/cgi-bin/memory.cgi
>> +++ b/html/cgi-bin/memory.cgi
>> @@ -35,19 +35,6 @@ my %mainsettings = ();
>> &General::readhash("${General::swroot}/main/settings", \%mainsettings);
>> &General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
>>
>> -my @querry = split(/\?/,$ENV{'QUERY_STRING'});
>> -$querry[0] = '' unless defined $querry[0];
>> -$querry[1] = 'hour' unless defined $querry[1];
>> -
>> -if ( $querry[0] =~ "memory"){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updatememorygraph($querry[1]);
>> -}elsif ( $querry[0] =~ "swap"){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updateswapgraph($querry[1]);
>> -}else{
>> 	&Header::showhttpheaders();
>> 	&Header::openpage($Lang::tr{'memory information'}, 1, '');
>> 	&Header::openbigbox('100%', 'left');
>> @@ -139,7 +126,6 @@ END
>>
>> 	&Header::closebigbox();
>> 	&Header::closepage();
>> -}
>>
>> sub percentbar{
>> 	my $percent = $_[0];
>> diff --git a/html/cgi-bin/netexternal.cgi b/html/cgi-bin/netexternal.cgi
>> index 1e3760c2b..704cd8727 100644
>> --- a/html/cgi-bin/netexternal.cgi
>> +++ b/html/cgi-bin/netexternal.cgi
>> @@ -43,16 +43,6 @@ my %netsettings=();
>> my @graphs=();
>> my %dhcpinfo=();
>>
>> -my @querry = split(/\?/,$ENV{'QUERY_STRING'});
>> -$querry[0] = '' unless defined $querry[0];
>> -$querry[1] = 'hour' unless defined $querry[1];
>> -
>> -if ( $querry[0] ne~ ""){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updateifgraph($querry[0],$querry[1]);
>> -}else{
>> -
>> 	&Header::showhttpheaders();
>> 	&Header::openpage($Lang::tr{'network traffic graphs external'}, 1, '');
>> 	&Header::openbigbox('100%', 'left');
>> @@ -163,4 +153,3 @@ END
>>
>> 	&Header::closebigbox();
>> 	&Header::closepage();
>> -}
> Likewise.
>
>> diff --git a/html/cgi-bin/netinternal.cgi b/html/cgi-bin/netinternal.cgi
>> index 3c2828fbf..8d7105e36 100644
>> --- a/html/cgi-bin/netinternal.cgi
>> +++ b/html/cgi-bin/netinternal.cgi
>> @@ -40,22 +40,6 @@ my %netsettings=();
>> my @graphs=();
>> my @wireless=();
>>
>> -my @querry = split(/\?/,$ENV{'QUERY_STRING'});
>> -$querry[0] = '' unless defined $querry[0];
>> -$querry[1] = 'hour' unless defined $querry[1];
>> -$querry[2] = '' unless defined $querry[2];
>> -
>> -if ( $querry[0] =~ /wireless/ ){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	$querry[0] =~ s/wireless//g;
>> -	&Graphs::updatewirelessgraph($querry[0],$querry[1]);
>> -}elsif ( $querry[0] ne "" ){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updateifgraph($querry[0],$querry[1]);
>> -}else{
>> -
>> 	&Header::showhttpheaders();
>> 	&Header::openpage($Lang::tr{'network traffic graphs internal'}, 1, '');
>> 	&Header::openbigbox('100%', 'left');
>> @@ -84,4 +68,3 @@ if ( $querry[0] =~ /wireless/ ){
>>
>> 	&Header::closebigbox();
>> 	&Header::closepage();
>> -}	
>> diff --git a/html/cgi-bin/netother.cgi b/html/cgi-bin/netother.cgi
>> index cbd2bc228..c1d6a64a0 100755
>> --- a/html/cgi-bin/netother.cgi
>> +++ b/html/cgi-bin/netother.cgi
>> @@ -37,24 +37,6 @@ my %mainsettings = ();
>>
>> my @pings=();
>>
>> -my @querry = split(/\?/,$ENV{'QUERY_STRING'});
>> -$querry[0] = '' unless defined $querry[0];
>> -$querry[1] = 'hour' unless defined $querry[1];
>> -
>> -if ( $querry[0] eq "conntrack") {
>> -	print "Content-Type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updateconntrackgraph($querry[1]);
>> -} elsif ( $querry[0] =~ "fwhits"){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updatefwhitsgraph($querry[1]);
>> -}elsif ( $querry[0] ne ""){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updatepinggraph($querry[0],$querry[1]);
>> -}else{
>> -
>> 	&Header::showhttpheaders();
>> 	&Header::openpage($Lang::tr{'network traffic graphs others'}, 1, '');
>> 	&Header::openbigbox('100%', 'left');
>> @@ -103,4 +85,3 @@ if ( $querry[0] eq "conntrack") {
>>
>> 	&Header::closebigbox();
>> 	&Header::closepage();
>> -}	
>> diff --git a/html/cgi-bin/netovpnrw.cgi b/html/cgi-bin/netovpnrw.cgi
>> index 00ef35337..fc2e43508 100755
>> --- a/html/cgi-bin/netovpnrw.cgi
>> +++ b/html/cgi-bin/netovpnrw.cgi
>> @@ -37,15 +37,6 @@ my %mainsettings = ();
>>
>> my @vpns=();
>>
>> -my @querry = split(/\?/,uri_unescape($ENV{'QUERY_STRING'}));
>> -$querry[0] = '' unless defined $querry[0];
>> -$querry[1] = 'week' unless defined $querry[1];
>> -
>> -if ( $querry[0] ne "" && $querry[0] ne "UNDEF"){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updatevpngraph($querry[0],$querry[1]);
>> -}else{
>> 	&Header::showhttpheaders();
>> 	&Header::openpage($Lang::tr{'vpn statistic rw'}, 1, '');
>> 	&Header::openbigbox('100%', 'left');
>> @@ -69,4 +60,3 @@ if ( $querry[0] ne "" && $querry[0] ne "UNDEF"){
>>
>> 	&Header::closebigbox();
>> 	&Header::closepage();
>> -}
>> diff --git a/html/cgi-bin/netovpnsrv.cgi b/html/cgi-bin/netovpnsrv.cgi
>> index a53090f0f..6ff6e17fe 100755
>> --- a/html/cgi-bin/netovpnsrv.cgi
>> +++ b/html/cgi-bin/netovpnsrv.cgi
>> @@ -49,19 +49,6 @@ foreach my $key (sort {$vpnsettings{$a}[1] <=> $vpnsettings{$b}[1]} keys %vpnset
>> 	$ipsecgraphs{$vpnsettings{$key}[1]} = "${interface_mode}${key}";
>> }
>>
>> -my @querry = split(/\?/,$ENV{'QUERY_STRING'});
>> -$querry[0] = '' unless defined $querry[0];
>> -$querry[1] = 'week' unless defined $querry[1];
>> -
>> -if ( $querry[0] ne ""){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	if (grep { $_ eq $querry[0] } values %ipsecgraphs) {
>> -		&Graphs::updateifgraph($querry[0],$querry[1]);
>> -	} else {
>> -		&Graphs::updatevpnn2ngraph($querry[0],$querry[1]);
>> -	}
>> -}else{
>> 	&Header::showhttpheaders();
>> 	&Header::openpage($Lang::tr{'vpn statistic n2n'}, 1, '');
>> 	&Header::openbigbox('100%', 'left');
>> @@ -91,4 +78,3 @@ if ( $querry[0] ne ""){
>>
>> 	&Header::closebigbox();
>> 	&Header::closepage();
>> -}
>> diff --git a/html/cgi-bin/qos.cgi b/html/cgi-bin/qos.cgi
>> index fa566b523..3410c7353 100644
>> --- a/html/cgi-bin/qos.cgi
>> +++ b/html/cgi-bin/qos.cgi
>> @@ -111,15 +111,6 @@ my %mainsettings = ();
>> &General::readhash("${General::swroot}/main/settings", \%mainsettings);
>> &General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
>>
>> -my @querry = split(/\?/,$ENV{'QUERY_STRING'});
>> -$querry[0] = '' unless defined $querry[0];
>> -$querry[1] = 'hour' unless defined $querry[1];
>> -
>> -if ( $querry[0] ne ""){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updateqosgraph($querry[0],$querry[1]);
>> -}else{
>> 	&Header::showhttpheaders();
>>
>> 	&Header::openpage('QoS', 1, '');
>> @@ -721,8 +712,6 @@ if ( ($qossettings{'DEFCLASS_INC'} eq '') || ($qossettings{'DEFCLASS_OUT'} eq ''
>> &Header::closebigbox();
>> &Header::closepage();
>>
>> -}
>> -
>> ############################################################################################################################
>> ############################################################################################################################
>>
>> diff --git a/html/cgi-bin/system.cgi b/html/cgi-bin/system.cgi
>> index 67c479736..595ca0eab 100644
>> --- a/html/cgi-bin/system.cgi
>> +++ b/html/cgi-bin/system.cgi
>> @@ -35,23 +35,6 @@ my %mainsettings = ();
>> &General::readhash("${General::swroot}/main/settings", \%mainsettings);
>> &General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
>>
>> -my @querry = split(/\?/,$ENV{'QUERY_STRING'});
>> -$querry[0] = '' unless defined $querry[0];
>> -$querry[1] = 'hour' unless defined $querry[1];
>> -
>> -if ( $querry[0] =~ "cpufreq"){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updatecpufreqgraph($querry[1]);
>> -}elsif ( $querry[0] =~ "cpu"){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updatecpugraph($querry[1]);
>> -}elsif ( $querry[0] =~ "load"){
>> -	print "Content-type: image/png\n\n";
>> -	binmode(STDOUT);
>> -	&Graphs::updateloadgraph($querry[1]);
>> -}else{
>> 	&Header::showhttpheaders();
>> 	&Header::openpage($Lang::tr{'status information'}, 1, '');
>> 	&Header::openbigbox('100%', 'left');
>> @@ -72,4 +55,3 @@ if ( $querry[0] =~ "cpufreq"){
>>
>> 	&Header::closebigbox();
>> 	&Header::closepage();
>> -}
>> -- 
>> 2.27.0.windows.1
>>

      reply	other threads:[~2021-07-14 20:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13 19:32 Leo-Andres Hofmann
2021-07-14 16:09 ` Michael Tremer
2021-07-14 20:38   ` Leo Hofmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ccbff4bb-858a-9299-e58a-31c0b4a9694c@leo-andres.de \
    --to=hofmann@leo-andres.de \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox