add nova
This commit is contained in:
21
nova/resources/js/mixins/MetricBehavior.js
Normal file
21
nova/resources/js/mixins/MetricBehavior.js
Normal file
@@ -0,0 +1,21 @@
|
||||
export default {
|
||||
created() {
|
||||
Nova.$on('metric-refresh', this.fetch)
|
||||
|
||||
Nova.$on('resources-deleted', this.fetch)
|
||||
Nova.$on('resources-detached', this.fetch)
|
||||
Nova.$on('resources-restored', this.fetch)
|
||||
|
||||
if (this.card.refreshWhenActionRuns) {
|
||||
Nova.$on('action-executed', this.fetch)
|
||||
}
|
||||
},
|
||||
|
||||
beforeUnmount() {
|
||||
Nova.$off('metric-refresh', this.fetch)
|
||||
Nova.$off('resources-deleted', this.fetch)
|
||||
Nova.$off('resources-detached', this.fetch)
|
||||
Nova.$off('resources-restored', this.fetch)
|
||||
Nova.$off('action-executed', this.fetch)
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user