]> git.proxmox.com Git - pmg-gui.git/commitdiff
transport edit: hide/disable Use-MX for LMTP
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 10 Jan 2020 13:26:25 +0000 (14:26 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 10 Jan 2020 13:26:27 +0000 (14:26 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
js/Transport.js

index 43b0f868891369338052b069a0f738158753acff..fb6d4647d01fff3c6c6b13a7b14f93c88ad6cce1 100644 (file)
@@ -99,7 +99,7 @@ Ext.define('PMG.Transport', {
                    dataIndex: 'port'
                },
                {
-                   header: gettext('Use MX (SMTP)'),
+                   header: gettext('Use MX'),
                    width: 80,
                    renderer: Proxmox.Utils.format_boolean,
                    dataIndex: 'use_mx'
@@ -130,6 +130,14 @@ Ext.define('PMG.TransportEditor', {
        domainXType: cfg.method === 'POST' ? 'proxmoxtextfield' : 'displayfield',
     }},
 
+    viewModel: {
+       data: {
+           proto: 'smtp',
+       },
+       formulas: {
+           protoIsSMTP: get => get('proto') === 'smtp',
+       },
+    },
     onlineHelp: 'pmgconfig_mailproxy_transports',
     subject: gettext("Transport"),
 
@@ -158,6 +166,9 @@ Ext.define('PMG.TransportEditor', {
            ],
            allowBlank: true,
            value: 'smtp',
+           bind: {
+               value: '{proto}'
+           },
        },
        {
            xtype: 'proxmoxintegerfield',
@@ -171,6 +182,10 @@ Ext.define('PMG.TransportEditor', {
            xtype: 'proxmoxcheckbox',
            name: 'use_mx',
            checked: true,
+           bind: {
+               disabled: '{!protoIsSMTP}',
+               hidden: '{!protoIsSMTP}',
+           },
            uncheckedValue: 0,
            fieldLabel: gettext('Use MX'),
        },