]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
add schema and move authDomains there
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 9 Jul 2021 14:11:19 +0000 (16:11 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 9 Jul 2021 14:11:19 +0000 (16:11 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/Makefile
src/Schema.js [new file with mode: 0644]
src/Utils.js

index 41b4dc2eef941a77bea762047b0e635c45cf6a2e..4e438b23350837317b29c944f0e112ca2ce28ac9 100644 (file)
@@ -8,6 +8,7 @@ MARKEDJS=/usr/share/javascript/marked/marked.min.js
 
 JSSRC=                                 \
        Utils.js                        \
+       Schema.js                       \
        Toolkit.js                      \
        Logo.js                         \
        Parser.js                       \
diff --git a/src/Schema.js b/src/Schema.js
new file mode 100644 (file)
index 0000000..b8fc11f
--- /dev/null
@@ -0,0 +1,27 @@
+Ext.define('Proxmox.Schema', { // a singleton
+    singleton: true,
+
+    authDomains: {
+       pam: {
+           name: 'Linux PAM',
+           add: false,
+           edit: false,
+           pwchange: true,
+       },
+       openid: {
+           name: gettext('OpenID Connect Server'),
+           ipanel: 'pmxAuthOpenIDPanel',
+           add: true,
+           edit: true,
+           tfa: false,
+           pwchange: false,
+           iconCls: 'pmx-itype-icon-openid-logo',
+       },
+    },
+    // to add or change existing for product specific ones
+    overrideAuthDomains: function(extra) {
+       for (const [key, value] of Object.entries(extra)) {
+           Proxmox.Utils.authSchema[key] = value;
+       }
+    },
+});
index 167679ddefa763aa9aea44dcacd4d15a14a2dc36..ab85deeda32796e2121a7980876b4e37f622c5cb 100644 (file)
@@ -1151,30 +1151,6 @@ utilities: {
        return icon;
     },
 
-    authSchema: {
-       pam: {
-           name: 'Linux PAM',
-           add: false,
-           edit: false,
-           pwchange: true,
-       },
-       openid: {
-           name: gettext('OpenID Connect Server'),
-           ipanel: 'pmxAuthOpenIDPanel',
-           add: true,
-           edit: true,
-           tfa: false,
-           pwchange: false,
-           iconCls: 'pmx-itype-icon-openid-logo',
-       },
-    },
-
-    // to add or change existing for product specific ones
-    overrideAuthSchema: function(extra) {
-       for (const [key, value] of Object.entries(extra)) {
-           Proxmox.Utils.authSchema[key] = value;
-       }
-    },
 },
 
     singleton: true,