]> git.proxmox.com Git - pmg-gui.git/blob - js/MailProxyRelaying.js
MailProxyRelaying: use add_boolean_row and add_integer_row helpers
[pmg-gui.git] / js / MailProxyRelaying.js
1 Ext.define('PMG.MailProxyRelaying', {
2 extend: 'Proxmox.grid.ObjectGrid',
3 alias: ['widget.pmgMailProxyRelaying'],
4
5 initComponent : function() {
6 var me = this;
7
8 me.rows.relay = {
9 required: true,
10 defaultValue: Proxmox.Utils.noneText,
11 header: gettext('Default Relay'),
12 editor: {
13 xtype: 'proxmoxWindowEdit',
14 subject: gettext('Default Relay'),
15 items: {
16 xtype: 'proxmoxtextfield',
17 name: 'relay',
18 deleteEmpty: true,
19 fieldLabel: gettext('Default Relay')
20 }
21 }
22 };
23
24 me.add_integer_row('relayport', gettext('SMTP Port'),
25 { defaultValue: 25, deleteEmpty: true,
26 minValue: 1, maxValue: 65535 });
27
28 me.add_boolean_row('relaynomx', ettext('Disable MX lookup'));
29
30 me.rows.smarthost = {
31 required: true,
32 defaultValue: Proxmox.Utils.noneText,
33 header: gettext('Smarthost'),
34 editor: {
35 xtype: 'proxmoxWindowEdit',
36 subject: gettext('Smarthost'),
37 items: {
38 xtype: 'proxmoxtextfield',
39 name: 'smarthost',
40 deleteEmpty: true,
41 fieldLabel: gettext('Smarthost')
42 }
43 }
44 };
45
46 var baseurl = '/config/mail';
47
48 Ext.apply(me, {
49 url: '/api2/json' + baseurl,
50 editorConfig: {
51 url: '/api2/extjs' + baseurl,
52 },
53 interval: 5000,
54 cwidth1: 200,
55 listeners: {
56 itemdblclick: me.run_editor
57 }
58 });
59
60 me.callParent();
61
62 me.on('activate', me.rstore.startUpdate);
63 me.on('destroy', me.rstore.stopUpdate);
64 }
65 });