]> git.proxmox.com Git - pmg-gui.git/blob - js/MailProxyRelaying.js
add edit buttons
[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.add_text_row('relay', gettext('Default Relay'),
9 { defaultValue: Proxmox.Utils.noneText });
10
11 me.add_integer_row('relayport', gettext('SMTP Port'),
12 { defaultValue: 25, deleteEmpty: true,
13 minValue: 1, maxValue: 65535 });
14
15 me.add_boolean_row('relaynomx', gettext('Disable MX lookup'));
16
17 me.add_text_row('smarthost', gettext('Smarthost'),
18 { defaultValue: Proxmox.Utils.noneText });
19
20 var baseurl = '/config/mail';
21
22 me.selModel = Ext.create('Ext.selection.RowModel', {});
23
24 Ext.apply(me, {
25 tbar: [{
26 text: gettext('Edit'),
27 xtype: 'proxmoxButton',
28 disabled: true,
29 handler: function() { me.run_editor() },
30 selModel: me.selModel
31 }],
32 url: '/api2/json' + baseurl,
33 editorConfig: {
34 url: '/api2/extjs' + baseurl,
35 },
36 interval: 5000,
37 cwidth1: 200,
38 listeners: {
39 itemdblclick: me.run_editor
40 }
41 });
42
43 me.callParent();
44
45 me.on('activate', me.rstore.startUpdate);
46 me.on('destroy', me.rstore.stopUpdate);
47 }
48 });