Ext.define('PMG.grid.AttachmentGrid', {
extend: 'Ext.grid.GridPanel',
xtype: 'pmgAttachmentGrid',
+ mixins: ['Proxmox.Mixin.CBind'],
+
+ showDownloads: true,
store: {
autoDestroy: true,
},
{
header: gettext('Download'),
+ cbind: {
+ hidden: '{!showDownloads}',
+ },
renderer: function(value, mD, rec) {
var me = this;
let url = `/api2/json/quarantine/download?mailid=${me.mailid}&attachmentid=${rec.data.id}`;
enableToggle: true,
iconCls: 'fa fa-bullhorn',
},
+ {
+ xtype: 'button',
+ reference: 'attachments',
+ text: gettext('Toggle Attachments'),
+ enableToggle: true,
+ pressed: true,
+ iconCls: 'fa fa-paperclip',
+ },
'->',
{
xtype: 'button',
reference: 'spaminfo',
border: false,
},
+ {
+ xtype: 'pmgAttachmentGrid',
+ minHeight: 50,
+ maxHeight: 250,
+ scrollable: true,
+ reference: 'attachmentlist',
+ showDownloads: false,
+ border: false,
+ },
{
xtype: 'pmgMailInfo',
hidden: true,
enableToggle: true,
iconCls: 'fa fa-file-code-o',
},
+ {
+ xtype: 'button',
+ reference: 'attachments',
+ text: gettext('Toggle Attachments'),
+ enableToggle: true,
+ pressed: true,
+ iconCls: 'fa fa-paperclip',
+ },
'->',
{
xtype: 'button',
},
],
},
+ {
+ xtype: 'pmgAttachmentGrid',
+ minHeight: 50,
+ maxHeight: 250,
+ scrollable: true,
+ reference: 'attachmentlist',
+ showDownloads: false,
+ border: false,
+ },
{
xtype: 'pmgMailInfo',
hidden: true,
me.updatePreview(me.raw, rec);
},
+ toggleAttachments: function(button) {
+ var grid = this.lookup('attachmentlist');
+ grid?.setVisible(!grid?.isVisible());
+ },
+
btnHandler: function(button, e) {
let me = this;
let action = button.reference;
'button[reference=raw]': {
click: 'toggleRaw',
},
+ 'button[reference=attachments]': {
+ click: 'toggleAttachments',
+ },
'pmgQuarantineList': {
selectionChange: 'onSelectMail',
itemkeypress: 'keyPress',