From: Dominik Csapak <d.csapak@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [PATCH pmg-gui] spam quarantine: reorganize buttons
Date: Mon, 8 Jun 2026 14:16:42 +0200 [thread overview]
Message-ID: <20260608121725.2417034-1-d.csapak@proxmox.com> (raw)
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
next reply other threads:[~2026-06-08 12:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 12:16 Dominik Csapak [this message]
2026-06-08 14:12 ` applied: [PATCH pmg-gui] spam quarantine: reorganize buttons Stoiko Ivanov
2026-06-08 22:43 ` Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260608121725.2417034-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pmg-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox