This commit is contained in:
@@ -55,7 +55,8 @@ todo: DASHBOARD
|
|||||||
todo: need user dashboard setup registry and route
|
todo: need user dashboard setup registry and route
|
||||||
|
|
||||||
todo: if dashboard view is empty should be a string displayed saying nothing selected to show?
|
todo: if dashboard view is empty should be a string displayed saying nothing selected to show?
|
||||||
|
// Todo: intermediate actual types (try list first), how to instantiate them from here by id (dynamic)
|
||||||
|
// todo: do we need a PLUS menu item to add one of that type to that widget, i.e. if it's showing workorders then a plus to make a new wokorder would be useful
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-sheet color="white" elevation="4" height="300" style="overflow: hidden;">
|
<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">
|
<slot name="dash-title">
|
||||||
<v-toolbar flat dense>
|
<v-toolbar flat dense>
|
||||||
<template v-if="hasUrl">
|
<template v-if="hasUrl">
|
||||||
@@ -112,7 +111,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data: () => ({}),
|
data() {
|
||||||
|
return {
|
||||||
|
timer: ""
|
||||||
|
};
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
id: {
|
id: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -124,11 +127,27 @@ export default {
|
|||||||
updateFrequency: { type: Number, default: 60000 },
|
updateFrequency: { type: Number, default: 60000 },
|
||||||
icon: { type: String, default: "$ayiTachometer" }
|
icon: { type: String, default: "$ayiTachometer" }
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.refresh();
|
||||||
|
if (this.updateFrequency > 0) {
|
||||||
|
this.timer = setInterval(() => {
|
||||||
|
this.refresh();
|
||||||
|
}, this.updateFrequency);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
clearInterval(this.timer);
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
hasUrl: function() {
|
hasUrl: function() {
|
||||||
return this.moreUrl && this.moreUrl != "";
|
return this.moreUrl && this.moreUrl != "";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {}
|
methods: {
|
||||||
|
refresh: function() {
|
||||||
|
console.log("dash-base:refresh()", new Date());
|
||||||
|
this.$emit("dash-refresh", this.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
:count="0"
|
:count="0"
|
||||||
moreUrl="/home-dashboard"
|
moreUrl="/home-dashboard"
|
||||||
icon="$ayiRobot"
|
icon="$ayiRobot"
|
||||||
|
:updateFrequency="15000"
|
||||||
v-on:dash-remove="dashRemove"
|
v-on:dash-remove="dashRemove"
|
||||||
v-on:dash-move-start="dashMoveStart"
|
v-on:dash-move-start="dashMoveStart"
|
||||||
v-on:dash-move-back="dashMoveBack"
|
v-on:dash-move-back="dashMoveBack"
|
||||||
@@ -66,8 +67,7 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</template>
|
</template>
|
||||||
Todo: intermediate actual types (try list first), how to instantiate them from here by id (dynamic)
|
|
||||||
todo: do we need a PLUS menu item to add one of that type to that widget, i.e. if it's showing workorders then a plus to make a new wokorder would be useful
|
|
||||||
<script>
|
<script>
|
||||||
const FORM_KEY = "home-dashboard";
|
const FORM_KEY = "home-dashboard";
|
||||||
import DashRegistry from "../api/dash-registry";
|
import DashRegistry from "../api/dash-registry";
|
||||||
|
|||||||
Reference in New Issue
Block a user