]>
Commit | Line | Data |
---|---|---|
0f524f77 | 1 | Ext.define('PVE.dc.PoolEdit', { |
9fccc702 | 2 | extend: 'Proxmox.window.Edit', |
0f524f77 DM |
3 | alias: ['widget.pveDcPoolEdit'], |
4 | ||
5 | initComponent : function() { | |
6 | var me = this; | |
7 | ||
d5e771ce | 8 | me.isCreate = !me.poolid; |
0f524f77 DM |
9 | |
10 | var url; | |
11 | var method; | |
12 | ||
d5e771ce | 13 | if (me.isCreate) { |
0f524f77 DM |
14 | url = '/api2/extjs/pools'; |
15 | method = 'POST'; | |
16 | } else { | |
17 | url = '/api2/extjs/pools/' + me.poolid; | |
18 | method = 'PUT'; | |
19 | } | |
20 | ||
21 | Ext.applyIf(me, { | |
22 | subject: gettext('Pool'), | |
23 | url: url, | |
24 | method: method, | |
25 | items: [ | |
26 | { | |
dbed4c1c | 27 | xtype: me.isCreate ? 'proxmoxtextfield' : 'displayfield', |
0f524f77 DM |
28 | fieldLabel: gettext('Name'), |
29 | name: 'poolid', | |
30 | value: me.poolid, | |
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 | ||
d5e771ce | 44 | if (!me.isCreate) { |
0f524f77 | 45 | me.load(); |
9233148b AD |
46 | } else { |
47 | me.type = 'vnet' | |
48 | /* | |
49 | for (i = 0; i < 100; i++) { | |
50 | confid = 'net' + i.toString(); | |
51 | if (!Ext.isDefined(me.vmconfig[confid])) { | |
52 | me.confid = confid; | |
53 | break; | |
54 | } | |
55 | } | |
56 | */ | |
57 | } | |
0f524f77 DM |
58 | } |
59 | }); |