From 2b5ee2f006ae41275a60f81c21c77f5e48866b66 Mon Sep 17 00:00:00 2001 From: Bubka <858858+Bubka@users.noreply.github.com> Date: Thu, 7 Jul 2022 11:48:29 +0200 Subject: [PATCH] Complete Steam integration in forms --- resources/js/views/twofaccounts/Create.vue | 39 ++++++----- resources/js/views/twofaccounts/Edit.vue | 75 +++++++++++----------- 2 files changed, 63 insertions(+), 51 deletions(-) diff --git a/resources/js/views/twofaccounts/Create.vue b/resources/js/views/twofaccounts/Create.vue index 6ada48e3..f400e7eb 100644 --- a/resources/js/views/twofaccounts/Create.vue +++ b/resources/js/views/twofaccounts/Create.vue @@ -56,7 +56,7 @@ - + @@ -80,7 +80,7 @@ - +
@@ -100,18 +100,20 @@

-

{{ $t('commons.options') }}

-

- {{ $t('twofaccounts.forms.options_help') }} -

- - - - - - - - +
+

{{ $t('commons.options') }}

+

+ {{ $t('twofaccounts.forms.options_help') }} +

+ + + + + + + + +

@@ -204,6 +206,7 @@ otp_types: [ { text: 'TOTP', value: 'totp' }, { text: 'HOTP', value: 'hotp' }, + { text: 'STEAM', value: 'steamtotp' }, ], digitsChoices: [ { text: 6, value: 6 }, @@ -371,7 +374,13 @@ clipboardErrorHandler ({ value, event }) { console.log('error', value) - } + }, + + SetFormState (event) { + this.form.otp_type = event + this.form.service = event === 'steamtotp' ? 'Steam' : '' + this.secretIsBase32Encoded = event === 'steamtotp' ? 1 : this.secretIsBase32Encoded + }, }, diff --git a/resources/js/views/twofaccounts/Edit.vue b/resources/js/views/twofaccounts/Edit.vue index b1c92bed..c23822db 100644 --- a/resources/js/views/twofaccounts/Edit.vue +++ b/resources/js/views/twofaccounts/Edit.vue @@ -2,7 +2,7 @@

- + @@ -60,42 +60,44 @@

-

{{ $t('commons.options') }}

-

- {{ $t('twofaccounts.forms.options_help') }} -

- - - - - - - -
-
- +
+

{{ $t('commons.options') }}

+

+ {{ $t('twofaccounts.forms.options_help') }} +

+ + + + + + + +
+
+ +
+
+
+ +
+ + +
+ +

-
-
- -
- - -
- -

@@ -150,6 +152,7 @@ otp_types: [ { text: 'TOTP', value: 'totp' }, { text: 'HOTP', value: 'hotp' }, + { text: 'STEAM', value: 'steamtotp' }, ], digitsChoices: [ { text: 6, value: 6 },