This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<v-sheet color="white" elevation="4" height="300" style="overflow: hidden;">
|
||||
<!-- todo: need type icon and badge with count options in title bar (badge is icon?) -->
|
||||
<slot name="dash-title">
|
||||
<v-toolbar flat dense>
|
||||
<template v-if="hasUrl">
|
||||
@@ -112,7 +111,11 @@
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data: () => ({}),
|
||||
data() {
|
||||
return {
|
||||
timer: ""
|
||||
};
|
||||
},
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
@@ -124,11 +127,27 @@ export default {
|
||||
updateFrequency: { type: Number, default: 60000 },
|
||||
icon: { type: String, default: "$ayiTachometer" }
|
||||
},
|
||||
created() {
|
||||
this.refresh();
|
||||
if (this.updateFrequency > 0) {
|
||||
this.timer = setInterval(() => {
|
||||
this.refresh();
|
||||
}, this.updateFrequency);
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer);
|
||||
},
|
||||
computed: {
|
||||
hasUrl: function() {
|
||||
return this.moreUrl && this.moreUrl != "";
|
||||
}
|
||||
},
|
||||
methods: {}
|
||||
methods: {
|
||||
refresh: function() {
|
||||
console.log("dash-base:refresh()", new Date());
|
||||
this.$emit("dash-refresh", this.id);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user