2023-09-27 10:53:49 +02:00
|
|
|
|
<script setup>
|
|
|
|
|
import { useAppSettingsStore } from '@/stores/appSettings'
|
|
|
|
|
import { useUserStore } from '@/stores/user'
|
2023-10-20 13:28:17 +02:00
|
|
|
|
|
2023-09-27 10:53:49 +02:00
|
|
|
|
const appSettings = useAppSettingsStore()
|
|
|
|
|
const user = useUserStore()
|
|
|
|
|
const $2fauth = inject('2fauth')
|
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
2023-11-10 16:49:39 +01:00
|
|
|
|
showButtons: true,
|
|
|
|
|
internalFooterType: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: 'navLinks'
|
|
|
|
|
}
|
2023-09-27 10:53:49 +02:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
function logout() {
|
|
|
|
|
if(confirm(trans('auth.confirm.logout'))) {
|
|
|
|
|
user.logout()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
2023-09-22 17:21:18 +02:00
|
|
|
|
<template>
|
2023-11-21 13:06:52 +01:00
|
|
|
|
<footer class="main">
|
2023-11-23 12:43:27 +01:00
|
|
|
|
<!-- action buttons -->
|
2023-09-22 17:21:18 +02:00
|
|
|
|
<div class="columns is-gapless" v-if="showButtons">
|
|
|
|
|
<div class="column has-text-centered">
|
|
|
|
|
<div class="field is-grouped">
|
|
|
|
|
<slot></slot>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-11-23 12:43:27 +01:00
|
|
|
|
<!-- sub-links -->
|
2023-11-10 16:49:39 +01:00
|
|
|
|
<div v-if="internalFooterType == 'doneButton'" class="content has-text-centered">
|
|
|
|
|
<button id="lnkExitEdit" class="button is-ghost is-like-text" @click.stop="$emit('doneButtonClicked', true)">{{ $t('commons.done') }}</button>
|
2023-09-22 17:21:18 +02:00
|
|
|
|
</div>
|
2023-11-30 21:52:37 +01:00
|
|
|
|
<div v-else-if="internalFooterType == 'modal'" class="content has-text-centered">
|
|
|
|
|
<router-link v-if="$route.name != 'accounts'" id="lnkBackToHome" :to="{ name: 'accounts' }" class="has-text-grey">{{ $t('commons.back_to_home') }}</router-link>
|
|
|
|
|
<span v-else> </span>
|
2023-11-23 12:43:27 +01:00
|
|
|
|
</div>
|
2023-09-22 17:21:18 +02:00
|
|
|
|
<div v-else class="content has-text-centered">
|
|
|
|
|
<div v-if="$route.meta.showAbout === true" class="is-size-6">
|
|
|
|
|
<router-link id="lnkAbout" :to="{ name: 'about' }" class="has-text-grey">
|
|
|
|
|
2FAuth – <span class="has-text-weight-bold">v{{ $2fauth.version }}</span>
|
|
|
|
|
</router-link>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
2024-01-29 08:55:56 +01:00
|
|
|
|
<router-link id="lnkSettings" :to="{ name: 'settings.options' }" class="has-text-grey">
|
|
|
|
|
{{ $t('settings.settings') }}
|
|
|
|
|
</router-link>
|
2024-02-22 13:17:52 +01:00
|
|
|
|
<span v-if="user.isAdmin"> -
|
|
|
|
|
<router-link id="lnkAdmin" :to="{ name: 'admin.appSetup' }" class="has-text-grey">
|
|
|
|
|
{{ $t('admin.admin') }}<span v-if="appSettings.latestRelease && appSettings.checkForUpdate" class="release-flag"></span>
|
|
|
|
|
</router-link>
|
|
|
|
|
</span>
|
2023-09-22 17:21:18 +02:00
|
|
|
|
<span v-if="!$2fauth.config.proxyAuth || ($2fauth.config.proxyAuth && $2fauth.config.proxyLogoutUrl)">
|
|
|
|
|
- <button id="lnkSignOut" class="button is-text is-like-text has-text-grey" @click="logout">{{ $t('auth.sign_out') }}</button>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</footer>
|
|
|
|
|
</template>
|