|
|
@ -5,23 +5,22 @@ import MdiDotsVertical from '~icons/mdi/dots-vertical' |
|
|
|
import MaterialSymbolsMenu from '~icons/material-symbols/menu' |
|
|
|
import MaterialSymbolsMenu from '~icons/material-symbols/menu' |
|
|
|
import MdiReload from '~icons/mdi/reload' |
|
|
|
import MdiReload from '~icons/mdi/reload' |
|
|
|
import { navigateTo } from '#app' |
|
|
|
import { navigateTo } from '#app' |
|
|
|
|
|
|
|
import { useGlobal } from '#imports' |
|
|
|
|
|
|
|
|
|
|
|
const { $state } = useNuxtApp() |
|
|
|
const state = useGlobal() |
|
|
|
|
|
|
|
|
|
|
|
const { isLoading } = useApi({ useGlobalInstance: true }) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const sidebar = ref<HTMLDivElement>() |
|
|
|
const sidebar = ref<HTMLDivElement>() |
|
|
|
|
|
|
|
|
|
|
|
const email = computed(() => $state.user?.value?.email ?? '---') |
|
|
|
const email = computed(() => state.user.value?.email ?? '---') |
|
|
|
|
|
|
|
|
|
|
|
const signOut = () => { |
|
|
|
const signOut = () => { |
|
|
|
$state.signOut() |
|
|
|
state.signOut() |
|
|
|
navigateTo('/signin') |
|
|
|
navigateTo('/signin') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const sidebarCollapsed = computed({ |
|
|
|
const sidebarCollapsed = computed({ |
|
|
|
get: () => !$state.sidebarOpen.value, |
|
|
|
get: () => !state.sidebarOpen.value, |
|
|
|
set: (val) => ($state.sidebarOpen.value = !val), |
|
|
|
set: (val) => (state.sidebarOpen.value = !val), |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const toggleSidebar = () => { |
|
|
|
const toggleSidebar = () => { |
|
|
@ -32,7 +31,7 @@ const toggleSidebar = () => { |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<a-layout class="min-h-[100vh]"> |
|
|
|
<a-layout class="min-h-[100vh]"> |
|
|
|
<a-layout-header class="flex !bg-primary items-center text-white px-4 shadow-md"> |
|
|
|
<a-layout-header class="flex !bg-primary items-center text-white px-4 shadow-md"> |
|
|
|
<MaterialSymbolsMenu v-if="$state.signedIn.value" class="text-xl cursor-pointer" @click="toggleSidebar" /> |
|
|
|
<MaterialSymbolsMenu v-if="state.signedIn.value" class="text-xl cursor-pointer" @click="toggleSidebar" /> |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex-1" /> |
|
|
|
<div class="flex-1" /> |
|
|
|
|
|
|
|
|
|
|
@ -42,8 +41,9 @@ const toggleSidebar = () => { |
|
|
|
<span class="prose-xl">NocoDB</span> |
|
|
|
<span class="prose-xl">NocoDB</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div v-show="isLoading" class="text-gray-400 ml-3"> |
|
|
|
<div v-show="state.isLoading.value" class="text-gray-400 ml-3"> |
|
|
|
{{ $t('general.loading') }} <MdiReload :class="{ 'animate-infinite animate-spin !text-success': isLoading }" /> |
|
|
|
{{ $t('general.loading') }} |
|
|
|
|
|
|
|
<MdiReload :class="{ 'animate-infinite animate-spin !text-success': state.isLoading.value }" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
@ -52,7 +52,7 @@ const toggleSidebar = () => { |
|
|
|
<div class="flex justify-end gap-4"> |
|
|
|
<div class="flex justify-end gap-4"> |
|
|
|
<general-language class="mr-3" /> |
|
|
|
<general-language class="mr-3" /> |
|
|
|
|
|
|
|
|
|
|
|
<template v-if="$state.signedIn.value"> |
|
|
|
<template v-if="state.signedIn.value"> |
|
|
|
<a-dropdown :trigger="['click']"> |
|
|
|
<a-dropdown :trigger="['click']"> |
|
|
|
<MdiDotsVertical class="md:text-xl cursor-pointer nc-user-menu" @click.prevent /> |
|
|
|
<MdiDotsVertical class="md:text-xl cursor-pointer nc-user-menu" @click.prevent /> |
|
|
|
|
|
|
|
|
|
|
|