| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 75d8376 commit 0a3159c
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,67 @@ | |||
| 1 | + <template> | ||
| 2 | + <div class="min-h-screen bg-slate-100 p-6 dark:bg-slate-900"> | ||
| 3 | + <div class="mx-auto w-full max-w-2xl rounded-2xl border border-slate-200 bg-white p-6 shadow-sm dark:border-slate-700 dark:bg-slate-800"> | ||
| 4 | + <h1 class="text-xl font-semibold text-slate-900 dark:text-white"> | ||
| 5 | + Public page | ||
| 6 | + </h1> | ||
| 7 | + <p class="mt-1 text-sm text-slate-500 dark:text-slate-400"> | ||
| 8 | + Custom page with <code>sidebarAndHeader: 'none'</code>. It must render for anonymous user without redirect to login. | ||
| 9 | + </p> | ||
| 10 | + | ||
| 11 | + <div class="mt-5 rounded-xl border p-4" | ||
| 12 | + :class="loggedIn | ||
| 13 | + ? 'border-green-300 bg-green-50 dark:border-green-700 dark:bg-green-900/30' | ||
| 14 | + : 'border-amber-300 bg-amber-50 dark:border-amber-700 dark:bg-amber-900/30'" | ||
| 15 | + > | ||
| 16 | + <div class="text-sm font-semibold text-slate-900 dark:text-white"> | ||
| 17 | + {{ loggedIn ? `Logged in as ${coreStore.username}` : 'Not logged in (anonymous)' }} | ||
| 18 | + </div> | ||
| 19 | + <div class="mt-1 text-xs text-slate-600 dark:text-slate-300"> | ||
| 20 | + {{ loggedIn | ||
| 21 | + ? 'Full config arrived: menu, resources and adminUser are filled.' | ||
| 22 | + : 'Only public part of config arrived: menu, resources and adminUser stay empty.' }} | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + | ||
| 26 | + <div class="mt-5 grid gap-3 sm:grid-cols-2"> | ||
| 27 | + <div v-for="row in rows" :key="row.label" class="rounded-xl border border-slate-200 bg-slate-50 p-3 dark:border-slate-700 dark:bg-slate-900"> | ||
| 28 | + <div class="text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400"> | ||
| 29 | + {{ row.label }} | ||
| 30 | + </div> | ||
| 31 | + <div class="mt-1 break-all text-sm text-slate-900 dark:text-white"> | ||
| 32 | + {{ row.value }} | ||
| 33 | + </div> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 36 | + | ||
| 37 | + <div class="mt-5 flex flex-wrap gap-3"> | ||
| 38 | + <RouterLink to="/login" class="rounded-lg bg-slate-900 px-4 py-2 text-sm text-white dark:bg-slate-700"> | ||
| 39 | + Go to login | ||
| 40 | + </RouterLink> | ||
| 41 | + <RouterLink to="/overview" class="rounded-lg border border-slate-300 px-4 py-2 text-sm text-slate-900 dark:border-slate-600 dark:text-white"> | ||
| 42 | + Go to protected page (redirects to login when anonymous) | ||
| 43 | + </RouterLink> | ||
| 44 | + </div> | ||
| 45 | + </div> | ||
| 46 | + </div> | ||
| 47 | + </template> | ||
| 48 | + | ||
| 49 | + <script setup lang="ts"> | ||
| 50 | + import { computed } from 'vue'; | ||
| 51 | + import { useCoreStore } from '@/stores/core'; | ||
| 52 | + | ||
| 53 | + const coreStore = useCoreStore(); | ||
| 54 | + | ||
| 55 | + const loggedIn = computed(() => !!coreStore.adminUser); | ||
| 56 | + | ||
| 57 | + const rows = computed(() => [ | ||
| 58 | + // public part of config, is here for anyone | ||
| 59 | + { label: 'config.brandName (public)', value: coreStore.config?.brandName ?? '—' }, | ||
| 60 | + { label: 'config.loginBackgroundPosition (public)', value: coreStore.config?.loginBackgroundPosition ?? '—' }, | ||
| 61 | + // logged in part of config, is here only for logged in user | ||
| 62 | + { label: 'config.datesFormat (logged in only)', value: coreStore.config?.datesFormat ?? '—' }, | ||
| 63 | + { label: 'config.usernameField (logged in only)', value: coreStore.config?.usernameField ?? '—' }, | ||
| 64 | + { label: 'menu items', value: coreStore.menu.length }, | ||
| 65 | + { label: 'resources', value: Object.keys(coreStore.resourceById).length }, | ||
| 66 | + ]); | ||
| 67 | + </script> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -78,6 +78,17 @@ export const admin = new AdminForth({ | |||
| 78 | 78 | showBrandNameInSidebar: true, | |
| 79 | 79 | showBrandLogoInSidebar: true, | |
| 80 | 80 | emptyFieldPlaceholder: '-', | |
| 81 | + customPages: [ | ||
| 82 | + { | ||
| 83 | + path: '/public-page', | ||
| 84 | + component: { | ||
| 85 | + file: '@@/PublicPage.vue', | ||
| 86 | + meta: { | ||
| 87 | + sidebarAndHeader: 'none', | ||
| 88 | + }, | ||
| 89 | + }, | ||
| 90 | + }, | ||
| 91 | + ], | ||
| 81 | 92 | styles:{ | |
| 82 | 93 | colors: { | |
| 83 | 94 | light: { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments