]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
rrdimage: Improve CGI & cosmetic changes
authorLeo-Andres Hofmann <hofmann@leo-andres.de>
Sun, 11 Apr 2021 12:01:06 +0000 (14:01 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 12 Apr 2021 09:31:18 +0000 (09:31 +0000)
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@leo-andres.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/getrrdimage.cgi
html/html/themes/ipfire/include/css/style.css

index 0caefe0ac81eafda93dfb6489b41eaf6d9307e4e..34ee4bf7aa83b26eba44c714b108a0071487e476 100644 (file)
@@ -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);
 }
 
index 10644a9f822d8c0bd026a2d5c921ea992924a13b..2c727a7707f09fc312e1bbe838daab4bf5ced6a6 100644 (file)
@@ -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 {