feat(admin): View site link next to the user menu
Opens the admin origin's root in a new tab, like the WinterCMS backend.
This commit is contained in:
@@ -6,8 +6,10 @@ import SectionPanel from './SectionPanel.vue'
|
|||||||
import Breadcrumbs from './Breadcrumbs.vue'
|
import Breadcrumbs from './Breadcrumbs.vue'
|
||||||
import UserMenu from './UserMenu.vue'
|
import UserMenu from './UserMenu.vue'
|
||||||
import Toast from '../ui/Toast.vue'
|
import Toast from '../ui/Toast.vue'
|
||||||
|
import { ExternalLink } from '@lucide/vue'
|
||||||
import { activeEntry } from '../../state/useNavigation'
|
import { activeEntry } from '../../state/useNavigation'
|
||||||
import { useSidebar } from '../../state/useSidebar'
|
import { useSidebar } from '../../state/useSidebar'
|
||||||
|
import { t } from '../../app/i18n'
|
||||||
|
|
||||||
// Navigation shell (design: Navigation shell and Top header; D-06, D-10):
|
// Navigation shell (design: Navigation shell and Top header; D-06, D-10):
|
||||||
// the plugin rail, the active plugin's section panel (hidden when the
|
// the plugin rail, the active plugin's section panel (hidden when the
|
||||||
@@ -20,6 +22,10 @@ const { collapsed, watchViewport } = useSidebar()
|
|||||||
const stopViewport = watchViewport()
|
const stopViewport = watchViewport()
|
||||||
onBeforeUnmount(stopViewport)
|
onBeforeUnmount(stopViewport)
|
||||||
|
|
||||||
|
// "View site" (WinterCMS parity) opens the public site in a new tab: the
|
||||||
|
// admin page's own origin, without the admin path prefix.
|
||||||
|
const siteURL = `${window.location.origin}/`
|
||||||
|
|
||||||
const active = computed(() => activeEntry(String(route.params.vendor ?? ''), String(route.params.plugin ?? '')))
|
const active = computed(() => activeEntry(String(route.params.vendor ?? ''), String(route.params.plugin ?? '')))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -30,7 +36,20 @@ const active = computed(() => activeEntry(String(route.params.vendor ?? ''), Str
|
|||||||
<div class="flex min-w-0 flex-1 flex-col">
|
<div class="flex min-w-0 flex-1 flex-col">
|
||||||
<header class="flex h-header shrink-0 items-center justify-between gap-4 border-b border-border bg-surface pr-6 pl-8">
|
<header class="flex h-header shrink-0 items-center justify-between gap-4 border-b border-border bg-surface pr-6 pl-8">
|
||||||
<Breadcrumbs />
|
<Breadcrumbs />
|
||||||
<UserMenu />
|
<div class="flex shrink-0 items-center gap-1">
|
||||||
|
<a
|
||||||
|
data-view-site
|
||||||
|
:href="siteURL"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
:title="t('backend::lang.nav.view_site')"
|
||||||
|
:aria-label="t('backend::lang.nav.view_site')"
|
||||||
|
class="flex size-input items-center justify-center rounded-inner text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text"
|
||||||
|
>
|
||||||
|
<ExternalLink class="size-[18px]" aria-hidden="true" />
|
||||||
|
</a>
|
||||||
|
<UserMenu />
|
||||||
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<main class="min-w-0 flex-1 px-8 py-7">
|
<main class="min-w-0 flex-1 px-8 py-7">
|
||||||
<slot />
|
<slot />
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
modules/boardwalk/dist/assets/index-DhIJo93I.css
vendored
Normal file
1
modules/boardwalk/dist/assets/index-DhIJo93I.css
vendored
Normal file
File diff suppressed because one or more lines are too long
4
modules/boardwalk/dist/index.html
vendored
4
modules/boardwalk/dist/index.html
vendored
@@ -7,8 +7,8 @@
|
|||||||
<meta name="summer-admin-base" content="__SUMMER_ADMIN_BASE__" />
|
<meta name="summer-admin-base" content="__SUMMER_ADMIN_BASE__" />
|
||||||
<link rel="icon" href="./favicon.ico" sizes="48x48" />
|
<link rel="icon" href="./favicon.ico" sizes="48x48" />
|
||||||
<title>SummerCMS</title>
|
<title>SummerCMS</title>
|
||||||
<script type="module" crossorigin src="./assets/index-CuK_LdRk.js"></script>
|
<script type="module" crossorigin src="./assets/index-Bqh6wnN4.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="./assets/index-DgNySjE5.css">
|
<link rel="stylesheet" crossorigin href="./assets/index-DhIJo93I.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ nav:
|
|||||||
collapse: Collapse menu
|
collapse: Collapse menu
|
||||||
expand: Expand menu
|
expand: Expand menu
|
||||||
user_menu: User menu
|
user_menu: User menu
|
||||||
|
view_site: View site
|
||||||
page:
|
page:
|
||||||
not_found: Page not found.
|
not_found: Page not found.
|
||||||
list:
|
list:
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ nav:
|
|||||||
collapse: Zwiń menu
|
collapse: Zwiń menu
|
||||||
expand: Rozwiń menu
|
expand: Rozwiń menu
|
||||||
user_menu: Menu użytkownika
|
user_menu: Menu użytkownika
|
||||||
|
view_site: Zobacz stronę
|
||||||
page:
|
page:
|
||||||
not_found: Nie znaleziono strony.
|
not_found: Nie znaleziono strony.
|
||||||
list:
|
list:
|
||||||
|
|||||||
Reference in New Issue
Block a user