Skip to content

Commit d866344

Browse files
joriswvanrijnbastienwirtz
authored andcommitted
feat(auto-refresh): add Transmission and docs
1 parent 4b2087d commit d866344

File tree

3 files changed

+19
-24
lines changed

3 files changed

+19
-24
lines changed

docs/customservices.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Available services are located in `src/components/`:
8080
endpoint: https://my-service-api.url # Optional: alternative base URL used to fetch service data when necessary.
8181
useCredentials: false # Optional: Override global proxy.useCredentials configuration.
8282
headers: # Optional: Override global proxy.headers configuration.
83+
autoUpdateInterval: # Optional: Time in ms. Some services can periodically fetch data (see below)
8384
```
8485
8586
If a subtitle is provided, (using the `subtitle` configuration key), **it will override (hide)** any custom information displayed on the subtitle line by the custom integration.
@@ -156,10 +157,10 @@ The `libraryType` configuration let you choose which stats to show.
156157
Displays unread article count and total subscriptions from your FreshRSS server.
157158

158159
```yaml
159-
- name: "FreshRSS"
160+
- name: "FreshRSS"
160161
type: "FreshRSS"
161162
url: https://my-service.url
162-
updateInterval: 5000 # (Optional) Interval (in ms) for updating the stats
163+
autoUpdateInterval: 5000 # (Optional) Interval (in ms) for updating the stats
163164
username: "<---your-username--->"
164165
password: "<---your-password--->"
165166
```
@@ -182,7 +183,7 @@ Optionally, the results can be filtered to only include jobs in the defined grou
182183

183184
The status can be checked regularly by defining an update Interval in ms:
184185
```yaml
185-
updateInterval: 5000
186+
autoUpdateInterval: 5000
186187
```
187188

188189
The average times can be hidden (saves their calculation also) by setting the following:
@@ -321,7 +322,7 @@ Two lines are needed in the `config.yml`:
321322
type: "Lidarr" # "Lidarr" "Prowlarr", "Radarr" or "Sonarr"
322323
logo: "assets/tools/sample.png"
323324
url: https://my-service.url
324-
checkInterval: 5000 # (Optional) Interval (in ms) for updating the status
325+
autoUpdateInterval: 5000 # (Optional) Interval (in ms) for updating the status
325326
apikey: "<---insert-api-key-here--->"
326327
```
327328

@@ -503,7 +504,7 @@ Displays stats from your PiAlert server.
503504
type: "PiAlert"
504505
logo: "assets/tools/sample.png"
505506
url: https://my-service.url
506-
updateInterval: 5000 # (Optional) Interval (in ms) for updating the stats
507+
autoUpdateInterval: 5000 # (Optional) Interval (in ms) for updating the stats
507508
```
508509

509510
## PiHole
@@ -518,7 +519,7 @@ Displays info about your local PiHole instance right on your Homer dashboard.
518519
# endpoint: "https://my-service-api.url" # optional, For v6 API, this is the base URL used to fetch Pi-hole data overwriting the url
519520
apikey: "<---insert-api-key-here--->" # optional, needed if web interface is password protected
520521
apiVersion: 5 # optional, defaults to 5. Use 6 if your PiHole instance uses API v6
521-
checkInterval: 3000 # optional, defaults to 300000. interval in ms to check Pi-hole status
522+
autoUpdateInterval: 3000 # optional, defaults to 300000. interval in ms to check Pi-hole status
522523
```
523524

524525
**API Key**: Required only if Pi-hole web interface is password protected. Go to **Settings > API/Web Interface > Show API token**
@@ -543,7 +544,7 @@ Optionally, use `successCodes` to define which HTTP response status codes should
543544
# successCodes: [200, 418] # Optional, default to all 2xx HTTP response status codes
544545
# timeout: 500 # Timeout in ms before ping is aborted. Default 2000
545546
# subtitle: "Bookmark example" # By default, request round trip time is displayed when subtitle is not set
546-
# updateInterval: 5000 # (Optional) Interval (in ms) for updating ping status
547+
# autoUpdateInterval: 5000 # (Optional) Interval (in ms) for updating ping status
547548
```
548549

549550
## Plex
@@ -633,8 +634,7 @@ for setting up qBittorrent.
633634
type: "qBittorrent"
634635
logo: "assets/tools/sample.png"
635636
url: https://my-service.url # Your rTorrent web UI, f.e. ruTorrent or Flood.
636-
rateInterval: 2000 # Interval for updating the download and upload rates.
637-
torrentInterval: 5000 # Interval for updating the torrent count.
637+
autoUpdateInterval: 2000 # Interval for updating the download, upload rates & torrent count
638638
```
639639

640640
## rTorrent
@@ -651,8 +651,7 @@ for setting up rTorrent.
651651
logo: "assets/tools/sample.png"
652652
url: "https://my-service.url" # Your rTorrent web UI, f.e. ruTorrent or Flood.
653653
xmlrpc: "https://my-service.url:port" # Reverse proxy for rTorrent's XML-RPC.
654-
rateInterval: 5000 # Interval for updating the download and upload rates.
655-
torrentInterval: 60000 # Interval for updating the torrent count.
654+
autoUpdateInterval: 5000 # Interval for updating the download, upload rates & torrent count.
656655
username: "username" # Username for logging into rTorrent (if applicable).
657656
password: "password" # Password for logging into rTorrent (if applicable).
658657
```
@@ -667,7 +666,7 @@ Displays the number of currently active downloads on your SABnzbd instance.
667666
logo: "assets/tools/sample.png"
668667
url: https://my-service.url
669668
apikey: "<---insert-api-key-here--->"
670-
downloadInterval: 5000 # (Optional) Interval (in ms) for updating the download count
669+
autoUpdateInterval: 5000 # (Optional) Interval (in ms) for updating the download count
671670
```
672671

673672
**API Key**: An API key is required, and can be obtained from the "Config" > "General" section of the SABnzbd config in the web UI.
@@ -681,7 +680,7 @@ Displays info about the total number of disk passed and failed S.M.A.R.T and scr
681680
type: "Scrutiny"
682681
logo: "assets/tools/sample.png"
683682
url: https://my-service.url
684-
updateInterval: 5000 # (Optional) Interval (in ms) for updating the status
683+
autoUpdateInterval: 5000 # (Optional) Interval (in ms) for updating the status
685684
```
686685

687686
## SpeedtestTracker
@@ -704,7 +703,7 @@ Displays the number of currently active streams on you Plex instance.
704703
type: "Tautulli"
705704
logo: "assets/tools/sample.png"
706705
url: https://my-service.url
707-
checkInterval: 5000 # (Optional) Interval (in ms) for updating the status
706+
autoUpdateInterval: 5000 # (Optional) Interval (in ms) for updating the status
708707
apikey: "<---insert-api-key-here--->"
709708
```
710709

@@ -732,7 +731,7 @@ Displays the number of currently queued items for transcoding on your Tdarr inst
732731
type: "Tdarr"
733732
logo: "assets/tools/sample.png"
734733
url: https://my-service.url
735-
checkInterval: 5000 # (Optional) Interval (in ms) for updating the queue & error counts
734+
autoUpdateInterval: 5000 # (Optional) Interval (in ms) for updating the queue & error counts
736735
```
737736

738737
## Traefik
@@ -760,7 +759,7 @@ The service communicates with the Transmission RPC interface which needs to be a
760759
url: "http://192.168.1.2:9091" # Your Transmission web interface URL
761760
type: "Transmission"
762761
auth: "username:password" # Optional: HTTP Basic Auth
763-
interval: 5000 # Optional: Interval for refreshing data (ms)
762+
autoUpdateInterval: 5000 # Optional: Interval for refreshing data (ms)
764763
target: "_blank" # Optional: HTML a tag target attribute
765764
```
766765

src/components/services/Transmission.vue

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
</p>
1919
</template>
2020
<template #indicator>
21-
<span v-if="!error" class="count"
22-
>{{ count || 0 }}
21+
<span v-if="!error" class="count">{{ count || 0 }}
2322
<template v-if="(count || 0) === 1">torrent</template>
2423
<template v-else>torrents</template>
2524
</span>
@@ -69,12 +68,8 @@ export default {
6968
},
7069
},
7170
created() {
72-
const interval = parseInt(this.item.interval, 10) || 0;
73-
74-
// Set up interval if configured
75-
if (interval > 0) {
76-
setInterval(() => this.getStats(), interval);
77-
}
71+
// Set up auto-update method for the scheduler
72+
this.autoUpdateMethod = this.getStats;
7873
7974
// Initial fetch
8075
this.getStats();

src/mixins/service.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export default {
106106

107107
// Check for deprecated keys and warn users
108108
const deprecatedKeys = [
109+
"interval",
109110
"updateInterval",
110111
"checkInterval",
111112
"localCheckInterval",

0 commit comments

Comments
 (0)