public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH pmg-gui] quarantine: improve button layout
@ 2026-06-09  8:59 Dominik Csapak
  2026-06-09 16:27 ` applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2026-06-09  8:59 UTC (permalink / raw)
  To: pmg-devel

This is a semantical revert & rework of
 cc3df1b (spam quarantine: reorganize buttons)

Instead of always showing a generic 'More' menu, optimize the button
layout such that there should be enough space in most cases.

Move welcomelist and blocklist as menu items to deliver and delete
respectively (as split buttons).

Also remove the text for the download button, this should be
self-explanatory and saves quite some space.
This is also done for the virus and attachment quarantine for
consistencies sake.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 js/AttachmentQuarantine.js            |  1 -
 js/SpamQuarantine.js                  | 59 ++++++++++++++++-----------
 js/VirusQuarantine.js                 |  1 -
 js/controller/QuarantineController.js | 12 ------
 4 files changed, 35 insertions(+), 38 deletions(-)

diff --git a/js/AttachmentQuarantine.js b/js/AttachmentQuarantine.js
index ee0f2e6..a29fd84 100644
--- a/js/AttachmentQuarantine.js
+++ b/js/AttachmentQuarantine.js
@@ -132,7 +132,6 @@ Ext.define('PMG.AttachmentQuarantine', {
                         {
                             xtype: 'button',
                             reference: 'download',
-                            text: gettext('Download'),
                             setDownload: function (id) {
                                 this.el.dom.download = id + '.eml';
                             },
diff --git a/js/SpamQuarantine.js b/js/SpamQuarantine.js
index a9a6931..4be8f8e 100644
--- a/js/SpamQuarantine.js
+++ b/js/SpamQuarantine.js
@@ -408,6 +408,19 @@ Ext.define('PMG.SpamQuarantine', {
                             iconCls: 'fa fa-paint-brush',
                         },
                         '->',
+                        {
+                            xtype: 'button',
+                            reference: 'download',
+                            setDownload: function (id) {
+                                this.el.dom.download = id + '.eml';
+                            },
+                            bind: {
+                                href: '{downloadMailURL}',
+                                download: '{mailid}',
+                            },
+                            iconCls: 'fa fa-download',
+                        },
+                        '-',
                         {
                             xtype: 'button',
                             reference: 'markseen',
@@ -417,40 +430,38 @@ Ext.define('PMG.SpamQuarantine', {
                             tooltip: gettext('Mark this mail as seen or unseen'),
                         },
                         {
+                            xtype: 'splitbutton',
                             reference: 'deliver',
                             text: gettext('Deliver'),
                             iconCls: 'fa fa-paper-plane-o info-blue',
                             handler: 'btnHandler',
+                            menu: {
+                                items: [
+                                    {
+                                        reference: 'welcomelist',
+                                        text: gettext('Welcomelist'),
+                                        iconCls: 'fa fa-check',
+                                        handler: 'btnHandler',
+                                    },
+                                ],
+                            },
                         },
                         {
+                            xtype: 'splitbutton',
                             reference: 'delete',
                             text: gettext('Delete'),
                             iconCls: 'fa fa-trash-o critical',
                             handler: 'btnHandler',
-                        },
-                        {
-                            text: gettext('More'),
-                            iconCls: 'fa fa-bars',
-                            menu: [
-                                {
-                                    reference: 'welcomelist',
-                                    text: gettext('Welcomelist'),
-                                    iconCls: 'fa fa-check',
-                                    handler: 'btnHandler',
-                                },
-                                {
-                                    reference: 'blocklist',
-                                    text: gettext('Blocklist'),
-                                    iconCls: 'fa fa-times',
-                                    handler: 'btnHandler',
-                                },
-                                {
-                                    reference: 'download',
-                                    text: gettext('Download'),
-                                    handler: 'downloadMail',
-                                    iconCls: 'fa fa-download',
-                                },
-                            ],
+                            menu: {
+                                items: [
+                                    {
+                                        reference: 'blocklist',
+                                        text: gettext('Blocklist'),
+                                        iconCls: 'fa fa-times',
+                                        handler: 'btnHandler',
+                                    },
+                                ],
+                            },
                         },
                     ],
                 },
diff --git a/js/VirusQuarantine.js b/js/VirusQuarantine.js
index 6c64948..de65c56 100644
--- a/js/VirusQuarantine.js
+++ b/js/VirusQuarantine.js
@@ -155,7 +155,6 @@ Ext.define('PMG.VirusQuarantine', {
                         {
                             xtype: 'button',
                             reference: 'download',
-                            text: gettext('Download'),
                             setDownload: function (id) {
                                 this.el.dom.download = id + '.eml';
                             },
diff --git a/js/controller/QuarantineController.js b/js/controller/QuarantineController.js
index b8b38bd..5697611 100644
--- a/js/controller/QuarantineController.js
+++ b/js/controller/QuarantineController.js
@@ -99,18 +99,6 @@ Ext.define('PMG.controller.QuarantineController', {
         me.doAction(action, selected);
     },
 
-    downloadMail: function () {
-        let me = this;
-        let vm = me.getViewModel();
-        let element = document.createElement('a');
-        element.setAttribute('href', vm.get('downloadMailURL'));
-        element.setAttribute('download', `${vm.get('mailid')}.eml`);
-        element.style.display = 'none';
-        document.body.appendChild(element);
-        element.click();
-        document.body.removeChild(element);
-    },
-
     doAction: function (action, selected) {
         if (!selected.length) {
             return;
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-09 16:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09  8:59 [PATCH pmg-gui] quarantine: improve button layout Dominik Csapak
2026-06-09 16:27 ` applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal