[pmg-devel] [PATCH pmg-gui 2/2] quarantineview: unify url generation

Stoiko Ivanov s.ivanov at proxmox.com
Wed May 5 11:33:04 CEST 2021


this patch adds the cleanup for the attachment quarantine from
0e26e20aa5522b3f7d05e68c96104b051419b901 to the virus- and
spamquarantine.

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 js/SpamQuarantine.js  | 5 ++++-
 js/VirusQuarantine.js | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/js/SpamQuarantine.js b/js/SpamQuarantine.js
index f580ab3..daa3a69 100644
--- a/js/SpamQuarantine.js
+++ b/js/SpamQuarantine.js
@@ -67,7 +67,10 @@ Ext.define('PMG.SpamQuarantine', {
 		return;
 	    }
 
-	    var url = '/api2/htmlmail/quarantine/content?id=' + rec.data.id + (raw?'&raw=1':'');
+	    let url = `/api2/htmlmail/quarantine/content?id=${rec.data.id}`;
+	    if (raw) {
+		url += '&raw=1';
+	    }
 	    preview.setDisabled(false);
 	    this.lookupReference('raw').setDisabled(false);
 	    this.lookupReference('spam').setDisabled(false);
diff --git a/js/VirusQuarantine.js b/js/VirusQuarantine.js
index 105a438..d5753dd 100644
--- a/js/VirusQuarantine.js
+++ b/js/VirusQuarantine.js
@@ -43,7 +43,10 @@ Ext.define('PMG.VirusQuarantine', {
 		return;
 	    }
 
-	    var url = '/api2/htmlmail/quarantine/content?id=' + rec.data.id + (raw?'&raw=1':'');
+	    let url = `/api2/htmlmail/quarantine/content?id=${rec.data.id}`;
+	    if (raw) {
+		url += '&raw=1';
+	    }
 	    preview.setDisabled(false);
 	    preview.update("<iframe frameborder=0 width=100% height=100% sandbox='allow-same-origin' src='" + url +"'></iframe>");
 	},
-- 
2.20.1





More information about the pmg-devel mailing list