[pve-devel] r6306 - in pve-manager/pve2: . www/manager www/manager/dc
svn-commits at proxmox.com
svn-commits at proxmox.com
Fri Jul 15 06:31:44 CEST 2011
Author: dietmar
Date: 2011-07-15 06:31:44 +0200 (Fri, 15 Jul 2011)
New Revision: 6306
Modified:
pve-manager/pve2/ChangeLog
pve-manager/pve2/www/manager/Makefile.am
pve-manager/pve2/www/manager/dc/AuthView.js
pve-manager/pve2/www/manager/dc/UserEdit.js
Log:
2011-07-14 Seth Lauzon <seth.lauzon at gmail.com>
* www/manager/dc/UserEdit.js: impl. set groups, impl. comments
* www/manager/dc/GroupView.js: impl. delete groups
* www/manager/dc/AuthView.js: add create/modify/delete buttons,
impl. delete method
* www/manager/dc/AuthEdit.js: impl. create/modify authentication
Modified: pve-manager/pve2/ChangeLog
===================================================================
--- pve-manager/pve2/ChangeLog 2011-07-15 04:18:11 UTC (rev 6305)
+++ pve-manager/pve2/ChangeLog 2011-07-15 04:31:44 UTC (rev 6306)
@@ -1,3 +1,14 @@
+2011-07-14 Seth Lauzon <seth.lauzon at gmail.com>
+
+ * www/manager/dc/UserEdit.js: impl. set groups, impl. comments
+
+ * www/manager/dc/GroupView.js: impl. delete groups
+
+ * www/manager/dc/AuthView.js: add create/modify/delete buttons,
+ impl. delete method
+
+ * www/manager/dc/AuthEdit.js: impl. create/modify authentication
+
2011-07-14 Proxmox Support Team <support at proxmox.com>
* www/manager/VNCConsole.js: use decoded 'result' property
Modified: pve-manager/pve2/www/manager/Makefile.am
===================================================================
--- pve-manager/pve2/www/manager/Makefile.am 2011-07-15 04:18:11 UTC (rev 6305)
+++ pve-manager/pve2/www/manager/Makefile.am 2011-07-15 04:31:44 UTC (rev 6306)
@@ -89,6 +89,7 @@
dc/RoleView.js \
dc/ACLView.js \
dc/AuthView.js \
+ dc/AuthEdit.js \
dc/Config.js \
Workspace.js
Modified: pve-manager/pve2/www/manager/dc/AuthView.js
===================================================================
--- pve-manager/pve2/www/manager/dc/AuthView.js 2011-07-15 04:18:11 UTC (rev 6305)
+++ pve-manager/pve2/www/manager/dc/AuthView.js 2011-07-15 04:31:44 UTC (rev 6306)
@@ -14,9 +14,82 @@
}
});
+ var reload = function() {
+ store.load();
+ };
+
+ var tbar = [
+ {
+ text: 'Create',
+ handler: function() {
+ var win = Ext.create('PVE.dc.AuthEdit',{
+ });
+ win.on('destroy', reload);
+ win.show();
+ }
+ },
+ {
+ text: 'Modify',
+ handler: function() {
+ var sm = me.getSelectionModel();
+ var rec = sm.getSelection()[0];
+ if (!rec) {
+ return;
+ }
+
+ var realm = rec.data.realm;
+
+ var win = Ext.create('PVE.dc.AuthEdit',{
+ realm: realm
+ });
+ win.on('destroy', reload);
+ win.show();
+ }
+ },
+ {
+ text: 'Delete',
+ handler: function() {
+ var msg;
+ var sm = me.getSelectionModel();
+ var rec = sm.getSelection()[0];
+ if (!rec) {
+ return;
+ }
+
+ var realm = rec.data.realm;
+
+ if (realm !== 'pam' && realm != 'pve') {
+ msg = 'Are you sure you want to permanently the authentication realm: ' + realm;
+ Ext.Msg.confirm('Deletion Confirmation', msg, function(btn) {
+ if (btn !== 'yes') {
+ return;
+ }
+
+ me.setLoading(true, true);
+ PVE.Utils.API2Request({
+ url: '/access/domains/' + realm,
+ method: 'DELETE',
+ callback: function() {
+ me.setLoading(false);
+ reload();
+ },
+ failure: function (response, opts) {
+ Ext.Msg.alert('Error',response.htmlStatus);
+ }
+ });
+ });
+ } else {
+ msg = 'You are not permitted to delete the auth method: pam';
+ Ext.Msg.alert('Error', msg);
+ }
+ }
+ }
+ ];
+
Ext.apply(me, {
store: store,
stateful: false,
+ tbar: tbar,
viewConfig: {
trackOver: false
},
@@ -50,4 +123,4 @@
me.callParent();
}
-});
\ No newline at end of file
+});
Modified: pve-manager/pve2/www/manager/dc/UserEdit.js
===================================================================
--- pve-manager/pve2/www/manager/dc/UserEdit.js 2011-07-15 04:18:11 UTC (rev 6305)
+++ pve-manager/pve2/www/manager/dc/UserEdit.js 2011-07-15 04:31:44 UTC (rev 6306)
@@ -21,24 +21,38 @@
var column1 = [
{
xtype: me.create ? 'textfield' : 'displayfield',
+// name: me.create ? 'username' : 'userid',
name: 'userid',
fieldLabel: 'Userid',
value: me.userid,
allowBlank: false
},
-// {
-// xtype: 'pveRealmComboBox',
-// name: 'realm',
-// fieldLabel: 'Realm',
-// allowBlank: false
-// },
+ new Ext.form.ComboBox({
+ fieldLabel: 'Group',
+ name: 'groups',
+ multiSelect: true,
+ hiddenName: 'groupid',
+ store: new Ext.data.Store({
+ autoLoad: true,
+ model: 'pve-groups',
+ proxy: {
+ type: 'pve',
+ url: "/api2/json/access/groups"
+ },
+ sorters: {
+ property: 'groupid',
+ order: 'DESC'
+ }
+ }),
+ valueField: 'groupid',
+ displayField: 'groupid',
+ typeAhead: true,
+ queryMode: 'local',
+ triggerAction: 'all',
+ emptyText: 'No Groups Selected',
+ selectOnFocus: true
+ }),
{
- xtype: 'textfield',
- name: 'email',
- fieldLabel: 'Email',
- vtype: 'email'
- },
- {
xtype: 'datefield',
name: 'expire',
emptyText: 'never',
@@ -50,14 +64,34 @@
var column2 = [
{
- xtype: 'textfield',
- name: 'firstname',
- fieldLabel: 'First Name'
- },
- {
- xtype: 'textfield',
- name: 'lastname',
- fieldLabel: 'Last Name'
+ xtype: 'fieldset',
+ title: 'Personal Information',
+ collapsible: true,
+ collapsed: true,
+ defaultType: 'textfield',
+ layout: 'anchor',
+ defaults: {
+ anchor: '100%'
+ },
+ items: [
+ {
+ name: 'firstname',
+ fieldLabel: 'First Name'
+ },
+ {
+ name: 'lastname',
+ fieldLabel: 'Last Name'
+ },
+ {
+ name: 'email',
+ fieldLabel: 'Email',
+ vtype: 'email'
+ },
+ {
+ name: 'comment',
+ fieldLabel: 'Comment'
+ }
+ ]
}
];
@@ -70,6 +104,22 @@
});
}
+// if (me.create) {
+// column1.splice(1,0,{
+// xtype: 'pveRealmComboBox',
+// name: 'realm',
+// fieldLabel: 'Realm',
+// allowBlank: false,
+// submitValue: true
+// },
+// {
+// xtype: 'hidden',
+// name: 'userid',
+// value: ipanel.findField('username').getValue()
+// });
+// }
+
+
var ipanel = Ext.create('PVE.panel.InputPanel', {
column1: column1,
column2: column2
@@ -96,4 +146,3 @@
}
}
});
-
More information about the pve-devel
mailing list