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