[pve-devel] r6332 - pve-manager/pve2/www/manager/dc

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Jul 20 12:28:38 CEST 2011


Author: dietmar
Date: 2011-07-20 12:28:38 +0200 (Wed, 20 Jul 2011)
New Revision: 6332

Added:
   pve-manager/pve2/www/manager/dc/AuthEdit.js
Log:
add missing file


Added: pve-manager/pve2/www/manager/dc/AuthEdit.js
===================================================================
--- pve-manager/pve2/www/manager/dc/AuthEdit.js	                        (rev 0)
+++ pve-manager/pve2/www/manager/dc/AuthEdit.js	2011-07-20 10:28:38 UTC (rev 6332)
@@ -0,0 +1,107 @@
+Ext.define('PVE.dc.AuthEdit', {
+    extend: 'PVE.window.Edit',
+    alias: ['widget.pveDcAuthEdit'],
+
+    initComponent : function() {
+        var me = this;
+
+        me.create = !me.realm;
+
+        var url;
+        var method;
+
+        if (me.create) {
+            url = '/api2/extjs/access/domains';
+            method = 'POST';
+        } else {
+            url = '/api2/extjs/access/domains/' + me.realm;
+            method = 'PUT';
+        }
+
+        var column1 = [
+            {
+                xtype: me.create ? 'textfield' : 'displayfield',
+                name: 'realm',
+                fieldLabel: 'Realm',
+                value: me.realm,
+                allowBlank: false
+            },
+            {
+                xtype: 'textfield',
+                name: 'base_dn',
+                fieldLabel: 'Base Domain Name',
+                allowBlank: false
+            },
+            {
+                xtype: 'textfield',
+                name: 'useer_attr',
+                fieldLabel: 'User Attribute Name',
+                allowBlank: false
+            },
+            {
+                xtype: 'textfield',
+                name: 'comment',
+                fieldLabel: 'Comment',
+                allowBlank: false
+            },
+            {
+                xtype: 'pvecheckbox',
+                fieldLabel: 'Default Realm',
+                name: 'default',
+                uncheckedValue: 0
+            }
+        ];
+
+        var column2 = [
+            {
+                xtype: me.create ? 'textfield' : 'displayfield',
+                name: 'type',
+                fieldLabel: 'Server Type',
+                allowBlank: false
+            },
+            {
+                xtype: 'textfield',
+                name: 'server',
+                fieldLabel: 'Server Address',
+                allowBlank: false
+            },
+            {
+                xtype: 'numberfield',
+                name: 'port',
+                fieldLabel: 'Server Port',
+                minValue: 1,
+                maxValue: 65535,
+                allowBlank: false
+            },
+            {
+                xtype: 'pvecheckbox',
+                fieldLabel: 'Secure Communication',
+                name: 'secure',
+                uncheckedValue: 0
+            }
+        ];
+
+	var ipanel = Ext.create('PVE.panel.InputPanel', {
+	    column1: column1,
+	    column2: column2
+	});
+
+        Ext.applyIf(me, {
+            title: me.create ? "Create Auth" : "Edit Auth '" + me.realm + "'",
+            url: url,
+            method: method,
+	    items: [ ipanel ]
+        });
+
+        me.callParent();
+
+//        if (!me.create) {
+//            me.load({
+//                success: function(response, options) {
+//		    var data = response.result.data;
+//                  me.setValues(data);
+//                }
+//            });
+//        }
+    }
+});



More information about the pve-devel mailing list