]> git.proxmox.com Git - proxmox-widget-toolkit.git/blobdiff - src/panel/AuthView.js
auth ui: add LDAP sync UI
[proxmox-widget-toolkit.git] / src / panel / AuthView.js
index 69fe1a59acc2e1557ed1c9ced4abee7de26a4af0..52b6cacbca65891e85eb28ca772c59edb59ff969 100644 (file)
@@ -75,6 +75,23 @@ Ext.define('Proxmox.panel.AuthView', {
        me.openEditWindow(rec.data.type, rec.data.realm);
     },
 
+    open_sync_window: function() {
+       let rec = this.getSelection()[0];
+       if (!rec) {
+           return;
+       }
+       if (!Proxmox.Schema.authDomains[rec.data.type].sync) {
+           return;
+       }
+       Ext.create('Proxmox.window.SyncWindow', {
+           type: rec.data.type,
+           realm: rec.data.realm,
+           listeners: {
+               destroy: () => this.reload(),
+           },
+       }).show();
+    },
+
     initComponent: function() {
        var me = this;
 
@@ -115,6 +132,13 @@ Ext.define('Proxmox.panel.AuthView', {
                enableFn: (rec) => Proxmox.Schema.authDomains[rec.data.type].add,
                callback: () => me.reload(),
            },
+           {
+               xtype: 'proxmoxButton',
+               text: gettext('Sync'),
+               disabled: true,
+               enableFn: (rec) => Proxmox.Schema.authDomains[rec.data.type].sync,
+               handler: () => me.open_sync_window(),
+           },
        ];
 
        if (me.extraButtons) {