public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH pmg-gui] spam quarantine: reorganize buttons
@ 2026-06-08 12:16 Dominik Csapak
  2026-06-08 14:12 ` applied: " Stoiko Ivanov
  2026-06-08 22:43 ` Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Dominik Csapak @ 2026-06-08 12:16 UTC (permalink / raw)
  To: pmg-devel

Since the number of buttons is rather large now, move the
'non-essential' actions into a 'More' menu. With this, there less often
the need for it to be scrollable.

Since the download button handled the download via the 'href' and
'download' attribute, this needs to be adapted to a proper handler and
handle it like we downloads in other places.

Since the other quarantine views don't have that many buttons (no
welcomelist/blacklist/seen) leave them as is for now.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
If desired, i can of course do the same for the virus/attachment quar,
but there would be only the 'download' button in the more menu, I don't
think that makes sense...

 js/SpamQuarantine.js                  | 50 +++++++++++++--------------
 js/controller/QuarantineController.js | 12 +++++++
 2 files changed, 36 insertions(+), 26 deletions(-)

diff --git a/js/SpamQuarantine.js b/js/SpamQuarantine.js
index 94998a9..a9a6931 100644
--- a/js/SpamQuarantine.js
+++ b/js/SpamQuarantine.js
@@ -408,20 +408,6 @@ Ext.define('PMG.SpamQuarantine', {
                             iconCls: 'fa fa-paint-brush',
                         },
                         '->',
-                        {
-                            xtype: 'button',
-                            reference: 'download',
-                            text: gettext('Download'),
-                            setDownload: function (id) {
-                                this.el.dom.download = id + '.eml';
-                            },
-                            bind: {
-                                href: '{downloadMailURL}',
-                                download: '{mailid}',
-                            },
-                            iconCls: 'fa fa-download',
-                        },
-                        '-',
                         {
                             xtype: 'button',
                             reference: 'markseen',
@@ -430,18 +416,6 @@ Ext.define('PMG.SpamQuarantine', {
                             iconCls: 'fa fa-eye',
                             tooltip: gettext('Mark this mail as seen or unseen'),
                         },
-                        {
-                            reference: 'welcomelist',
-                            text: gettext('Welcomelist'),
-                            iconCls: 'fa fa-check',
-                            handler: 'btnHandler',
-                        },
-                        {
-                            reference: 'blocklist',
-                            text: gettext('Blocklist'),
-                            iconCls: 'fa fa-times',
-                            handler: 'btnHandler',
-                        },
                         {
                             reference: 'deliver',
                             text: gettext('Deliver'),
@@ -454,6 +428,30 @@ Ext.define('PMG.SpamQuarantine', {
                             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',
+                                },
+                            ],
+                        },
                     ],
                 },
                 {
diff --git a/js/controller/QuarantineController.js b/js/controller/QuarantineController.js
index 5697611..b8b38bd 100644
--- a/js/controller/QuarantineController.js
+++ b/js/controller/QuarantineController.js
@@ -99,6 +99,18 @@ 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] 3+ messages in thread

* applied: [PATCH pmg-gui] spam quarantine: reorganize buttons
  2026-06-08 12:16 [PATCH pmg-gui] spam quarantine: reorganize buttons Dominik Csapak
@ 2026-06-08 14:12 ` Stoiko Ivanov
  2026-06-08 22:43 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Stoiko Ivanov @ 2026-06-08 14:12 UTC (permalink / raw)
  To: pmg-devel, Dominik Csapak

Thanks for tackling this so quickly!

Change works as advertised and the UI looks a bit cleaner to me..

On Mon, 08 Jun 2026 14:16:42 +0200, Dominik Csapak wrote:
> Since the number of buttons is rather large now, move the
> 'non-essential' actions into a 'More' menu. With this, there less often
> the need for it to be scrollable.
> 
> Since the download button handled the download via the 'href' and
> 'download' attribute, this needs to be adapted to a proper handler and
> handle it like we downloads in other places.
> 
> [...]

Applied, thanks!

[1/1] spam quarantine: reorganize buttons
      commit: cc3df1b0bb87a9df07bf0a156ab363193cb599b3





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

* Re: [PATCH pmg-gui] spam quarantine: reorganize buttons
  2026-06-08 12:16 [PATCH pmg-gui] spam quarantine: reorganize buttons Dominik Csapak
  2026-06-08 14:12 ` applied: " Stoiko Ivanov
@ 2026-06-08 22:43 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2026-06-08 22:43 UTC (permalink / raw)
  To: Dominik Csapak, pmg-devel

On 08/06/2026 14:16, Dominik Csapak wrote:
> Since the number of buttons is rather large now, move the
> 'non-essential' actions into a 'More' menu. With this, there less often
> the need for it to be scrollable.
> 
> Since the download button handled the download via the 'href' and
> 'download' attribute, this needs to be adapted to a proper handler and
> handle it like we downloads in other places.

Could be potentially a little bit nicer to only do this if there is
not enough space, e.g. simply using a fixed width boundary with some
head-room as check.

As I could imagine that some users will use the blocklisting much
more often than mark-seen, potentially depending also on the mailbox
in question.

Alternatively, or additionally: As download is rather a obvious icon
we could also drop the label there and add a tooltip instead to save
some space while keeping that (IMO rather relevant) function available.




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

end of thread, other threads:[~2026-06-08 22:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-08 12:16 [PATCH pmg-gui] spam quarantine: reorganize buttons Dominik Csapak
2026-06-08 14:12 ` applied: " Stoiko Ivanov
2026-06-08 22:43 ` 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