Browse Source

fix: release info style & hide menu

pull/3525/head
Wing-Kam Wong 2 years ago
parent
commit
7089f4f1b7
  1. 30
      packages/nc-gui/components/general/ReleaseInfo.vue

30
packages/nc-gui/components/general/ReleaseInfo.vue

@ -6,13 +6,19 @@ const { $api } = useNuxtApp()
const { currentVersion, latestRelease, hiddenRelease } = useGlobal()
const releaseAlert = computed(
() =>
currentVersion.value &&
latestRelease.value &&
currentVersion.value !== latestRelease.value &&
latestRelease.value !== hiddenRelease.value,
)
const releaseAlert = computed({
get() {
return (
currentVersion.value &&
latestRelease.value &&
currentVersion.value !== latestRelease.value &&
latestRelease.value !== hiddenRelease.value
)
},
set(val) {
hiddenRelease.value = val ? null : latestRelease.value
},
})
async function fetchReleaseInfo() {
try {
@ -35,7 +41,7 @@ onMounted(async () => await fetchReleaseInfo())
<template>
<div v-if="releaseAlert" class="flex items-center">
<a-dropdown :trigger="['click']" placement="bottom">
<a-button class="bg-primary border-none">
<a-button class="!bg-primary !border-none">
<div class="flex gap-1 items-center text-white">
<span class="text-sm font-weight-medium">{{ $t('activity.upgrade.available') }}</span>
<mdi-menu-down />
@ -43,21 +49,21 @@ onMounted(async () => await fetchReleaseInfo())
</a-button>
<template #overlay>
<div class="mt-1 bg-white shadow-lg !border">
<nuxt-link class="text-primary" to="https://github.com/nocodb/nocodb/releases" target="_blank">
<nuxt-link class="!text-primary !no-underline" to="https://github.com/nocodb/nocodb/releases" target="_blank">
<div class="nc-menu-item">
<mdi-script-text-outline />
{{ latestRelease }} {{ $t('activity.upgrade.releaseNote') }}
</div>
</nuxt-link>
<nuxt-link class="text-primary" to="https://docs.nocodb.com/getting-started/upgrading" target="_blank">
<nuxt-link class="!text-primary !no-underline" to="https://docs.nocodb.com/getting-started/upgrading" target="_blank">
<div class="nc-menu-item">
<mdi-rocket-launch-outline />
<!-- How to upgrade? -->
{{ $t('activity.upgrade.howTo') }}
</div>
</nuxt-link>
<a-divider class="m-0" />
<div class="nc-menu-item" @click="latestRelease = null">
<a-divider class="!m-0" />
<div class="nc-menu-item" @click="releaseAlert = false">
<mdi-close />
<!-- Hide menu -->
{{ $t('general.hideMenu') }}

Loading…
Cancel
Save