]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
services.cgi: add link to addon config if ui exists for it
authorRobin Roevens <robin.roevens@disroot.org>
Tue, 11 Oct 2022 22:01:57 +0000 (00:01 +0200)
committerPeter Müller <peter.mueller@ipfire.org>
Sat, 29 Oct 2022 08:56:48 +0000 (08:56 +0000)
* If a cgi file exists with the same name as an addon, the
  displayed service will be a link to that cgi file.

Signed-off-by: Robin Roevens <robin.roevens@disroot.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/services.cgi

index 4b379251efb88617592248e353f107ba96a311ba..14ed01c50a689d632a12e83be573435e4d6a0abf 100644 (file)
@@ -192,6 +192,10 @@ END
 
                                # Add addon name to displayname of service if servicename differs from addon
                                my $displayname = ($pak ne $service) ? "$service ($pak)" : $service;
+                               if ( -e "/srv/web/ipfire/cgi-bin/$pak.cgi" ) {
+                                       $displayname = ($pak ne $service) ? "$service (<a href=\'$pak.cgi\'>$pak</a>)" : "<a href=\'$pak.cgi\'>$service</a>";
+                               } 
+
                                print "<td align='left' $col width='31%'>$displayname</td> ";
 
                                my $status = isautorun($pak,$service,$col);