Skip to content

Commit

Permalink
feat: Add a rolling release tag on the titlebar
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayideyia committed Jul 3, 2024
1 parent f3fab2e commit 60336ff
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions frontend/src/components/TitleBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
const isPinned = ref(false)
const isMaximised = ref(false)
const isRollingRelease = ref(false)
const appSettingsStore = useAppSettingsStore()
const kernelApiStore = useKernelApiStore()
Expand Down Expand Up @@ -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))
</script>
Expand All @@ -75,7 +88,7 @@ onUnmounted(() => window.removeEventListener('resize', onResize))
}"
class="appname"
>
{{ APP_TITLE }} {{ APP_VERSION }}
{{ APP_TITLE }} {{ APP_VERSION }} {{ isRollingRelease ? '- Rolling Release' : '' }}
</div>
<Button v-if="kernelApiStore.loading" loading type="text" size="small" />
<div v-menu="menus" class="menus"></div>
Expand Down Expand Up @@ -106,7 +119,7 @@ onUnmounted(() => window.removeEventListener('resize', onResize))
v-menu="menus"
class="appname"
>
{{ APP_TITLE }} {{ APP_VERSION }}
{{ APP_TITLE }} {{ APP_VERSION }} {{ isRollingRelease ? '- Rolling Release' : '' }}
</div>
<Button v-if="kernelApiStore.loading" loading type="text" size="small" />
</div>
Expand Down

0 comments on commit 60336ff

Please sign in to comment.