Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/twofactor_gateway.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-03-07 19:00:52 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-03-07 19:00:52 +0300
commitfe47092d6b07de6c49ae9e4ba681b86b86ba72b0 (patch)
tree8059cbba9706bc72c053022e8dd2b9555a88bc84 /js
parent3833321cd616cde48829f240d9697056ba2107ef (diff)
Migrate personal settings to Nextcloud 15 provider settings API
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'js')
-rw-r--r--js/components/GatewaySettings.vue1
-rw-r--r--js/init.js16
-rw-r--r--js/views/SMSSettings.vue13
-rw-r--r--js/views/Settings.vue31
-rw-r--r--js/views/SignalSettings.vue38
-rw-r--r--js/views/TelegramSettings.vue38
6 files changed, 102 insertions, 35 deletions
diff --git a/js/components/GatewaySettings.vue b/js/components/GatewaySettings.vue
index bfbb518..868ee8f 100644
--- a/js/components/GatewaySettings.vue
+++ b/js/components/GatewaySettings.vue
@@ -1,6 +1,5 @@
<template>
<div>
- <h3>{{ displayName }}</h3>
<div v-if="!isAvailable">
<L10n text="The {displayName} gateway is not configured."
:options="{displayName: displayName}"/>
diff --git a/js/init.js b/js/init.js
index cc3f6ae..c9364d7 100644
--- a/js/init.js
+++ b/js/init.js
@@ -1,9 +1,19 @@
import Vue from "vue"
-import SettingsView from "views/Settings.vue"
+import SignalSettings from "views/SignalSettings.vue"
+import SMSSettings from "views/SMSSettings.vue"
+import TelegramSettings from "views/TelegramSettings.vue"
Vue.config.productionTip = false
new Vue({
- render: h => h(SettingsView)
-}).$mount('#twofactor-sms-section')
+ render: h => h(SignalSettings)
+}).$mount('#twofactor-gateway-signal')
+
+new Vue({
+ render: h => h(SMSSettings)
+}).$mount('#twofactor-gateway-sms')
+
+new Vue({
+ render: h => h(TelegramSettings)
+}).$mount('#twofactor-gateway-telegram')
diff --git a/js/views/SMSSettings.vue b/js/views/SMSSettings.vue
new file mode 100644
index 0000000..b386e35
--- /dev/null
+++ b/js/views/SMSSettings.vue
@@ -0,0 +1,13 @@
+<template>
+ <GatewaySettings gateway-name="sms" display-name="SMS" />
+</template>
+
+<script>
+ import GatewaySettings from "../components/GatewaySettings.vue";
+
+ export default {
+ components: {
+ GatewaySettings,
+ }
+ };
+</script>
diff --git a/js/views/Settings.vue b/js/views/Settings.vue
deleted file mode 100644
index f3f08a7..0000000
--- a/js/views/Settings.vue
+++ /dev/null
@@ -1,31 +0,0 @@
-<template>
- <div class="section">
- <h2 data-anchor-name="sms-second-factor-auth">
- <L10n text="Message gateway second-factor auth"/>
- </h2>
- <L10n text="Here you can configure the message gateway to receive two-factor authentication codes via Signal, SMS or Telegram." />
- <GatewaySettings gateway-name="signal" display-name="Signal">
- <SignalInstructions slot="instructions" />
- </GatewaySettings>
- <GatewaySettings gateway-name="sms" display-name="SMS" />
- <GatewaySettings gateway-name="telegram" display-name="Telegram">
- <TelegramInstructions slot="instructions" />
- </GatewaySettings>
- </div>
-</template>
-
-<script>
- import L10n from "components/L10n.vue";
- import GatewaySettings from "../components/GatewaySettings.vue";
- import SignalInstructions from "../components/SignalInstructions.vue";
- import TelegramInstructions from "../components/TelegramInstructions.vue";
-
- export default {
- components: {
- TelegramInstructions,
- SignalInstructions,
- GatewaySettings,
- L10n
- }
- };
-</script>
diff --git a/js/views/SignalSettings.vue b/js/views/SignalSettings.vue
new file mode 100644
index 0000000..9f1577e
--- /dev/null
+++ b/js/views/SignalSettings.vue
@@ -0,0 +1,38 @@
+<!--
+ - @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
+ -
+ - @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
+ -
+ - @license GNU AGPL version 3 or any later version
+ -
+ - This program is free software: you can redistribute it and/or modify
+ - it under the terms of the GNU Affero General Public License as
+ - published by the Free Software Foundation, either version 3 of the
+ - License, or (at your option) any later version.
+ -
+ - This program is distributed in the hope that it will be useful,
+ - but WITHOUT ANY WARRANTY; without even the implied warranty of
+ - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ - GNU Affero General Public License for more details.
+ -
+ - You should have received a copy of the GNU Affero General Public License
+ - along with this program. If not, see <http://www.gnu.org/licenses/>.
+ -->
+
+<template>
+ <GatewaySettings gateway-name="signal" display-name="Signal">
+ <SignalInstructions slot="instructions"/>
+ </GatewaySettings>
+</template>
+
+<script>
+ import GatewaySettings from "../components/GatewaySettings.vue";
+ import SignalInstructions from "../components/SignalInstructions.vue";
+
+ export default {
+ components: {
+ SignalInstructions,
+ GatewaySettings,
+ }
+ };
+</script>
diff --git a/js/views/TelegramSettings.vue b/js/views/TelegramSettings.vue
new file mode 100644
index 0000000..86f572b
--- /dev/null
+++ b/js/views/TelegramSettings.vue
@@ -0,0 +1,38 @@
+<!--
+ - @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
+ -
+ - @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
+ -
+ - @license GNU AGPL version 3 or any later version
+ -
+ - This program is free software: you can redistribute it and/or modify
+ - it under the terms of the GNU Affero General Public License as
+ - published by the Free Software Foundation, either version 3 of the
+ - License, or (at your option) any later version.
+ -
+ - This program is distributed in the hope that it will be useful,
+ - but WITHOUT ANY WARRANTY; without even the implied warranty of
+ - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ - GNU Affero General Public License for more details.
+ -
+ - You should have received a copy of the GNU Affero General Public License
+ - along with this program. If not, see <http://www.gnu.org/licenses/>.
+ -->
+
+<template>
+ <GatewaySettings gateway-name="telegram" display-name="Telegram">
+ <TelegramInstructions slot="instructions"/>
+ </GatewaySettings>
+</template>
+
+<script>
+ import GatewaySettings from "../components/GatewaySettings.vue";
+ import TelegramInstructions from "../components/TelegramInstructions.vue";
+
+ export default {
+ components: {
+ TelegramInstructions,
+ GatewaySettings,
+ }
+ };
+</script>