make title-url of pihole and pihole-v6 default to /admin
This commit is contained in:
parent
fd5cf98072
commit
55685e6854
1 changed files with 10 additions and 1 deletions
|
|
@ -60,10 +60,19 @@ func makeDNSWidgetTimeLabels(format string) [8]string {
|
||||||
return labels
|
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 {
|
func (widget *dnsStatsWidget) initialize() error {
|
||||||
widget.
|
widget.
|
||||||
withTitle("DNS Stats").
|
withTitle("DNS Stats").
|
||||||
withTitleURL(string(widget.URL)).
|
withTitleURL(getWidgetTitleURL(widget)).
|
||||||
withCacheDuration(10 * time.Minute)
|
withCacheDuration(10 * time.Minute)
|
||||||
|
|
||||||
switch widget.Service {
|
switch widget.Service {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue