mirror of
https://git.proxmox.com/git/pmg-gui
synced 2025-08-09 07:37:26 +00:00
cleanup, add MailProxyPorts
This commit is contained in:
parent
7c876e1680
commit
7bf889cbbb
@ -11,7 +11,7 @@ Ext.define('PMG.MailProxyConfiguration', {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: gettext('Ports'),
|
title: gettext('Ports'),
|
||||||
html: "Ports",
|
xtype: 'pmgMailProxyPorts'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: gettext('Options'),
|
title: gettext('Options'),
|
||||||
|
69
js/MailProxyPorts.js
Normal file
69
js/MailProxyPorts.js
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
Ext.define('PMG.MailProxyPorts', {
|
||||||
|
extend: 'Proxmox.grid.ObjectGrid',
|
||||||
|
alias: ['widget.pmgMailProxyPorts'],
|
||||||
|
|
||||||
|
initComponent : function() {
|
||||||
|
var me = this;
|
||||||
|
|
||||||
|
var rows = {
|
||||||
|
ext_port: {
|
||||||
|
required: true,
|
||||||
|
defaultValue: 26,
|
||||||
|
header: gettext('External SMTP Port'),
|
||||||
|
editor: {
|
||||||
|
xtype: 'proxmoxWindowEdit',
|
||||||
|
subject: gettext('External SMTP Port'),
|
||||||
|
items: {
|
||||||
|
xtype: 'proxmoxintegerfield',
|
||||||
|
name: 'ext_port',
|
||||||
|
minValue: 1,
|
||||||
|
maxValue: 65535,
|
||||||
|
deleteEmpty: true,
|
||||||
|
value: 26,
|
||||||
|
labelWidth: 150,
|
||||||
|
fieldLabel: gettext('External SMTP Port')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
int_port: {
|
||||||
|
required: true,
|
||||||
|
defaultValue: 25,
|
||||||
|
header: gettext('Internal SMTP Port'),
|
||||||
|
editor: {
|
||||||
|
xtype: 'proxmoxWindowEdit',
|
||||||
|
subject: gettext('Internal SMTP Port'),
|
||||||
|
items: {
|
||||||
|
xtype: 'proxmoxintegerfield',
|
||||||
|
name: 'int_port',
|
||||||
|
minValue: 1,
|
||||||
|
maxValue: 65535,
|
||||||
|
deleteEmpty: true,
|
||||||
|
value: 25,
|
||||||
|
labelWidth: 150,
|
||||||
|
fieldLabel: gettext('Internal SMTP Port')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var baseurl = '/config/mail';
|
||||||
|
|
||||||
|
Ext.apply(me, {
|
||||||
|
url: '/api2/json' + baseurl,
|
||||||
|
editorConfig: {
|
||||||
|
url: '/api2/extjs' + baseurl,
|
||||||
|
},
|
||||||
|
interval: 5000,
|
||||||
|
cwidth1: 200,
|
||||||
|
rows: rows,
|
||||||
|
listeners: {
|
||||||
|
itemdblclick: me.run_editor
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
me.callParent();
|
||||||
|
|
||||||
|
me.on('activate', me.rstore.startUpdate);
|
||||||
|
me.on('destroy', me.rstore.stopUpdate);
|
||||||
|
}
|
||||||
|
});
|
@ -27,7 +27,7 @@ Ext.define('PMG.MailProxyRelaying', {
|
|||||||
header: gettext('SMTP port'),
|
header: gettext('SMTP port'),
|
||||||
editor: {
|
editor: {
|
||||||
xtype: 'proxmoxWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('SMTP port'),
|
subject: gettext('SMTP Port'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'proxmoxintegerfield',
|
xtype: 'proxmoxintegerfield',
|
||||||
name: 'relayport',
|
name: 'relayport',
|
||||||
@ -77,48 +77,16 @@ Ext.define('PMG.MailProxyRelaying', {
|
|||||||
|
|
||||||
var baseurl = '/config/mail';
|
var baseurl = '/config/mail';
|
||||||
|
|
||||||
var reload = function() {
|
|
||||||
me.rstore.load();
|
|
||||||
};
|
|
||||||
|
|
||||||
var run_editor = function() {
|
|
||||||
var sm = me.getSelectionModel();
|
|
||||||
var rec = sm.getSelection()[0];
|
|
||||||
if (!rec) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var rowdef = rows[rec.data.key];
|
|
||||||
if (!rowdef.editor) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var win;
|
|
||||||
if (Ext.isString(rowdef.editor)) {
|
|
||||||
win = Ext.create(rowdef.editor, {
|
|
||||||
confid: rec.data.key,
|
|
||||||
url: '/api2/extjs/' + baseurl
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
var config = Ext.apply({
|
|
||||||
confid: rec.data.key,
|
|
||||||
url: '/api2/extjs/' + baseurl
|
|
||||||
}, rowdef.editor);
|
|
||||||
win = Ext.createWidget(rowdef.editor.xtype, config);
|
|
||||||
win.load();
|
|
||||||
}
|
|
||||||
|
|
||||||
win.show();
|
|
||||||
win.on('destroy', reload);
|
|
||||||
};
|
|
||||||
|
|
||||||
Ext.apply(me, {
|
Ext.apply(me, {
|
||||||
url: '/api2/json/' + baseurl,
|
url: '/api2/json' + baseurl,
|
||||||
|
editorConfig: {
|
||||||
|
url: '/api2/extjs' + baseurl,
|
||||||
|
},
|
||||||
interval: 5000,
|
interval: 5000,
|
||||||
cwidth1: 200,
|
cwidth1: 200,
|
||||||
rows: rows,
|
rows: rows,
|
||||||
listeners: {
|
listeners: {
|
||||||
itemdblclick: run_editor
|
itemdblclick: me.run_editor
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ JSSRC= \
|
|||||||
RuleConfiguration.js \
|
RuleConfiguration.js \
|
||||||
SystemConfiguration.js \
|
SystemConfiguration.js \
|
||||||
MailProxyRelaying.js \
|
MailProxyRelaying.js \
|
||||||
|
MailProxyPorts.js \
|
||||||
MailProxyConfiguration.js \
|
MailProxyConfiguration.js \
|
||||||
ConfigPanel.js \
|
ConfigPanel.js \
|
||||||
Workspace.js
|
Workspace.js
|
||||||
|
Loading…
Reference in New Issue
Block a user