]>
Commit | Line | Data |
---|---|---|
de0ebd99 DC |
1 | /*jslint confusion: true*/ |
2 | /*value is string and number*/ | |
c37614f5 DM |
3 | Ext.define('PMG.FetchmailEdit', { |
4 | extend: 'Proxmox.window.Edit', | |
5 | xtype: 'pmgFetchmailEdit', | |
6 | ||
7 | userid: undefined, | |
8 | ||
9 | isAdd: true, | |
10 | ||
11 | subject: 'Fetchmail', | |
12 | ||
13 | fieldDefaults: { labelWidth: 120 }, | |
14 | ||
30a27efa DM |
15 | controller: { |
16 | ||
17 | xclass: 'Ext.app.ViewController', | |
18 | ||
19 | onProtocolChange: function() { | |
20 | var protocol = this.lookupReference('protocol').getValue(); | |
21 | var ssl = this.lookupReference('ssl').getValue(); | |
22 | ||
23 | var port_field = this.lookupReference('port'); | |
24 | if (protocol === 'pop3') { | |
25 | port_field.setValue(ssl ? 995 : 110); | |
26 | } else if (protocol === 'imap') { | |
27 | port_field.setValue(ssl ? 993 : 143); | |
28 | } | |
29 | } | |
30 | }, | |
31 | ||
c37614f5 DM |
32 | items: { |
33 | xtype: 'inputpanel', | |
34 | column1: [ | |
35 | { | |
36 | xtype: 'textfield', | |
37 | name: 'server', | |
38 | fieldLabel: gettext('Server'), | |
39 | allowBlank: false | |
40 | }, | |
30a27efa DM |
41 | { |
42 | xtype: 'proxmoxKVComboBox', | |
43 | fieldLabel: gettext('Protocol'), | |
44 | name: 'protocol', | |
45 | reference: 'protocol', | |
46 | value: 'pop3', | |
47 | listeners: { change: 'onProtocolChange' }, | |
48 | comboItems: [['pop3', 'pop3'], ['imap', 'imap']] | |
49 | }, | |
c37614f5 DM |
50 | { |
51 | xtype: 'proxmoxintegerfield', | |
52 | name: 'port', | |
30a27efa | 53 | reference: 'port', |
c37614f5 | 54 | fieldLabel: gettext('Port'), |
30a27efa | 55 | value: 110, |
c37614f5 DM |
56 | minValue: 1, |
57 | maxValue: 65535, | |
58 | allowBlank: false | |
59 | }, | |
60 | { | |
61 | xtype: 'textfield', | |
62 | name: 'user', | |
63 | fieldLabel: gettext('Username'), | |
64 | allowBlank: false | |
65 | }, | |
66 | { | |
67 | xtype: 'textfield', | |
68 | name: 'pass', | |
69 | inputType: 'password', | |
64fb657f | 70 | fieldLabel: gettext('Password'), |
c37614f5 DM |
71 | allowBlank: false |
72 | }, | |
73 | { | |
74 | xtype: 'textfield', | |
75 | name: 'target', | |
76 | fieldLabel: gettext('Deliver to'), | |
77 | allowBlank: false | |
771bd0b9 | 78 | } |
c37614f5 DM |
79 | |
80 | ], | |
81 | column2: [ | |
82 | { | |
83 | xtype: 'proxmoxcheckbox', | |
84 | fieldLabel: gettext('Enabled'), | |
85 | name: 'enable', | |
86 | uncheckedValue: 0, | |
87 | checked: true | |
88 | }, | |
89 | { | |
90 | xtype: 'proxmoxintegerfield', | |
91 | name: 'interval', | |
92 | fieldLabel: gettext('Interval'), | |
93 | value: 1, | |
94 | minValue: 1, | |
95 | maxValue: 24*12*7, | |
96 | allowBlank: false | |
97 | }, | |
98 | { | |
99 | xtype: 'proxmoxcheckbox', | |
100 | fieldLabel: gettext('Use SSL'), | |
30a27efa | 101 | listeners: { change: 'onProtocolChange' }, |
c37614f5 | 102 | name: 'ssl', |
30a27efa | 103 | reference: 'ssl', |
c37614f5 DM |
104 | uncheckedValue: 0, |
105 | checked: false | |
106 | }, | |
107 | { | |
108 | xtype: 'proxmoxcheckbox', | |
109 | fieldLabel: gettext('Keep old mails'), | |
110 | name: 'keep', | |
111 | uncheckedValue: 0, | |
112 | checked: false | |
113 | } | |
114 | ] | |
115 | } | |
116 | }); |