public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Leo-Andres Hofmann <hofmann@leo-andres.de>
To: development@lists.ipfire.org
Subject: [PATCH] rrdimage: Improve CGI & cosmetic changes
Date: Sun, 11 Apr 2021 14:01:06 +0200	[thread overview]
Message-ID: <20210411120106.1993-1-hofmann@leo-andres.de> (raw)

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

Write graph error messages to the system log, to simplify
further inspection by the user.
Add additional parameter check to prevent a possible redirect loop
if the URL format is changed in the future.

Cosmetic: Use underlining instead of background color for highlighting

Fixes #10643

Signed-off-by: Leo-Andres Hofmann <hofmann(a)leo-andres.de>
---
 html/cgi-bin/getrrdimage.cgi                  | 6 +++++-
 html/html/themes/ipfire/include/css/style.css | 4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/html/cgi-bin/getrrdimage.cgi b/html/cgi-bin/getrrdimage.cgi
index 0caefe0ac..34ee4bf7a 100644
--- a/html/cgi-bin/getrrdimage.cgi
+++ b/html/cgi-bin/getrrdimage.cgi
@@ -60,7 +60,7 @@ unless(($origin =~ /^\w+?\.cgi$/) && ($graph =~ /^[\w-]+?$/) && ($range ~~ @Grap
 
 # Unsupported graph origin: Redirect request to the CGI specified in the "origin" parameter
 # This enables backwards compatibility with addons that use Graphs::makegraphbox to ouput their own graphs
-unless($origin ~~ @supported_origins) {
+unless(($origin ~~ @supported_origins) || ($origin eq "getrrdimage.cgi")) {
 	# Rewrite to old URL format: /[graph origin cgi]?[graph name]?[time range]
 	my $location = "https://$ENV{'SERVER_NAME'}:$ENV{'SERVER_PORT'}/cgi-bin/${origin}?${graph}?${range}";
 	
@@ -195,6 +195,10 @@ if($origin eq "entropy.cgi") {				## entropy.cgi
 # Add request parameters for debugging
 if($graphstatus) {
 	$graphstatus = "$graphstatus\n($origin, $graph, $range)";
+
+	# Save message in system log for further inspection
+	General::log($graphstatus);
+
 	_print_error($graphstatus);
 }
 
diff --git a/html/html/themes/ipfire/include/css/style.css b/html/html/themes/ipfire/include/css/style.css
index 10644a9f8..2c727a770 100644
--- a/html/html/themes/ipfire/include/css/style.css
+++ b/html/html/themes/ipfire/include/css/style.css
@@ -348,14 +348,14 @@ div.rrdimage > ul {
 	border: none;
 	background: none;
 	cursor: pointer;
-	text-decoration: underline;
+	text-decoration: none;
 }
 .rrdimage button:focus {
 	outline: none;
 	box-shadow: none;
 }
 .rrdimage button.selected {
-	background-color: rgba(135, 203, 0, 0.2);
+	text-decoration: underline;
 }
 
 div.rrdimage > img {
-- 
2.27.0.windows.1


                 reply	other threads:[~2021-04-11 12:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210411120106.1993-1-hofmann@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