✨ Only show metrics page if debug flag is set
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 28 Jul 2019 11:17:42 +0000 (13:17 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 28 Jul 2019 11:17:42 +0000 (13:17 +0200)
src/main/java/net/pterodactylus/sone/web/WebInterface.java

index a6dc8ff..a439e4b 100644 (file)
@@ -616,7 +616,9 @@ public class WebInterface implements SessionProvider {
                pageToadletRegistry.addPage(new EmptyImageTitlePage(this, loaders, templateRenderer));
                pageToadletRegistry.addPage(new EmptyAlbumTitlePage(this, loaders, templateRenderer));
                pageToadletRegistry.addPage(new DismissNotificationPage(this, loaders, templateRenderer));
-               pageToadletRegistry.addPage(new MetricsPage(this, loaders, templateRenderer, metricRegistry));
+               if (getCore().getDebugInformation().getShowMetrics()) {
+                       pageToadletRegistry.addPage(new MetricsPage(this, loaders, templateRenderer, metricRegistry));
+               }
                pageToadletRegistry.addPage(loaders.<FreenetRequest>loadStaticPage("css/", "/static/css/", "text/css"));
                pageToadletRegistry.addPage(loaders.<FreenetRequest>loadStaticPage("javascript/", "/static/javascript/", "text/javascript"));
                pageToadletRegistry.addPage(loaders.<FreenetRequest>loadStaticPage("images/", "/static/images/", "image/png"));