Browse Source

Merge pull request #3525 from nocodb/fix/release-info

fix: release info style & hide menu
pull/3538/head
navi 2 years ago committed by GitHub
parent
commit
39d43626f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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