2023-09-20 17:34:33 +02:00
|
|
|
<script setup>
|
2023-10-20 13:28:17 +02:00
|
|
|
import twofaccountService from '@/services/twofaccountService'
|
|
|
|
import TotpLooper from '@/components/TotpLooper.vue'
|
|
|
|
import GroupSwitch from '@/components/GroupSwitch.vue'
|
|
|
|
import DestinationGroupSelector from '@/components/DestinationGroupSelector.vue'
|
|
|
|
import SearchBox from '@/components/SearchBox.vue'
|
|
|
|
import Toolbar from '@/components/Toolbar.vue'
|
|
|
|
import OtpDisplay from '@/components/OtpDisplay.vue'
|
2023-10-20 17:24:45 +02:00
|
|
|
import ActionButtons from '@/components/ActionButtons.vue'
|
2023-10-24 13:27:50 +02:00
|
|
|
import Dots from '@/components/Dots.vue'
|
2023-10-20 13:28:17 +02:00
|
|
|
import { UseColorMode } from '@vueuse/components'
|
|
|
|
import { useUserStore } from '@/stores/user'
|
|
|
|
import { useNotifyStore } from '@/stores/notify'
|
|
|
|
import { useBusStore } from '@/stores/bus'
|
2023-10-20 17:24:45 +02:00
|
|
|
import { useTwofaccounts } from '@/stores/twofaccounts'
|
|
|
|
import { useGroups } from '@/stores/groups'
|
2023-10-20 13:28:17 +02:00
|
|
|
import { useAppSettingsStore } from '@/stores/appSettings'
|
|
|
|
import { useDisplayablePassword } from '@/composables/helpers'
|
2023-11-14 13:59:30 +01:00
|
|
|
import { useSortable, moveArrayElement } from '@vueuse/integrations/useSortable'
|
2023-10-20 13:28:17 +02:00
|
|
|
|
|
|
|
const $2fauth = inject('2fauth')
|
2023-11-06 13:50:34 +01:00
|
|
|
const router = useRouter()
|
2023-10-20 13:28:17 +02:00
|
|
|
const notify = useNotifyStore()
|
|
|
|
const user = useUserStore()
|
|
|
|
const bus = useBusStore()
|
|
|
|
const appSettings = useAppSettingsStore()
|
|
|
|
const { copy, copied } = useClipboard({ legacy: true })
|
2023-10-20 17:24:45 +02:00
|
|
|
const twofaccounts = useTwofaccounts()
|
|
|
|
const groups = useGroups()
|
2023-10-20 13:28:17 +02:00
|
|
|
|
|
|
|
const showOtpInModal = ref(false)
|
|
|
|
const showGroupSwitch = ref(false)
|
|
|
|
const showDestinationGroupSelector = ref(false)
|
2023-10-20 17:24:45 +02:00
|
|
|
const isDragging = ref(false)
|
2023-10-24 13:27:50 +02:00
|
|
|
const stepIndexesCache = ref({})
|
|
|
|
const isRenewingOTPs = ref(false)
|
2023-10-20 13:28:17 +02:00
|
|
|
|
2023-10-20 17:24:45 +02:00
|
|
|
const otpDisplay = ref(null)
|
2023-11-15 15:31:23 +01:00
|
|
|
const otpDisplayProps = ref({
|
|
|
|
otp_type: '',
|
|
|
|
account : '',
|
|
|
|
service : '',
|
|
|
|
icon : '',
|
|
|
|
})
|
2023-10-24 13:27:50 +02:00
|
|
|
const looperRefs = ref([])
|
|
|
|
const dotsRefs = ref([])
|
2023-10-20 13:28:17 +02:00
|
|
|
|
2023-11-14 13:59:30 +01:00
|
|
|
let stopSortable
|
|
|
|
|
2023-10-20 17:24:45 +02:00
|
|
|
watch(showOtpInModal, (val) => {
|
|
|
|
if (val == false) {
|
|
|
|
otpDisplay.value?.clearOTP()
|
|
|
|
}
|
2023-10-20 13:28:17 +02:00
|
|
|
})
|
|
|
|
|
2023-11-14 13:59:30 +01:00
|
|
|
watch(
|
|
|
|
() => twofaccounts.items,
|
|
|
|
(val) => {
|
|
|
|
stopSortable
|
|
|
|
if (bus.inManagementMode) {
|
|
|
|
setSortable()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
watch(
|
|
|
|
() => bus.inManagementMode,
|
|
|
|
(val) => {
|
|
|
|
stopSortable
|
|
|
|
if (val) {
|
|
|
|
setSortable()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2023-10-20 13:28:17 +02:00
|
|
|
/**
|
|
|
|
* Returns whether or not the accounts should be displayed
|
|
|
|
*/
|
|
|
|
const showAccounts = computed(() => {
|
2023-10-25 17:26:32 +02:00
|
|
|
return !twofaccounts.isEmpty && !showGroupSwitch.value && !showDestinationGroupSelector.value
|
2023-10-20 13:28:17 +02:00
|
|
|
})
|
|
|
|
|
2023-10-25 17:26:32 +02:00
|
|
|
onMounted(async () => {
|
2023-11-02 14:54:12 +01:00
|
|
|
// This SFC is reached only if the user has some twofaccounts (see the starter middleware).
|
2023-10-25 17:26:32 +02:00
|
|
|
// This allows to display accounts without latency.
|
2023-11-02 14:54:12 +01:00
|
|
|
//
|
|
|
|
// We sync the store with the backend again to
|
|
|
|
twofaccounts.fetch().then(() => {
|
|
|
|
if (twofaccounts.backendWasNewer) {
|
|
|
|
notify.info({ text: trans('commons.data_refreshed_to_reflect_server_changes'), duration: 10000 })
|
|
|
|
}
|
|
|
|
})
|
|
|
|
groups.fetch()
|
2023-10-20 13:28:17 +02:00
|
|
|
})
|
|
|
|
|
2023-11-14 13:59:30 +01:00
|
|
|
// Enables the sortable behaviour of the twofaccounts list
|
|
|
|
function setSortable() {
|
|
|
|
const { stop } = useSortable('#dv', twofaccounts.filtered, {
|
|
|
|
animation: 200,
|
|
|
|
handle: '.drag-handle',
|
|
|
|
onUpdate: (e) => {
|
|
|
|
const movedId = twofaccounts.filtered[e.oldIndex].id
|
|
|
|
const inItemsIndex = twofaccounts.items.findIndex(item => item.id == movedId)
|
|
|
|
moveArrayElement(twofaccounts.items, inItemsIndex, e.newIndex)
|
|
|
|
|
|
|
|
nextTick(() => {
|
|
|
|
twofaccounts.saveOrder()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
stopSortable = stop
|
|
|
|
}
|
|
|
|
|
2023-10-20 13:28:17 +02:00
|
|
|
/**
|
2023-10-20 17:24:45 +02:00
|
|
|
* Runs some updates after accounts assignement/withdrawal
|
2023-10-20 13:28:17 +02:00
|
|
|
*/
|
|
|
|
function postGroupAssignementUpdate() {
|
|
|
|
// we fetch the accounts again to prevent the js collection being
|
|
|
|
// desynchronize from the backend php collection
|
2023-11-02 14:54:12 +01:00
|
|
|
twofaccounts.fetch()
|
2023-11-10 14:25:13 +01:00
|
|
|
twofaccounts.selectNone()
|
|
|
|
showDestinationGroupSelector.value = false
|
2023-10-26 08:44:29 +02:00
|
|
|
notify.success({ text: trans('twofaccounts.accounts_moved') })
|
2023-10-20 13:28:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows rotating OTP for the provided account
|
|
|
|
*/
|
|
|
|
function showOTP(account) {
|
2023-10-20 17:24:45 +02:00
|
|
|
// In Management mode, clicking an account does not show the otpDisplay, it selects the account
|
2023-10-20 13:28:17 +02:00
|
|
|
if(bus.inManagementMode) {
|
2023-10-20 17:24:45 +02:00
|
|
|
twofaccounts.select(account.id)
|
2023-10-20 13:28:17 +02:00
|
|
|
}
|
|
|
|
else {
|
2023-11-15 15:31:23 +01:00
|
|
|
// Data that should be displayed quickly by the OtpDisplay
|
|
|
|
// component are passed using props.
|
|
|
|
otpDisplayProps.value.otp_type = account.otp_type
|
|
|
|
otpDisplayProps.value.service = account.service
|
|
|
|
otpDisplayProps.value.account = account.account
|
|
|
|
otpDisplayProps.value.icon = account.icon
|
|
|
|
|
|
|
|
nextTick().then(() => {
|
|
|
|
showOtpInModal.value = true
|
|
|
|
otpDisplay.value.show(account.id);
|
|
|
|
})
|
2023-10-20 13:28:17 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows an OTP in a modal or directly copies it to the clipboard
|
|
|
|
*/
|
|
|
|
function showOrCopy(account) {
|
|
|
|
if (!user.preferences.getOtpOnRequest && account.otp_type.includes('totp')) {
|
2023-10-20 17:24:45 +02:00
|
|
|
copyToClipboard(account.otp.password)
|
2023-10-20 13:28:17 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
showOTP(account)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-10-20 17:24:45 +02:00
|
|
|
* Copies a string to the clipboard
|
2023-10-20 13:28:17 +02:00
|
|
|
*/
|
2023-10-20 17:24:45 +02:00
|
|
|
function copyToClipboard (password) {
|
2023-10-20 13:28:17 +02:00
|
|
|
copy(password)
|
|
|
|
|
|
|
|
if (copied) {
|
|
|
|
if(user.preferences.kickUserAfter == -1) {
|
2023-11-15 17:01:51 +01:00
|
|
|
user.logout({ kicked: true})
|
2023-10-20 13:28:17 +02:00
|
|
|
}
|
2023-10-26 08:44:29 +02:00
|
|
|
notify.success({ text: trans('commons.copied_to_clipboard') })
|
2023-10-20 13:28:17 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a fresh OTP from backend and copies it
|
|
|
|
*/
|
2023-10-20 17:24:45 +02:00
|
|
|
async function getAndCopyOTP(account) {
|
2023-10-20 13:28:17 +02:00
|
|
|
twofaccountService.getOtpById(account.id).then(response => {
|
|
|
|
let otp = response.data
|
2023-10-20 17:24:45 +02:00
|
|
|
copyToClipboard(otp.password)
|
2023-10-20 13:28:17 +02:00
|
|
|
|
|
|
|
if (otp.otp_type == 'hotp') {
|
|
|
|
let hotpToIncrement = accounts.value.find((acc) => acc.id == account.id)
|
|
|
|
|
|
|
|
// TODO : à koi ça sert ?
|
|
|
|
if (hotpToIncrement != undefined) {
|
|
|
|
hotpToIncrement.counter = otp.counter
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
2023-10-24 08:53:55 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Dragging start
|
|
|
|
*/
|
|
|
|
function onStart() {
|
|
|
|
isDragging.value = true
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dragging end
|
|
|
|
*/
|
|
|
|
function onEnd() {
|
|
|
|
isDragging.value = false
|
|
|
|
twofaccounts.saveOrder()
|
|
|
|
}
|
|
|
|
|
2023-10-24 13:27:50 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Turns dots On at the current step and caches the state
|
|
|
|
*/
|
|
|
|
function setCurrentStep(period, stepIndex) {
|
|
|
|
stepIndexesCache.value[period] = stepIndex
|
|
|
|
turnDotsOn(period, stepIndex)
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Turns dots On at the cached step index
|
|
|
|
*/
|
|
|
|
function turnDotsOnFromCache(period, stepIndex) {
|
|
|
|
if (stepIndexesCache.value[period] != undefined) {
|
|
|
|
turnDotsOn(period, stepIndexesCache.value[period])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Turns dots On for all dots components that match the provided period
|
|
|
|
*/
|
|
|
|
function turnDotsOn(period, stepIndex) {
|
|
|
|
dotsRefs.value.forEach((dots) => {
|
|
|
|
if (dots.props.period == period) {
|
|
|
|
dots.turnOn(stepIndex)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates "Always On" OTPs for all TOTP accounts with the given period and restarts loopers
|
|
|
|
*/
|
|
|
|
async function updateTotps(period) {
|
|
|
|
isRenewingOTPs.value = true
|
|
|
|
|
|
|
|
twofaccountService.getByIds(twofaccounts.accountIdsWithPeriod(period).join(','), true).then(response => {
|
|
|
|
response.data.forEach((account) => {
|
|
|
|
const index = twofaccounts.items.findIndex(acc => acc.id === account.id)
|
|
|
|
twofaccounts.items[index].otp = account.otp
|
|
|
|
|
|
|
|
looperRefs.value.forEach((looper) => {
|
|
|
|
if (looper.props.period == period) {
|
|
|
|
nextTick().then(() => {
|
|
|
|
looper.startLoop(account.otp.generated_at)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.finally(() => {
|
|
|
|
isRenewingOTPs.value = false
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2023-11-06 13:50:34 +01:00
|
|
|
/**
|
|
|
|
* Deletes selected accounts
|
|
|
|
*/
|
|
|
|
async function deleteAccounts() {
|
|
|
|
await twofaccounts.deleteSelected()
|
|
|
|
|
|
|
|
if (twofaccounts.isEmpty) {
|
2023-11-06 16:28:00 +01:00
|
|
|
bus.inManagementMode = false
|
2023-11-06 13:50:34 +01:00
|
|
|
router.push({ name: 'start' })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-10 16:49:39 +01:00
|
|
|
/**
|
|
|
|
* Exits from the Management mode
|
|
|
|
*/
|
|
|
|
function exitManagementMode()
|
|
|
|
{
|
|
|
|
bus.inManagementMode = false
|
|
|
|
twofaccounts.selectNone()
|
|
|
|
}
|
|
|
|
|
2023-09-20 17:34:33 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-10-20 13:28:17 +02:00
|
|
|
<div>
|
2023-10-27 15:53:51 +02:00
|
|
|
<GroupSwitch v-if="showGroupSwitch" v-model:showGroupSwitch="showGroupSwitch" v-model:groups="groups.items" />
|
2023-10-20 13:28:17 +02:00
|
|
|
<DestinationGroupSelector
|
|
|
|
v-if="showDestinationGroupSelector"
|
|
|
|
v-model:showDestinationGroupSelector="showDestinationGroupSelector"
|
2023-10-20 17:24:45 +02:00
|
|
|
v-model:selectedAccountsIds="twofaccounts.selectedIds"
|
2023-11-10 14:25:13 +01:00
|
|
|
:groups="groups.items"
|
|
|
|
@accounts-moved="postGroupAssignementUpdate">
|
2023-10-20 13:28:17 +02:00
|
|
|
</DestinationGroupSelector>
|
|
|
|
<!-- header -->
|
|
|
|
<div class="header" v-if="showAccounts || showGroupSwitch">
|
|
|
|
<div class="columns is-gapless is-mobile is-centered">
|
|
|
|
<div class="column is-three-quarters-mobile is-one-third-tablet is-one-quarter-desktop is-one-quarter-widescreen is-one-quarter-fullhd">
|
|
|
|
<!-- search -->
|
2023-10-20 17:24:45 +02:00
|
|
|
<SearchBox v-model:keyword="twofaccounts.filter"/>
|
2023-10-20 13:28:17 +02:00
|
|
|
<!-- toolbar -->
|
|
|
|
<Toolbar v-if="bus.inManagementMode"
|
2023-10-20 17:24:45 +02:00
|
|
|
:selectedCount="twofaccounts.selectedCount"
|
|
|
|
@clear-selected="twofaccounts.selectNone()"
|
|
|
|
@select-all="twofaccounts.selectAll()"
|
|
|
|
@sort-asc="twofaccounts.sortAsc()"
|
|
|
|
@sort-desc="twofaccounts.sortDesc()">
|
2023-10-20 13:28:17 +02:00
|
|
|
</Toolbar>
|
|
|
|
<!-- group switch toggle -->
|
|
|
|
<div v-else class="has-text-centered">
|
|
|
|
<div class="columns">
|
|
|
|
<UseColorMode v-slot="{ mode }">
|
2023-10-20 17:24:45 +02:00
|
|
|
<div class="column" v-if="showGroupSwitch">
|
|
|
|
<button id="btnHideGroupSwitch" :title="$t('groups.hide_group_selector')" tabindex="1" class="button is-text is-like-text" :class="{'has-text-grey' : mode != 'dark'}" @click.stop="showGroupSwitch = !showGroupSwitch">
|
|
|
|
{{ $t('groups.select_accounts_to_show') }}
|
2023-10-20 13:28:17 +02:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div class="column" v-else>
|
2023-10-20 17:24:45 +02:00
|
|
|
<button id="btnShowGroupSwitch" :title="$t('groups.show_group_selector')" tabindex="1" class="button is-text is-like-text" :class="{'has-text-grey' : mode != 'dark'}" @click.stop="showGroupSwitch = !showGroupSwitch">
|
|
|
|
{{ groups.current }} ({{ twofaccounts.filteredCount }})
|
|
|
|
<FontAwesomeIcon :icon="['fas', 'caret-down']" />
|
2023-10-20 13:28:17 +02:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</UseColorMode>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- modal -->
|
|
|
|
<Modal v-model="showOtpInModal">
|
|
|
|
<OtpDisplay
|
|
|
|
ref="otpDisplay"
|
2023-11-15 15:31:23 +01:00
|
|
|
v-bind="otpDisplayProps"
|
2023-10-20 13:28:17 +02:00
|
|
|
@please-close-me="showOtpInModal = false">
|
|
|
|
</OtpDisplay>
|
|
|
|
</Modal>
|
|
|
|
<!-- show accounts list -->
|
|
|
|
<div class="container" v-if="showAccounts" :class="bus.inManagementMode ? 'is-edit-mode' : ''">
|
|
|
|
<!-- accounts -->
|
2023-10-24 08:53:55 +02:00
|
|
|
<div class="accounts">
|
2023-11-14 13:59:30 +01:00
|
|
|
<span id="dv" class="columns is-multiline" :class="{ 'is-centered': user.preferences.displayMode === 'grid' }">
|
2023-10-24 08:53:55 +02:00
|
|
|
<div :class="[user.preferences.displayMode === 'grid' ? 'tfa-grid' : 'tfa-list']" class="column is-narrow" v-for="account in twofaccounts.filtered" :key="account.id">
|
|
|
|
<div class="tfa-container">
|
|
|
|
<transition name="slideCheckbox">
|
|
|
|
<div class="tfa-cell tfa-checkbox" v-if="bus.inManagementMode">
|
|
|
|
<div class="field">
|
2023-10-20 13:28:17 +02:00
|
|
|
<UseColorMode v-slot="{ mode }">
|
2023-10-24 08:53:55 +02:00
|
|
|
<input class="is-checkradio is-small" :class="mode == 'dark' ? 'is-white':'is-info'" :id="'ckb_' + account.id" :value="account.id" type="checkbox" :name="'ckb_' + account.id" v-model="twofaccounts.selectedIds">
|
2023-10-20 13:28:17 +02:00
|
|
|
</UseColorMode>
|
2023-10-24 08:53:55 +02:00
|
|
|
<label tabindex="0" :for="'ckb_' + account.id" v-on:keypress.space.prevent="twofaccounts.select(account.id)"></label>
|
2023-10-20 13:28:17 +02:00
|
|
|
</div>
|
2023-10-24 08:53:55 +02:00
|
|
|
</div>
|
|
|
|
</transition>
|
|
|
|
<div tabindex="0" class="tfa-cell tfa-content is-size-3 is-size-4-mobile" @click.exact="showOrCopy(account)" @keyup.enter="showOrCopy(account)" @click.ctrl="getAndCopyOTP(account)" role="button">
|
|
|
|
<div class="tfa-text has-ellipsis">
|
|
|
|
<img class="tfa-icon" :src="$2fauth.config.subdirectory + '/storage/icons/' + account.icon" v-if="account.icon && user.preferences.showAccountsIcons" :alt="$t('twofaccounts.icon_for_account_x_at_service_y', {account: account.account, service: account.service})">
|
|
|
|
{{ account.service ? account.service : $t('twofaccounts.no_service') }}<FontAwesomeIcon class="has-text-danger is-size-5 ml-2" v-if="appSettings.useEncryption && account.account === $t('errors.indecipherable')" :icon="['fas', 'exclamation-circle']" />
|
|
|
|
<span class="has-ellipsis is-family-primary is-size-6 is-size-7-mobile has-text-grey ">{{ account.account }}</span>
|
|
|
|
</div>
|
2023-10-20 13:28:17 +02:00
|
|
|
</div>
|
2023-10-24 08:53:55 +02:00
|
|
|
<transition name="popLater">
|
|
|
|
<div v-show="user.preferences.getOtpOnRequest == false && !bus.inManagementMode" class="has-text-right">
|
|
|
|
<span v-if="account.otp != undefined && isRenewingOTPs" class="has-nowrap has-text-grey has-text-centered is-size-5">
|
|
|
|
<FontAwesomeIcon :icon="['fas', 'circle-notch']" spin />
|
|
|
|
</span>
|
|
|
|
<span v-else-if="account.otp != undefined && isRenewingOTPs == false" class="always-on-otp is-clickable has-nowrap has-text-grey is-size-5 ml-4" @click="copyToClipboard(account.otp.password)" @keyup.enter="copyToClipboard(account.otp.password)" :title="$t('commons.copy_to_clipboard')">
|
|
|
|
{{ useDisplayablePassword(account.otp.password) }}
|
|
|
|
</span>
|
|
|
|
<span v-else>
|
|
|
|
<!-- get hotp button -->
|
|
|
|
<UseColorMode v-slot="{ mode }">
|
|
|
|
<button class="button tag" :class="mode == 'dark' ? 'is-dark' : 'is-white'" @click="showOTP(account)" :title="$t('twofaccounts.import.import_this_account')">
|
|
|
|
{{ $t('commons.generate') }}
|
|
|
|
</button>
|
|
|
|
</UseColorMode>
|
|
|
|
</span>
|
2023-10-24 13:27:50 +02:00
|
|
|
<Dots v-if="account.otp_type.includes('totp')" @hook:mounted="turnDotsOnFromCache(account.period)" :class="'condensed'" ref="dotsRefs" :period="account.period" />
|
2023-10-24 08:53:55 +02:00
|
|
|
</div>
|
|
|
|
</transition>
|
|
|
|
<transition name="fadeInOut">
|
|
|
|
<div class="tfa-cell tfa-edit has-text-grey" v-if="bus.inManagementMode">
|
|
|
|
<UseColorMode v-slot="{ mode }">
|
|
|
|
<RouterLink :to="{ name: 'editAccount', params: { twofaccountId: account.id }}" class="tag is-rounded mr-1" :class="mode == 'dark' ? 'is-dark' : 'is-white'">
|
|
|
|
{{ $t('commons.edit') }}
|
|
|
|
</RouterLink>
|
|
|
|
<RouterLink :to="{ name: 'showQRcode', params: { twofaccountId: account.id }}" class="tag is-rounded" :class="mode == 'dark' ? 'is-dark' : 'is-white'" :title="$t('twofaccounts.show_qrcode')">
|
|
|
|
<FontAwesomeIcon :icon="['fas', 'qrcode']" />
|
|
|
|
</RouterLink>
|
|
|
|
</UseColorMode>
|
|
|
|
</div>
|
|
|
|
</transition>
|
|
|
|
<transition name="fadeInOut">
|
2023-11-14 13:59:30 +01:00
|
|
|
<div class="drag-handle tfa-cell tfa-dots has-text-grey" v-if="bus.inManagementMode">
|
2023-10-24 08:53:55 +02:00
|
|
|
<FontAwesomeIcon :icon="['fas', 'bars']" />
|
|
|
|
</div>
|
|
|
|
</transition>
|
2023-10-20 13:28:17 +02:00
|
|
|
</div>
|
2023-10-24 08:53:55 +02:00
|
|
|
</div>
|
|
|
|
</span>
|
|
|
|
</div>
|
2023-11-10 16:49:39 +01:00
|
|
|
<VueFooter :showButtons="true" :internalFooterType="bus.inManagementMode && !showDestinationGroupSelector ? 'doneButton' : 'navLinks'" @done-button-clicked="exitManagementMode">
|
2023-10-20 17:24:45 +02:00
|
|
|
<ActionButtons
|
|
|
|
v-model:inManagementMode="bus.inManagementMode"
|
|
|
|
:areDisabled="twofaccounts.hasNoneSelected"
|
|
|
|
@move-button-clicked="showDestinationGroupSelector = true"
|
2023-11-06 13:50:34 +01:00
|
|
|
@delete-button-clicked="deleteAccounts"
|
2023-10-20 17:24:45 +02:00
|
|
|
@export-button-clicked="twofaccounts.export()">
|
|
|
|
</ActionButtons>
|
2023-10-20 13:28:17 +02:00
|
|
|
</VueFooter>
|
|
|
|
</div>
|
|
|
|
<!-- totp loopers -->
|
2023-10-24 13:27:50 +02:00
|
|
|
<span v-if="!user.preferences.getOtpOnRequest">
|
2023-10-20 13:28:17 +02:00
|
|
|
<TotpLooper
|
2023-10-24 13:27:50 +02:00
|
|
|
v-for="period in twofaccounts.periods"
|
2023-10-20 13:28:17 +02:00
|
|
|
:key="period.period"
|
|
|
|
:period="period.period"
|
|
|
|
:generated_at="period.generated_at"
|
|
|
|
v-on:loop-ended="updateTotps(period.period)"
|
|
|
|
v-on:loop-started="setCurrentStep(period.period, $event)"
|
|
|
|
v-on:stepped-up="setCurrentStep(period.period, $event)"
|
2023-10-24 13:27:50 +02:00
|
|
|
ref="looperRefs"
|
2023-10-20 13:28:17 +02:00
|
|
|
></TotpLooper>
|
2023-10-24 13:27:50 +02:00
|
|
|
</span>
|
2023-10-20 13:28:17 +02:00
|
|
|
</div>
|
2023-09-20 17:34:33 +02:00
|
|
|
</template>
|