Skip to content

Commit db1fb4b

Browse files
authored
Enhancement: support netalertX token for password-protected instances (#4122)
1 parent 20048ff commit db1fb4b

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

docs/widgets/services/netalertx.md

+3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ _Note that the project was renamed from PiAlert to NetAlertX._
99

1010
Allowed fields: `["total", "connected", "new_devices", "down_alerts"]`.
1111

12+
If you have enabled a password on your NetAlertX instance, you will need to provide the `SYNC_api_token` as the `key` in your config.
13+
1214
```yaml
1315
widget:
1416
type: netalertx
1517
url: http://ip:port
18+
key: netalertxsyncapitoken # optional, only if password is enabled
1619
```

src/utils/proxy/handlers/credentialed.js

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export default async function credentialedProxyHandler(req, res, map) {
4141
"ghostfolio",
4242
"linkwarden",
4343
"mealie",
44+
"netalertx",
4445
"tailscale",
4546
"tandoor",
4647
"pterodactyl",

src/widgets/netalertx/widget.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import genericProxyHandler from "utils/proxy/handlers/generic";
1+
import credentialedProxyHandler from "utils/proxy/handlers/credentialed";
22

33
const widget = {
44
api: "{url}/php/server/devices.php?action=getDevicesTotals",
5-
proxyHandler: genericProxyHandler,
5+
proxyHandler: credentialedProxyHandler,
66

77
mappings: {
88
data: {

0 commit comments

Comments
 (0)