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