]> git.proxmox.com Git - pve-manager.git/blob - www/manager6/dc/GroupEdit.js
ui: realm: clarify that the sync jobs really are for the realm
[pve-manager.git] / www / manager6 / dc / GroupEdit.js
1 Ext.define('PVE.dc.GroupEdit', {
2 extend: 'Proxmox.window.Edit',
3 alias: ['widget.pveDcGroupEdit'],
4
5 initComponent: function() {
6 var me = this;
7
8 me.isCreate = !me.groupid;
9
10 var url;
11 var method;
12
13 if (me.isCreate) {
14 url = '/api2/extjs/access/groups';
15 method = 'POST';
16 } else {
17 url = '/api2/extjs/access/groups/' + me.groupid;
18 method = 'PUT';
19 }
20
21 Ext.applyIf(me, {
22 subject: gettext('Group'),
23 url: url,
24 method: method,
25 items: [
26 {
27 xtype: me.isCreate ? 'proxmoxtextfield' : 'displayfield',
28 fieldLabel: gettext('Name'),
29 name: 'groupid',
30 value: me.groupid,
31 allowBlank: false,
32 },
33 {
34 xtype: 'textfield',
35 fieldLabel: gettext('Comment'),
36 name: 'comment',
37 allowBlank: true,
38 },
39 ],
40 });
41
42 me.callParent();
43
44 if (!me.isCreate) {
45 me.load();
46 }
47 },
48 });