Added support for refreshSeconds on dashboard level

This commit is contained in:
Fabio Manganiello 2020-11-22 14:26:25 +01:00
parent 62b651789a
commit ecf6a844dd
2 changed files with 16 additions and 1 deletions

View file

@ -20,6 +20,15 @@ export default {
name: 'Dashboard',
mixins: [Utils],
components: {Widget, Loading},
props: {
// Refresh interval in seconds.
refreshSeconds: {
type: Number,
required: false,
default: 0,
},
},
data() {
return {
widgets: [],
@ -75,6 +84,12 @@ export default {
mounted() {
this.refreshDashboard()
if (this.refreshSeconds) {
const self = this
setTimeout(() => {
self.refreshDashboard()
}, parseInt((this.refreshSeconds*1000).toFixed(0)))
}
}
}
</script>

View file

@ -99,7 +99,7 @@ export default {
}
.event {
font-size: .95em;
font-size: .9em;
}
.event-list {