aboutsummaryrefslogtreecommitdiffstats
path: root/apps/twofactor_backupcodes/src
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2018-09-26 13:44:40 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2018-09-27 09:07:06 +0200
commitcd05670517da0cecfa8c6277c015fa33fae3394d (patch)
treecb2b564ee0ae9f0322461bbdffe4b115e2302e5f /apps/twofactor_backupcodes/src
parent13d9b5f5e0b03ee300137704d4822a47aa721449 (diff)
downloadnextcloud-server-cd05670517da0cecfa8c6277c015fa33fae3394d.tar.gz
nextcloud-server-cd05670517da0cecfa8c6277c015fa33fae3394d.zip
Fix generate button event and show regenerate button only when enabled
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/twofactor_backupcodes/src')
-rw-r--r--apps/twofactor_backupcodes/src/views/PersonalSettings.vue53
1 files changed, 28 insertions, 25 deletions
diff --git a/apps/twofactor_backupcodes/src/views/PersonalSettings.vue b/apps/twofactor_backupcodes/src/views/PersonalSettings.vue
index 74a59536aef..ac53de2e65c 100644
--- a/apps/twofactor_backupcodes/src/views/PersonalSettings.vue
+++ b/apps/twofactor_backupcodes/src/views/PersonalSettings.vue
@@ -1,31 +1,34 @@
<template>
<div>
<button v-if="!enabled"
- id="generate-backup-codes">{{ t('twofactor_backupcodes', 'Generate backup codes') }}</button>
- <p v-else>
- <template v-if="!codes">
- {{ t('twofactor_backupcodes', 'Backup codes have been generated. {used} of {total} codes have been used.', {used, total}) }}
- </template>
- <template v-else>
- {{ t('twofactor_backupcodes', 'These are your backup codes. Please save and/or print them as you will not be able to read the codes again later') }}
- <ul>
- <li v-for="code in codes" class="backup-code">{{code}}</li>
- </ul>
- <a :href="downloadUrl"
- class="button"
- download="Nextcloud-backup-codes.txt">{{ t('twofactor_backupcodes', 'Save backup codes') }}</a>
- <button class="button"
- v-on:click="printCodes">{{ t('twofactor_backupcodes', 'Print backup codes') }}</button>
- </template>
- </p>
- <p>
- <button id="generate-backup-codes"
- :class="{'icon-loading-small': generatingCodes}"
- v-on:click="generateBackupCodes">{{ t('twofactor_backupcodes', 'Regenerate backup codes') }}</button>
- </p>
- <p>
- {{ t('twofactor_backupcodes', 'If you regenerate backup codes, you automatically invalidate old codes.') }}
- </p>
+ id="generate-backup-codes"
+ v-on:click="generateBackupCodes">{{ t('twofactor_backupcodes', 'Generate backup codes') }}</button>
+ <template v-else>
+ <p>
+ <template v-if="!codes">
+ {{ t('twofactor_backupcodes', 'Backup codes have been generated. {used} of {total} codes have been used.', {used, total}) }}
+ </template>
+ <template v-else>
+ {{ t('twofactor_backupcodes', 'These are your backup codes. Please save and/or print them as you will not be able to read the codes again later') }}
+ <ul>
+ <li v-for="code in codes" class="backup-code">{{code}}</li>
+ </ul>
+ <a :href="downloadUrl"
+ class="button"
+ download="Nextcloud-backup-codes.txt">{{ t('twofactor_backupcodes', 'Save backup codes') }}</a>
+ <button class="button"
+ v-on:click="printCodes">{{ t('twofactor_backupcodes', 'Print backup codes') }}</button>
+ </template>
+ </p>
+ <p>
+ <button id="generate-backup-codes"
+ :class="{'icon-loading-small': generatingCodes}"
+ v-on:click="generateBackupCodes">{{ t('twofactor_backupcodes', 'Regenerate backup codes') }}</button>
+ </p>
+ <p>
+ {{ t('twofactor_backupcodes', 'If you regenerate backup codes, you automatically invalidate old codes.') }}
+ </p>
+ </template>
</div>
</template>