mirror of
https://github.com/bastienwirtz/homer.git
synced 2024-11-07 16:54:00 +01:00
feat: auto update for glances widget
This commit is contained in:
parent
e377b005e0
commit
4421fb99e4
@ -516,7 +516,7 @@ services:
|
|||||||
container_name: glances
|
container_name: glances
|
||||||
environment:
|
environment:
|
||||||
- TZ=Europe/Rome
|
- TZ=Europe/Rome
|
||||||
- GLANCES_OPT=-w --disable-webui
|
- GLANCES_OPT=-w
|
||||||
ports:
|
ports:
|
||||||
- 61208:61208
|
- 61208:61208
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@ -533,9 +533,11 @@ services:
|
|||||||
url: http://192.168.1.2:61208
|
url: http://192.168.1.2:61208
|
||||||
type: Glances
|
type: Glances
|
||||||
stat: cpu
|
stat: cpu
|
||||||
|
updateInterval: 5000 # (Optional) Interval (in ms) for updating the stats
|
||||||
- name: Memory
|
- name: Memory
|
||||||
icon: fas fa-memory
|
icon: fas fa-memory
|
||||||
url: http://192.168.1.2:61208
|
url: http://192.168.1.2:61208
|
||||||
type: Glances
|
type: Glances
|
||||||
stat: mem
|
stat: mem
|
||||||
|
updateInterval: 5000 # (Optional) Interval (in ms) for updating the stats
|
||||||
```
|
```
|
||||||
|
@ -24,6 +24,10 @@ export default {
|
|||||||
percentage: 0,
|
percentage: 0,
|
||||||
}),
|
}),
|
||||||
created() {
|
created() {
|
||||||
|
const updateInterval = parseInt(this.item.updateInterval, 10) || 0;
|
||||||
|
if (updateInterval > 0) {
|
||||||
|
setInterval(() => this.fetchStat(), updateInterval);
|
||||||
|
}
|
||||||
this.fetchStat();
|
this.fetchStat();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
Loading…
Reference in New Issue
Block a user