Skip to content

A self-hosted dashboard that puts all your feeds in one place

make title-url of pihole and pihole-v6 default to /admin

Ralph Ocdol55685e685480
diff --git a/internal/glance/widget-dns-stats.go b/internal/glance/widget-dns-stats.go
index be99294..deda67c 100644
--- a/internal/glance/widget-dns-stats.go
+++ b/internal/glance/widget-dns-stats.go
@@ -60,10 +60,19 @@ func makeDNSWidgetTimeLabels(format string) [8]string {
return labels
}
+func getWidgetTitleURL(widget *dnsStatsWidget) string {
+ switch widget.Service {
+ case dnsServicePihole, dnsServicePiholeV6:
+ return fmt.Sprintf("%s/admin", strings.TrimRight(widget.URL, "/"))
+ default:
+ return widget.URL
+ }
+}
+
func (widget *dnsStatsWidget) initialize() error {
widget.
withTitle("DNS Stats").
- withTitleURL(string(widget.URL)).
+ withTitleURL(getWidgetTitleURL(widget)).
withCacheDuration(10 * time.Minute)
switch widget.Service {