|
| 1 | +<template> |
| 2 | + <Card :title="$t('user.settings.feeds.title')"> |
| 3 | + <p> |
| 4 | + {{ $t('user.settings.feeds.howTo') }} |
| 5 | + </p> |
| 6 | + <FormField |
| 7 | + v-model="feedUrl" |
| 8 | + type="text" |
| 9 | + readonly |
| 10 | + > |
| 11 | + <template #addon> |
| 12 | + <XButton |
| 13 | + v-tooltip="$t('misc.copy')" |
| 14 | + :shadow="false" |
| 15 | + icon="paste" |
| 16 | + @click="copy(feedUrl)" |
| 17 | + /> |
| 18 | + </template> |
| 19 | + </FormField> |
| 20 | + |
| 21 | + <p class="mbs-4"> |
| 22 | + <i18n-t |
| 23 | + keypath="user.settings.feeds.usernameIs" |
| 24 | + scope="global" |
| 25 | + > |
| 26 | + <strong>{{ username }}</strong> |
| 27 | + </i18n-t> |
| 28 | + </p> |
| 29 | + |
| 30 | + <p class="mbs-2"> |
| 31 | + <i18n-t |
| 32 | + keypath="user.settings.feeds.apiTokenHint" |
| 33 | + scope="global" |
| 34 | + > |
| 35 | + <template #scope> |
| 36 | + <code>feeds:access</code> |
| 37 | + </template> |
| 38 | + <template #link> |
| 39 | + <RouterLink |
| 40 | + :to="{ |
| 41 | + name: 'user.settings.apiTokens', |
| 42 | + query: { |
| 43 | + title: $t('user.settings.feeds.tokenTitle'), |
| 44 | + scopes: 'feeds:access', |
| 45 | + }, |
| 46 | + }" |
| 47 | + > |
| 48 | + {{ $t('user.settings.apiTokens.title') }} |
| 49 | + </RouterLink> |
| 50 | + </template> |
| 51 | + </i18n-t> |
| 52 | + </p> |
| 53 | + </Card> |
| 54 | +</template> |
| 55 | + |
| 56 | +<script lang="ts" setup> |
| 57 | +import {computed} from 'vue' |
| 58 | +import {useI18n} from 'vue-i18n' |
| 59 | +
|
| 60 | +import {useTitle} from '@/composables/useTitle' |
| 61 | +import {useCopyToClipboard} from '@/composables/useCopyToClipboard' |
| 62 | +import FormField from '@/components/input/FormField.vue' |
| 63 | +import {useConfigStore} from '@/stores/config' |
| 64 | +import {useAuthStore} from '@/stores/auth' |
| 65 | +
|
| 66 | +const copy = useCopyToClipboard() |
| 67 | +
|
| 68 | +const {t} = useI18n({useScope: 'global'}) |
| 69 | +useTitle(() => `${t('user.settings.feeds.title')} - ${t('user.settings.title')}`) |
| 70 | +
|
| 71 | +const authStore = useAuthStore() |
| 72 | +const configStore = useConfigStore() |
| 73 | +const username = computed(() => authStore.info?.username) |
| 74 | +const feedUrl = computed(() => `${configStore.apiBase}/feeds/notifications.atom`) |
| 75 | +</script> |
0 commit comments