From 60336ff4cc580574cd8a76fa113b0d30c85cdfa1 Mon Sep 17 00:00:00 2001 From: Ayideyia <150233177+Ayideyia@users.noreply.github.com> Date: Thu, 4 Jul 2024 01:26:39 +0800 Subject: [PATCH] feat: Add a rolling release tag on the titlebar --- frontend/src/components/TitleBar.vue | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/TitleBar.vue b/frontend/src/components/TitleBar.vue index bf08a04f..c53b50c4 100644 --- a/frontend/src/components/TitleBar.vue +++ b/frontend/src/components/TitleBar.vue @@ -16,6 +16,7 @@ import { const isPinned = ref(false) const isMaximised = ref(false) +const isRollingRelease = ref(false) const appSettingsStore = useAppSettingsStore() const kernelApiStore = useKernelApiStore() @@ -57,6 +58,18 @@ const onResize = debounce(async () => { isMaximised.value = await WindowIsMaximised() }, 100) +const updateRollingReleaseState = async () => { + try { + const res = await fetch('/version.txt') + const txt = await res.text() + isRollingRelease.value = txt.startsWith('SHA2-256') + } catch (error) { + console.log('Not a rolling release', error) + } +} + +updateRollingReleaseState() + onMounted(() => window.addEventListener('resize', onResize)) onUnmounted(() => window.removeEventListener('resize', onResize)) @@ -75,7 +88,7 @@ onUnmounted(() => window.removeEventListener('resize', onResize)) }" class="appname" > - {{ APP_TITLE }} {{ APP_VERSION }} + {{ APP_TITLE }} {{ APP_VERSION }} {{ isRollingRelease ? '- Rolling Release' : '' }}