Add custom unmarshalling for pihole queries stats

+ hide-graph and hide-top-domains options for DNS stats widget
This commit is contained in:
Svilen Markov
2024-12-28 14:17:48 +00:00
parent e524dd111e
commit ac7f3805d4
3 changed files with 54 additions and 14 deletions

View File

@@ -24,6 +24,8 @@
{{ end }}
</div>
{{ $showGraph := not (or .HideGraph (eq (len .Stats.Series) 0)) }}
{{ if $showGraph }}
<div class="dns-stats-graph margin-top-15">
<div class="dns-stats-graph-gridlines-container">
<svg class="dns-stats-graph-gridlines" shape-rendering="crispEdges" viewBox="0 0 1 100" preserveAspectRatio="none">
@@ -67,9 +69,10 @@
{{ end }}
</div>
</div>
{{ end }}
{{ if .Stats.TopBlockedDomains }}
<details class="details margin-top-40">
{{ if and (not .HideTopDomains) .Stats.TopBlockedDomains }}
<details class="details {{ if $showGraph }}margin-top-40{{ else }}margin-top-15{{ end }}">
<summary class="summary">Top blocked domains</summary>
<ul class="list list-gap-4 list-with-transition size-h5">
{{ range .Stats.TopBlockedDomains }}