From 1a61f2cee9937ded577bf80b8e2803381d0d12c7 Mon Sep 17 00:00:00 2001
From: syuilo <syuilotan@yahoo.co.jp>
Date: Fri, 8 Mar 2019 13:10:38 +0900
Subject: 自動更新
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/client/app/admin/views/queue.vue | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

(limited to 'src/client/app/admin/views/queue.vue')

diff --git a/src/client/app/admin/views/queue.vue b/src/client/app/admin/views/queue.vue
index ae3aa0db57..e37408d70d 100644
--- a/src/client/app/admin/views/queue.vue
+++ b/src/client/app/admin/views/queue.vue
@@ -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);
 		});
 	},
 
-- 
cgit v1.2.3-freya

