]>
git.proxmox.com Git - pmg-gui.git/blob - js/AttachmentGrid.js
1 Ext
.define('PMG.grid.AttachmentGrid', {
2 extend
: 'Ext.grid.GridPanel',
3 xtype
: 'pmgAttachmentGrid',
7 fields
: ['name', 'content-type', 'size'],
13 setID: function(rec
) {
15 if (!rec
|| !rec
.data
|| !rec
.data
.id
) {
16 me
.getStore().removeAll();
19 var url
= '/api2/json/quarantine/listattachments?id=' + rec
.data
.id
;
20 me
.mailid
= rec
.data
.id
;
21 me
.store
.proxy
.setUrl(url
);
25 emptyText
: gettext('No Attachments'),
27 download: function() {
28 Ext
.Msg
.alert(arguments
);
33 text
: gettext('Filename'),
38 text
: gettext('Filetype'),
39 dataIndex
: 'content-type',
40 renderer
: PMG
.Utils
.render_filetype
,
44 text
: gettext('Size'),
45 renderer
: Proxmox
.Utils
.format_size
,
50 header
: gettext('Download'),
51 renderer: function(value
, mD
, rec
) {
53 let url
= `/api2/json/quarantine/download?mailid=${me.mailid}&attachmentid=${rec.data.id}`;
54 return `<a target='_blank' class='download' download='${rec.data.name}' href='${url}'>
55 <i class='fa fa-fw fa-download'</i>