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

View file

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