mirror of https://github.com/bastienwirtz/homer
add support to dynamic interval time for polling the status
parent
9307f5a926
commit
28ad80369f
|
@ -468,10 +468,11 @@ The following configuration is available for the PiHole service.
|
|||
- name: "Pi-hole"
|
||||
logo: "assets/tools/sample.png"
|
||||
# subtitle: "Network-wide Ad Blocking" # optional, if no subtitle is defined, PiHole statistics will be shown
|
||||
url: "http://192.168.0.151/admin"
|
||||
url: "http://192.168.0.151/admin" # For v6 API, do not include /admin in the URL
|
||||
apikey: "<---insert-api-key-here--->" # optional, needed if web interface is password protected
|
||||
type: "PiHole"
|
||||
apiVersion: 5 # optional, defaults to 5. Use 6 if your PiHole instance uses API v6
|
||||
checkInterval: 3000 # optional, defaults to 300000. interval in ms to check Pi-hole status
|
||||
```
|
||||
|
||||
**Remarks:**
|
||||
|
|
|
@ -68,8 +68,12 @@ export default {
|
|||
methods: {
|
||||
startStatusPolling: function () {
|
||||
this.fetchStatus();
|
||||
// Poll every 5 minutes
|
||||
this.pollInterval = setInterval(this.fetchStatus, 300000);
|
||||
// Set the interval to the checkInterval or default to 5 minutes
|
||||
const interval = parseInt(this.item.checkInterval, 10) || 300000;
|
||||
if (this.item.checkInterval < 1000) {
|
||||
this.item.checkInterval = 1000;
|
||||
}
|
||||
this.pollInterval = setInterval(this.fetchStatus, interval);
|
||||
},
|
||||
stopStatusPolling: function () {
|
||||
if (this.pollInterval) {
|
||||
|
|
Loading…
Reference in New Issue