mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-06 00:49:58 +00:00
feat: add link to account settings on instance (#772)
Co-authored-by: 三咲智子 <sxzz@sxzz.moe>
This commit is contained in:
parent
482e8c1c3a
commit
8840205c98
3 changed files with 12 additions and 1 deletions
|
@ -6,6 +6,7 @@ const props = defineProps<{
|
||||||
icon?: string
|
icon?: string
|
||||||
to?: string | Record<string, string>
|
to?: string | Record<string, string>
|
||||||
command?: boolean
|
command?: boolean
|
||||||
|
external?: true
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
@ -33,6 +34,7 @@ useCommand({
|
||||||
<template>
|
<template>
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
:to="to"
|
:to="to"
|
||||||
|
:external="external"
|
||||||
exact-active-class="text-primary"
|
exact-active-class="text-primary"
|
||||||
block w-full group focus:outline-none
|
block w-full group focus:outline-none
|
||||||
@click="to ? $scrollToTop() : undefined"
|
@click="to ? $scrollToTop() : undefined"
|
||||||
|
@ -70,7 +72,7 @@ useCommand({
|
||||||
{{ content }}
|
{{ content }}
|
||||||
</slot>
|
</slot>
|
||||||
</p>
|
</p>
|
||||||
<div v-if="to" i-ri:arrow-right-s-line text-xl text-secondary-light class="rtl-flip" />
|
<div v-if="to" :class="!external ? 'i-ri:arrow-right-s-line' : 'i-ri:external-link-line'" text-xl text-secondary-light class="rtl-flip" />
|
||||||
</div>
|
</div>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -235,6 +235,7 @@
|
||||||
"about": {
|
"about": {
|
||||||
"label": "About"
|
"label": "About"
|
||||||
},
|
},
|
||||||
|
"account_settings": "Account settings",
|
||||||
"feature_flags": {
|
"feature_flags": {
|
||||||
"github_cards": "GitHub Cards",
|
"github_cards": "GitHub Cards",
|
||||||
"title": "Experimental Features",
|
"title": "Experimental Features",
|
||||||
|
|
|
@ -39,6 +39,14 @@ const isRootPath = computedEager(() => route.name === 'settings')
|
||||||
:text="$t('settings.interface.label')"
|
:text="$t('settings.interface.label')"
|
||||||
to="/settings/interface"
|
to="/settings/interface"
|
||||||
/>
|
/>
|
||||||
|
<SettingsItem
|
||||||
|
v-if="isHydrated && currentUser"
|
||||||
|
command
|
||||||
|
icon="i-ri:settings-line"
|
||||||
|
:text="$t('settings.account_settings')"
|
||||||
|
:to="`https://${currentUser!.server}/auth/edit`"
|
||||||
|
external target="_blank"
|
||||||
|
/>
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
command
|
command
|
||||||
icon="i-ri-globe-line"
|
icon="i-ri-globe-line"
|
||||||
|
|
Loading…
Reference in a new issue