1
0
Fork 1
mirror of https://example.com synced 2024-11-23 12:06:39 +09:00

自動更新

This commit is contained in:
syuilo 2019-03-08 13:10:38 +09:00
parent 78a8293520
commit 1a61f2cee9
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69

View file

@ -51,8 +51,18 @@ export default Vue.extend({
},
created() {
this.$root.api('admin/queue/stats').then(stats => {
this.stats = stats;
const fetchStats = () => {
this.$root.api('admin/queue/stats', {}, true).then(stats => {
this.stats = stats;
});
};
fetchStats();
const clock = setInterval(fetchStats, 1000);
this.$once('hook:beforeDestroy', () => {
clearInterval(clock);
});
},