From 7acc61d80d12e4ec8d862af0890dd9711a21aea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Aime?= Date: Fri, 19 Feb 2021 14:08:14 +0100 Subject: [PATCH] Adding version info --- app/frontend/src/App.vue | 8 ++++++++ app/frontend/src/views/update.vue | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/frontend/src/App.vue b/app/frontend/src/App.vue index b8668ba..846a3f8 100644 --- a/app/frontend/src/App.vue +++ b/app/frontend/src/App.vue @@ -55,11 +55,19 @@ this.set_lang(); }) .catch(error => { console.log(error) }); + }, + get_version: function() { + axios.get('/api/update/get-version', { timeout: 60000 }) + .then(response => { + if(response.data.status) window.current_version = response.data.current_version + }) + .catch(error => { console.log(error) }); } }, created: function() { window.config = {} this.get_config(); + this.get_version(); } } diff --git a/app/frontend/src/views/update.vue b/app/frontend/src/views/update.vue index d0ab38a..78d984e 100644 --- a/app/frontend/src/views/update.vue +++ b/app/frontend/src/views/update.vue @@ -23,7 +23,7 @@ } }, methods: { - check_update: function() { + check_version: function() { axios.get('/api/update/get-version', { timeout: 60000 }) .then(response => { if(response.data.status) { @@ -42,7 +42,7 @@ if(response.data.status) { if(response.data.message == "Update successfully launched"){ this.update_launched = true - this.check_interval = setInterval(function(){ this.check_update(); }.bind(this), 3000); + this.check_interval = setInterval(function(){ this.check_version(); }.bind(this), 3000); } } })