Skip to content

Commit b6d93a7

Browse files
authored
Merge pull request #371 from KallanX/enhancement/add-support-pihole-v6
Enhancement/add support pihole v6
2 parents 3b79c8e + 4b2438c commit b6d93a7

File tree

5 files changed

+364
-71
lines changed

5 files changed

+364
-71
lines changed

docs/configuration.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,29 +1765,31 @@ Preview:
17651765
| allow-insecure | bool | no | false |
17661766
| url | string | yes | |
17671767
| username | string | when service is `adguard` | |
1768-
| password | string | when service is `adguard` | |
1768+
| password | string | when service is `adguard` or `pihole6` | |
17691769
| token | string | when service is `pihole` | |
17701770
| hide-graph | bool | no | false |
17711771
| hide-top-domains | bool | no | false |
17721772
| hour-format | string | no | 12h |
17731773

17741774
##### `service`
1775-
Either `adguard` or `pihole`.
1775+
Either `adguard`, or `pihole` (major version 5 and below) or `pihole6` (major version 6 and above).
17761776

17771777
##### `allow-insecure`
17781778
Whether to allow invalid/self-signed certificates when making the request to the service.
17791779

17801780
##### `url`
1781-
The base URL of the service. Can be specified from an environment variable using the syntax `${VARIABLE_NAME}`.
1781+
The base URL of the service.
17821782

17831783
##### `username`
1784-
Only required when using AdGuard Home. The username used to log into the admin dashboard. Can be specified from an environment variable using the syntax `${VARIABLE_NAME}`.
1784+
Only required when using AdGuard Home. The username used to log into the admin dashboard.
17851785

17861786
##### `password`
1787-
Only required when using AdGuard Home. The password used to log into the admin dashboard. Can be specified from an environment variable using the syntax `${VARIABLE_NAME}`.
1787+
Required when using AdGuard Home, where the password is the one used to log into the admin dashboard.
1788+
1789+
Also requried when using Pi-hole major version 6 and above, where the password is the one used to log into the admin dashboard or the application password, which can be found in `Settings -> Web Interface / API -> Configure app password`.
17881790

17891791
##### `token`
1790-
Only required when using Pi-hole. The API token which can be found in `Settings -> API -> Show API token`. Can be specified from an environment variable using the syntax `${VARIABLE_NAME}`.
1792+
Only required when using Pi-hole major version 5 or earlier. The API token which can be found in `Settings -> API -> Show API token`.
17911793

17921794
##### `hide-graph`
17931795
Whether to hide the graph showing the number of queries over time.

internal/glance/static/main.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,7 @@ details[open] .summary::after {
12691269

12701270
.dns-stats-graph-bar > .blocked {
12711271
background-color: var(--color-negative);
1272+
flex-basis: calc(var(--percent) - 1px);
12721273
}
12731274

12741275
.dns-stats-graph-column:nth-child(even) .dns-stats-graph-time {

internal/glance/templates/dns-stats.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
{{ if ne $column.Queries $column.Blocked }}
6060
<div class="queries"></div>
6161
{{ end }}
62-
{{ if or (gt $column.Blocked 0) (and (lt $column.PercentTotal 15) (lt $column.PercentBlocked 10)) }}
63-
<div class="blocked" style="flex-basis: {{ $column.PercentBlocked }}%"></div>
62+
{{ if gt $column.PercentBlocked 0 }}
63+
<div class="blocked" style="--percent: {{ $column.PercentBlocked }}%"></div>
6464
{{ end }}
6565
</div>
6666
{{ end }}

internal/glance/utils.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,7 @@ func ternary[T any](condition bool, a, b T) T {
186186

187187
return b
188188
}
189+
190+
// Having compile time errors about unused variables is cool and all, but I don't want to
191+
// have to constantly comment out my code while I'm working on it and testing things out
192+
func ItsUsedTrustMeBro(...any) {}

0 commit comments

Comments
 (0)