mirror of https://github.com/nocodb/nocodb
աɨռɢӄաօռɢ
2 years ago
committed by
GitHub
15 changed files with 184 additions and 30 deletions
@ -0,0 +1,16 @@
|
||||
<script setup lang="ts"> |
||||
const { includeM2M } = useGlobal() |
||||
const { loadTables } = useProject() |
||||
|
||||
watch(includeM2M, async () => await loadTables()) |
||||
</script> |
||||
|
||||
<template> |
||||
<div class="flex flex-row w-full"> |
||||
<div class="flex flex-column w-full"> |
||||
<div class="flex flex-row items-center w-full mb-4 gap-2"> |
||||
<a-checkbox v-model:checked="includeM2M">Show M2M Tables</a-checkbox> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
@ -0,0 +1,69 @@
|
||||
<script setup lang="ts"> |
||||
import { message } from 'ant-design-vue' |
||||
import { extractSdkResponseErrorMsg, onMounted } from '#imports' |
||||
|
||||
const { $api } = useNuxtApp() |
||||
|
||||
const { currentVersion, latestRelease, hiddenRelease } = useGlobal() |
||||
|
||||
const releaseAlert = computed( |
||||
() => |
||||
currentVersion.value && |
||||
latestRelease.value && |
||||
currentVersion.value !== latestRelease.value && |
||||
latestRelease.value !== hiddenRelease.value, |
||||
) |
||||
|
||||
async function fetchReleaseInfo() { |
||||
try { |
||||
const versionInfo = await $api.utils.appVersion() |
||||
if (versionInfo && versionInfo.releaseVersion && versionInfo.currentVersion && !/[^0-9.]/.test(versionInfo.currentVersion)) { |
||||
currentVersion.value = versionInfo.currentVersion |
||||
latestRelease.value = versionInfo.releaseVersion |
||||
} else { |
||||
currentVersion.value = null |
||||
latestRelease.value = null |
||||
} |
||||
} catch (e: any) { |
||||
message.error(await extractSdkResponseErrorMsg(e)) |
||||
} |
||||
} |
||||
|
||||
onMounted(async () => await fetchReleaseInfo()) |
||||
</script> |
||||
|
||||
<template> |
||||
<div v-if="releaseAlert" class="flex items-center"> |
||||
<a-dropdown :trigger="['click']" placement="bottom"> |
||||
<a-button class="bg-primary border-none"> |
||||
<div class="flex gap-1 align-center text-white"> |
||||
<span class="text-sm font-weight-medium">{{ $t('activity.upgrade.available') }}</span> |
||||
<mdi-menu-down /> |
||||
</div> |
||||
</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"> |
||||
<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"> |
||||
<div class="nc-menu-item"> |
||||
<mdi-rocket-launch-outline /> |
||||
<!-- How to upgrade? --> |
||||
{{ $t('activity.upgrade.howTo') }} |
||||
</div> |
||||
</nuxt-link> |
||||
<a-divider class="ma-0" /> |
||||
<div class="nc-menu-item" @click="latestRelease = null"> |
||||
<mdi-close /> |
||||
<!-- Hide menu --> |
||||
{{ $t('general.hideMenu') }} |
||||
</div> |
||||
</div> |
||||
</template> |
||||
</a-dropdown> |
||||
</div> |
||||
</template> |
@ -0,0 +1,33 @@
|
||||
<script setup lang="ts"> |
||||
import { useRoute } from '#imports' |
||||
|
||||
const route = useRoute() |
||||
|
||||
const showUserModal = $ref(false) |
||||
|
||||
const { isUIAllowed } = useUIPermission() |
||||
</script> |
||||
|
||||
<template> |
||||
<div class="flex items-center mr-4"> |
||||
<a-button |
||||
v-if=" |
||||
isUIAllowed('newUser') && |
||||
route.name !== 'index' && |
||||
route.name !== 'project-index-create' && |
||||
route.name !== 'project-index-create-external' && |
||||
route.name !== 'index-user-index' |
||||
" |
||||
size="middle" |
||||
type="primary" |
||||
class="!bg-white !text-primary rounded" |
||||
@click="showUserModal = true" |
||||
> |
||||
<div class="flex items-center space-x-1"> |
||||
<mdi-account-supervisor-outline class="mr-1" /> |
||||
<div>{{ $t('activity.share') }}</div> |
||||
</div> |
||||
</a-button> |
||||
<TabsAuthUserManagementUsersModal :key="showUserModal" :show="showUserModal" @closed="showUserModal = false" /> |
||||
</div> |
||||
</template> |
@ -0,0 +1,28 @@
|
||||
<script setup lang="ts"> |
||||
const editorOpen = ref(false) |
||||
|
||||
const tabKey = ref() |
||||
|
||||
const { metas } = $(useMetas()) |
||||
|
||||
const { tables } = useTable() |
||||
|
||||
const localTables = tables.value.filter((t) => metas[t.id as string]) |
||||
</script> |
||||
|
||||
<template> |
||||
<a-tooltip placement="bottom"> |
||||
<template #title> |
||||
<span> Debug Meta </span> |
||||
</template> |
||||
<mdi-bug-outline class="cursor-pointer" @click="editorOpen = true" /> |
||||
</a-tooltip> |
||||
|
||||
<a-modal v-model:visible="editorOpen" :footer="null" width="80%"> |
||||
<a-tabs v-model:activeKey="tabKey" type="card" closeable="false" class="shadow-sm"> |
||||
<a-tab-pane v-for="table in localTables" :key="table.id" :tab="table.title"> |
||||
<MonacoEditor v-model="metas[table.id]" class="h-max-[70vh]" :read-only="true" /> |
||||
</a-tab-pane> |
||||
</a-tabs> |
||||
</a-modal> |
||||
</template> |
Loading…
Reference in new issue