|
@@ -23,8 +23,11 @@ import CodeEntryView from "./Components/CodeEntryView.js";
|
|
|
import Flexer from "./Components/Flexer.js";
|
|
|
import QRCodeView from "./Components/QRCode.js";
|
|
|
import RecoveryCodesView from "./Components/RecoveryCodesView.js";
|
|
|
+import StepHeading from "./Components/StepHeading.js";
|
|
|
import StepView from "./Components/StepView.js";
|
|
|
+import StringView from "./Components/StringView.js";
|
|
|
import TestView from "./Components/TestView.js";
|
|
|
+import UIAlert from "./UIAlert.js";
|
|
|
import UIComponentWindow from "./UIComponentWindow.js";
|
|
|
|
|
|
const UIWindow2FASetup = async function UIWindow2FASetup () {
|
|
@@ -63,9 +66,24 @@ const UIWindow2FASetup = async function UIWindow2FASetup () {
|
|
|
children: [
|
|
|
new Flexer({
|
|
|
children: [
|
|
|
+ new StepHeading({
|
|
|
+ symbol: '1',
|
|
|
+ text: 'Open Authenticator App',
|
|
|
+ }),
|
|
|
+ new StringView({
|
|
|
+ text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ornare augue eu est pharetra, non faucibus eros finibus. Morbi metus sapien, pretium consequat erat eu, accumsan imperdiet metus. Donec varius libero tellus, malesuada rhoncus nunc viverra eget. Quisque ultrices scelerisque ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non purus varius, molestie nibh vitae, elementum urna. Suspendisse ultricies porta gravida. Nulla eu consequat mi, id mattis leo.',
|
|
|
+ }),
|
|
|
+ new StepHeading({
|
|
|
+ symbol: '2',
|
|
|
+ text: 'Scan This QR Code',
|
|
|
+ }),
|
|
|
new QRCodeView({
|
|
|
value: data.url,
|
|
|
}),
|
|
|
+ new StepHeading({
|
|
|
+ symbol: '3',
|
|
|
+ text: 'Enter Verification Code',
|
|
|
+ }),
|
|
|
new CodeEntryView({
|
|
|
_ref: me => code_entry = me,
|
|
|
async [`property.value`] (value, { component }) {
|
|
@@ -86,9 +104,20 @@ const UIWindow2FASetup = async function UIWindow2FASetup () {
|
|
|
}),
|
|
|
new Flexer({
|
|
|
children: [
|
|
|
+ new StepHeading({
|
|
|
+ symbol: '4',
|
|
|
+ text: 'Copy Recovery Codes',
|
|
|
+ }),
|
|
|
+ new StringView({
|
|
|
+ text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ornare augue eu est pharetra, non faucibus eros finibus. Morbi metus sapien, pretium consequat erat eu, accumsan imperdiet metus. Donec varius libero tellus, malesuada rhoncus nunc viverra eget. Quisque ultrices scelerisque ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non purus varius, molestie nibh vitae, elementum urna. Suspendisse ultricies porta gravida. Nulla eu consequat mi, id mattis leo.',
|
|
|
+ }),
|
|
|
new RecoveryCodesView({
|
|
|
values: data.codes,
|
|
|
}),
|
|
|
+ new StepHeading({
|
|
|
+ symbol: '5',
|
|
|
+ text: 'Confirm Recovery Codes',
|
|
|
+ }),
|
|
|
]
|
|
|
}),
|
|
|
]
|
|
@@ -97,6 +126,55 @@ const UIWindow2FASetup = async function UIWindow2FASetup () {
|
|
|
|
|
|
UIComponentWindow({
|
|
|
component,
|
|
|
+ on_before_exit: async () => {
|
|
|
+ console.log('this was called?');
|
|
|
+ return await UIAlert({
|
|
|
+ message: i18n('cancel_2fa_setup'),
|
|
|
+ buttons: [
|
|
|
+ {
|
|
|
+ label: i18n('yes'),
|
|
|
+ value: true,
|
|
|
+ type: 'primary',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: i18n('no'),
|
|
|
+ value: false,
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ title: 'Instant Login!',
|
|
|
+ app: 'instant-login',
|
|
|
+ single_instance: true,
|
|
|
+ icon: null,
|
|
|
+ uid: null,
|
|
|
+ is_dir: false,
|
|
|
+ // has_head: false,
|
|
|
+ selectable_body: true,
|
|
|
+ // selectable_body: false,
|
|
|
+ allow_context_menu: false,
|
|
|
+ is_resizable: false,
|
|
|
+ is_droppable: false,
|
|
|
+ init_center: true,
|
|
|
+ allow_native_ctxmenu: false,
|
|
|
+ allow_user_select: false,
|
|
|
+ // backdrop: true,
|
|
|
+ width: 550,
|
|
|
+ height: 'auto',
|
|
|
+ dominant: true,
|
|
|
+ show_in_taskbar: false,
|
|
|
+ draggable_body: true,
|
|
|
+ onAppend: function(this_window){
|
|
|
+ },
|
|
|
+ window_class: 'window-qr',
|
|
|
+ body_css: {
|
|
|
+ width: 'initial',
|
|
|
+ height: '100%',
|
|
|
+ 'background-color': 'rgb(245 247 249)',
|
|
|
+ 'backdrop-filter': 'blur(3px)',
|
|
|
+ padding: '20px',
|
|
|
+ },
|
|
|
});
|
|
|
}
|
|
|
|