]> git.proxmox.com Git - pmg-gui.git/blobdiff - js/MailProxyTLSDestinations.js
dkim settings: improve label for signing domain source selection
[pmg-gui.git] / js / MailProxyTLSDestinations.js
index e4225f7ac2e56c982b68ed736ff15fee62734a7a..942aa3c1a9492ec408100b20b232ab9b11c76f6e 100644 (file)
@@ -1,4 +1,3 @@
-/*global Proxmox*/
 Ext.define('pmg-tls-policy', {
     extend: 'Ext.data.Model',
     fields: ['destination', 'policy'],
@@ -9,7 +8,7 @@ Ext.define('pmg-tls-policy', {
     },
     sorters: {
        property: 'destination',
-       order: 'DESC',
+       direction: 'ASC',
     },
 });
 
@@ -88,18 +87,16 @@ Ext.define('PMG.MailProxyTLSDestinations', {
     ],
 
     initComponent: function() {
-       var me = this;
+       let me = this;
 
-       var rstore = Ext.create('Proxmox.data.UpdateStore', {
+       let rstore = Ext.create('Proxmox.data.UpdateStore', {
            model: 'pmg-tls-policy',
            storeid: 'pmg-mailproxy-tls-store-' + ++Ext.idSeed,
        });
 
-       var store = Ext.create('Proxmox.data.DiffStore', { rstore: rstore });
+       let store = Ext.create('Proxmox.data.DiffStore', { rstore: rstore });
 
-        var reload = function() {
-            rstore.load();
-        };
+        let reload = () => rstore.load();
 
        me.selModel = Ext.create('Ext.selection.RowModel', {});
 
@@ -118,23 +115,24 @@ Ext.define('PMG.MailProxyTLSDestinations', {
            win.show();
        };
 
-       var tbar = [
-            {
+       let tbar = [
+           {
+               text: gettext('Create'),
+               handler: () => Ext.createWidget('pmgTLSDestinationEdit', {
+                   autoLoad: true,
+                   autoShow: true,
+                   listeners: {
+                       destroy: () => reload(),
+                   },
+               }),
+           },
+           '-',
+           {
                xtype: 'proxmoxButton',
                disabled: true,
                text: gettext('Edit'),
                handler: run_editor,
             },
-           {
-               text: gettext('Create'),
-               handler: function() {
-                   var win = Ext.createWidget('pmgTLSDestinationEdit');
-
-                   win.load();
-                   win.on('destroy', reload);
-                   win.show();
-               },
-            },
            {
                xtype: 'proxmoxStdRemoveButton',
                baseurl: '/config/tlspolicy',