From 3c91d6ba8a4cc87e189bee9eab96bba50260a831 Mon Sep 17 00:00:00 2001 From: rix1337 <> Date: Sat, 5 Aug 2023 11:05:12 +0200 Subject: [PATCH] Footer --- .../web_interface/vuejs_frontend/src/App.vue | 52 ++++++++++++++++++- .../vuejs_frontend/src/components/Head.vue | 46 +--------------- 2 files changed, 52 insertions(+), 46 deletions(-) diff --git a/budgeteer/web_interface/vuejs_frontend/src/App.vue b/budgeteer/web_interface/vuejs_frontend/src/App.vue index a703f0e..f196f02 100644 --- a/budgeteer/web_interface/vuejs_frontend/src/App.vue +++ b/budgeteer/web_interface/vuejs_frontend/src/App.vue @@ -3,7 +3,8 @@ import "@/assets/scss/app.scss" import {useDark, useToggle} from "@vueuse/core" import {useStore} from 'vuex' import {useToast} from 'vue-toastification' -import axios from "axios"; +import axios from "axios" +import {onMounted, ref} from "vue" const isDark = useDark() const toggleDark = useToggle(isDark) @@ -28,11 +29,60 @@ function saveOnLock() { store.commit('setLocked', true) store.commit('setModifiedWhileLocked', false) } + +onMounted(() => { + getVersion() + setInterval(getVersion, 300 * 1000) +}) + +function openReleaseNotes() { + window.open("https://github.com/rix1337/BudgeTeer/releases/latest", "_blank") +} + +const version = ref("") +const update = ref(false) + +function getVersion() { + axios.get('api/version/') + .then(function (res) { + version.value = res.data.version.ver + console.info("%c BudgeTeer %c ".concat(version.value, " "), "color: white; background: #303030; font-weight: 700; font-size: 24px; font-family: Monospace;", "color: #303030; background: white; font-weight: 700; font-size: 24px; font-family: Monospace;"); + console.info("%c ❤ Projekt unterstützen %c ".concat("https://github.com/sponsors/rix1337 ❤", " "), "color: white; background: #dc3545; font-weight: 700;", "color: #dc3545; background: white; font-weight: 700;") + update.value = res.data.version.update_ready + store.commit('setDocker', res.data.version.docker) + if (update.value) { + scrollingTitle("BudgeTeer - Update verfügbar! - ") + console.log('Update steht bereit! Weitere Informationen unter https://github.com/rix1337/BudgeTeer/releases/latest') + toast.info("Update steht bereit! Weitere Informationen unter:\nhttps://github.com/rix1337/BudgeTeer/releases/latest", { + timeout: 15000, + onClick: openReleaseNotes, + }) + } + }, function () { + console.log('Konnte Version nicht abrufen!') + toast.error('Konnte Version nicht abrufen!') + }) +} + +function scrollingTitle(titleText) { + document.title = titleText + setTimeout(function () { + scrollingTitle(titleText.substr(1) + titleText.substr(0, 1)) + }, 200) +}