Skip to content

Commit c1f27c6

Browse files
authored
🔀 Merge pull request #1892 from casmbu/master
Add v6 versions of Pi-Hole widgets and fix minor bug in Uptime Kuma widget
2 parents 6e843cf + 042c5c0 commit c1f27c6

File tree

9 files changed

+670
-15
lines changed

9 files changed

+670
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
- **Getting Started**
2828
- [🌈 Features](#features-)
29-
- [⚡Demo](#demo-)
29+
- [ Demo](#demo-)
3030
- [🚀 Getting Started](#getting-started-)
3131
- [🔧 Configuring](#configuring-)
3232
- **Feature Overview**

docs/widgets.md

Lines changed: 121 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,12 @@ Dashy has support for displaying dynamic content in the form of widgets. There a
4747
- [CPU History](#cpu-history-netdata)
4848
- [Memory History](#memory-history-netdata)
4949
- [System Load History](#load-history-netdata)
50-
- [Pi Hole Stats](#pi-hole-stats)
51-
- [Pi Hole Queries](#pi-hole-queries)
52-
- [Pi Hole Recent Traffic](#pi-hole-recent-traffic)
50+
- [Pi-Hole Stats](#pi-hole-stats)
51+
- [Pi-Hole Stats v6](#pi-hole-stats-v6)
52+
- [Pi-Hole Queries](#pi-hole-queries)
53+
- [Pi-Hole Queries v6](#pi-hole-queries-v6)
54+
- [Pi-Hole Recent Traffic](#pi-hole-recent-traffic)
55+
- [Pi-Hole Recent Traffic v6](#pi-hole-recent-traffic-v6)
5356
- [Stat Ping Statuses](#stat-ping-statuses)
5457
- [Synology Download Station](#synology-download-station)
5558
- [AdGuard Home Block Stats](#adguard-home-block-stats)
@@ -1722,7 +1725,7 @@ Pull recent load usage in 1, 5 and 15 minute intervals, from NetData.
17221725

17231726
---
17241727

1725-
### Pi Hole Stats
1728+
### Pi-Hole Stats
17261729

17271730
Displays the number of queries blocked by [Pi-Hole](https://pi-hole.net/).
17281731

@@ -1763,12 +1766,58 @@ Displays the number of queries blocked by [Pi-Hole](https://pi-hole.net/).
17631766
- **CORS**: 🟢 Enabled
17641767
- **Auth**: 🔴 Required
17651768
- **Price**: 🟢 Free
1766-
- **Host**: Self-Hosted (see [GitHub - Pi-hole](https://github.com/pi-hole/pi-hole))
1769+
- **Host**: Self-Hosted (see [GitHub - Pi-Hole](https://github.com/pi-hole/pi-hole))
1770+
- **Privacy**: _See [Pi-Hole Privacy Guide](https://pi-hole.net/privacy/)_
1771+
1772+
---
1773+
1774+
### Pi-Hole Stats v6
1775+
1776+
Displays the number of queries blocked by [Pi-Hole](https://pi-hole.net/). Use this version of the widget if you have a v6+ Pi-Hole instance.
1777+
1778+
<p align="center"><img width="400" src="https://i.ibb.co/zftCLJN/pi-hole-stats.png" /></p>
1779+
1780+
#### Options
1781+
1782+
**Field** | **Type** | **Required** | **Description**
1783+
--- | --- | --- | ---
1784+
**`hostname`** | `string` | Required | The URL to your Pi-Hole instance
1785+
**`hideStatus`** / **`hideChart`** / **`hideInfo`** | `boolean` | _Optional_ | Optionally hide any of the three parts of the widget
1786+
**`apiKey`** | `string` | Required | Your Pi-Hole web password or application password. It **IS** your Pi-Hole admin interface password **UNLESS** you have 2FA turned on (in contrast to the old widget). If you have 2FA turned on you will need to create an application password. Refer to Pi-Hole documentation for how to create an application password.
1787+
1788+
#### Example
1789+
1790+
```yaml
1791+
- type: pi-hole-stats-v6
1792+
options:
1793+
hostname: http://192.168.130.1
1794+
apiKey: xxxxxxxxxxxxxxxxxxxxxxx
1795+
```
1796+
1797+
> [!TIP]
1798+
> In order to avoid leaking secret data, both `hostname` and `apiKey` can leverage environment variables. Simply pass the name of the variable, which MUST start with `VUE_APP_`.
1799+
1800+
```yaml
1801+
- type: pi-hole-stats-v6
1802+
options:
1803+
hostname: VUE_APP_pihole_ip
1804+
apiKey: VUE_APP_pihole_key
1805+
```
1806+
1807+
> [!IMPORTANT]
1808+
> You will need to restart the server (or the docker image) if adding/editing an env var for this to be refreshed.
1809+
1810+
#### Info
1811+
1812+
- **CORS**: 🟢 Enabled
1813+
- **Auth**: 🔴 Required
1814+
- **Price**: 🟢 Free
1815+
- **Host**: Self-Hosted (see [GitHub - Pi-Hole](https://github.com/pi-hole/pi-hole))
17671816
- **Privacy**: _See [Pi-Hole Privacy Guide](https://pi-hole.net/privacy/)_
17681817

17691818
---
17701819

1771-
### Pi Hole Queries
1820+
### Pi-Hole Queries
17721821

17731822
Shows top queries that were blocked and allowed by [Pi-Hole](https://pi-hole.net/).
17741823

@@ -1801,7 +1850,40 @@ Shows top queries that were blocked and allowed by [Pi-Hole](https://pi-hole.net
18011850

18021851
---
18031852

1804-
### Pi Hole Recent Traffic
1853+
### Pi-Hole Queries v6
1854+
1855+
Shows top queries that were blocked and allowed by [Pi-Hole](https://pi-hole.net/). Use this version of the widget if you have a v6+ Pi-Hole instance.
1856+
1857+
<p align="center"><img width="400" src="https://i.ibb.co/pXR0bdQ/pi-hole-queries.png" /></p>
1858+
1859+
#### Options
1860+
1861+
**Field** | **Type** | **Required** | **Description**
1862+
--- | --- | --- | ---
1863+
**`hostname`** | `string` | Required | The URL to your Pi-Hole instance
1864+
**`apiKey`** | `string` | Required | Your Pi-Hole web password or application password. It **IS** your Pi-Hole admin interface password **UNLESS** you have 2FA turned on (in contrast to the old widget). If you have 2FA turned on you will need to create an application password. Refer to Pi-Hole documentation for how to create an application password.
1865+
**`count`** | `number` | _Optional_ | The number of queries to display. Defaults to `10`
1866+
1867+
#### Example
1868+
1869+
```yaml
1870+
- type: pi-hole-top-queries-v6
1871+
options:
1872+
hostname: https://pi-hole.local
1873+
apiKey: xxxxxxxxxxxxxxxxxxxxxxx
1874+
```
1875+
1876+
#### Info
1877+
1878+
- **CORS**: 🟢 Enabled
1879+
- **Auth**: 🔴 Required
1880+
- **Price**: 🟢 Free
1881+
- **Host**: Self-Hosted (see [GitHub - Pi-hole](https://github.com/pi-hole/pi-hole))
1882+
- **Privacy**: _See [Pi-Hole Privacy Guide](https://pi-hole.net/privacy/)_
1883+
1884+
---
1885+
1886+
### Pi-Hole Recent Traffic
18051887

18061888
Shows number of recent traffic, using allowed and blocked queries from [Pi-Hole](https://pi-hole.net/)
18071889

@@ -1833,6 +1915,38 @@ Shows number of recent traffic, using allowed and blocked queries from [Pi-Hole]
18331915

18341916
---
18351917

1918+
### Pi-Hole Recent Traffic v6
1919+
1920+
Shows number of recent traffic, using allowed and blocked queries from [Pi-Hole](https://pi-hole.net/). Use this version of the widget if you have a v6+ Pi-Hole instance.
1921+
1922+
<p align="center"><img width="500" src="https://i.ibb.co/7kdxxwx/pi-hole-recent-queries.png" /></p>
1923+
1924+
#### Options
1925+
1926+
**Field** | **Type** | **Required** | **Description**
1927+
--- | --- | --- | ---
1928+
**`hostname`** | `string` | Required | The URL to your Pi-Hole instance
1929+
**`apiKey`** | `string` | Required | Your Pi-Hole web password or application password. It **IS** your Pi-Hole admin interface password **UNLESS** you have 2FA turned on (in contrast to the old widget). If you have 2FA turned on you will need to create an application password. Refer to Pi-Hole documentation for how to create an application password.
1930+
1931+
#### Example
1932+
1933+
```yaml
1934+
- type: pi-hole-traffic-v6
1935+
options:
1936+
hostname: https://pi-hole.local
1937+
apiKey: xxxxxxxxxxxxxxxxxxxxxxx
1938+
```
1939+
1940+
#### Info
1941+
1942+
- **CORS**: 🟢 Enabled
1943+
- **Auth**: 🔴 Required
1944+
- **Price**: 🟢 Free
1945+
- **Host**: Self-Hosted (see [GitHub - Pi-hole](https://github.com/pi-hole/pi-hole))
1946+
- **Privacy**: _See [Pi-Hole Privacy Guide](https://pi-hole.net/privacy/)_
1947+
1948+
---
1949+
18361950
### Stat Ping Statuses
18371951

18381952
Displays the current and recent uptime of your running services, via a self-hosted instance of [StatPing](https://github.com/statping/statping)

src/components/Widgets/PiHoleStats.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default {
3838
hostname() {
3939
const usersChoice = this.parseAsEnvVar(this.options.hostname);
4040
if (!usersChoice) this.error('You must specify the hostname for your Pi-Hole server');
41-
return usersChoice || 'http://pi.hole';
41+
return usersChoice;
4242
},
4343
apiKey() {
4444
const usersChoice = this.parseAsEnvVar(this.options.apiKey);
@@ -53,9 +53,7 @@ export default {
5353
hideInfo() { return this.options.hideInfo; },
5454
},
5555
filters: {
56-
capitalize(str) {
57-
return capitalize(str);
58-
},
56+
capitalize,
5957
},
6058
methods: {
6159
/* Make GET request to local pi-hole instance */

0 commit comments

Comments
 (0)