+ },
+});
+
+Ext.define('PMG.TransportEditor', {
+ extend: 'Proxmox.window.Edit',
+ alias: 'widget.pmgTransportEditor',
+ mixins: ['Proxmox.Mixin.CBind'],
+
+ cbindData: (cfg) => ({
+ domainXType: cfg.method === 'POST' ? 'proxmoxtextfield' : 'displayfield',
+ }),
+
+ viewModel: {
+ data: {
+ proto: 'smtp',
+ },
+ formulas: {
+ protoIsSMTP: get => get('proto') === 'smtp',
+ },
+ },
+ onlineHelp: 'pmgconfig_mailproxy_transports',
+ subject: gettext("Transport"),
+
+ items: [
+ {
+ xtype: 'displayfield',
+ cbind: {
+ xtype: '{domainXType}',
+ },
+ name: 'domain',
+ fieldLabel: gettext("Relay Domain"),
+ },
+ {
+ xtype: 'textfield',
+ name: 'host',
+ fieldLabel: gettext("Host"),
+ },
+ {
+ xtype: 'proxmoxKVComboBox',
+ name: 'protocol',
+ fieldLabel: gettext('Protocol'),
+ deleteEmpty: false,
+ comboItems: [
+ ['smtp', 'SMTP'],
+ ['lmtp', 'LMTP'],
+ ],
+ allowBlank: true,
+ value: 'smtp',
+ bind: {
+ value: '{proto}',
+ },
+ },
+ {
+ xtype: 'proxmoxintegerfield',
+ name: 'port',
+ value: 25,
+ minValue: 1,
+ maxValue: 65535,
+ fieldLabel: gettext("Port"),
+ },
+ {
+ xtype: 'proxmoxcheckbox',
+ name: 'use_mx',
+ checked: true,
+ bind: {
+ disabled: '{!protoIsSMTP}',
+ hidden: '{!protoIsSMTP}',
+ },
+ uncheckedValue: 0,
+ fieldLabel: gettext('Use MX'),
+ },
+ {
+ xtype: 'textfield',
+ name: 'comment',
+ fieldLabel: gettext("Comment"),
+ },
+ ],