mirror of
https://github.com/glanceapp/glance.git
synced 2025-06-25 12:21:41 +02:00
make title-url of pihole and pihole-v6 default to /admin
This commit is contained in:
parent
fd5cf98072
commit
55685e6854
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user