diff --git a/src/client/app/admin/views/dashboard.vue b/src/client/app/admin/views/dashboard.vue index 8cd57831a..2a6d9a310 100644 --- a/src/client/app/admin/views/dashboard.vue +++ b/src/client/app/admin/views/dashboard.vue @@ -20,7 +20,7 @@
{{ $t('accounts') }} - {{ stats.originalUsersCount | number }} + {{ stats.originalUsersCount | number }}
@@ -33,7 +33,7 @@
{{ $t('notes') }} - {{ stats.originalNotesCount | number }} + {{ stats.originalNotesCount | number }}
@@ -109,6 +109,7 @@ export default Vue.extend({ connection: null, meta: null, instances: [], + clock: null, faDatabase }; }, @@ -116,14 +117,13 @@ export default Vue.extend({ created() { this.connection = this.$root.stream.useSharedConnection('serverStats'); + this.updateStats(); + this.clock = setInterval(this.updateStats, 1000); + this.$root.getMeta().then(meta => { this.meta = meta; }); - this.$root.api('stats').then(stats => { - this.stats = stats; - }); - this.$root.api('instances', { sort: '+notes' }).then(instances => { @@ -139,11 +139,18 @@ export default Vue.extend({ beforeDestroy() { this.connection.dispose(); + clearInterval(this.clock); }, methods: { setChartSrc(src) { this.$refs.charts.setSrc(src); + }, + + updateStats() { + this.$root.api('stats').then(stats => { + this.stats = stats; + }); } } }); @@ -236,9 +243,6 @@ export default Vue.extend({ > b display block - &.primary - color var(--primary) - > div:last-child display flex padding 6px 16px