]>
Commit | Line | Data |
---|---|---|
0023ef6a DC |
1 | Ext.define('pmg-attachment-list', { |
2 | extend: 'Ext.data.Model', | |
c87d46fb | 3 | fields: ['id', 'envelope_sender', 'from', 'sender', 'receiver', 'subject', |
0023ef6a DC |
4 | { type: 'integer', name: 'bytes' }, |
5 | { type: 'date', dateFormat: 'timestamp', name: 'time' }, | |
6 | { | |
7 | type: 'string', | |
8 | name: 'day', | |
9 | convert: function(v, rec) { | |
10 | return Ext.Date.format(rec.get('time'), 'Y-m-d'); | |
c87d46fb TL |
11 | }, depends: ['time'], |
12 | }, | |
0023ef6a DC |
13 | ], |
14 | proxy: { | |
15 | type: 'proxmox', | |
c87d46fb | 16 | url: "/api2/json/quarantine/attachment", |
0023ef6a | 17 | }, |
c87d46fb | 18 | idProperty: 'id', |
0023ef6a DC |
19 | }); |
20 | ||
8fb8931b SI |
21 | Ext.define('PMG.AttachmentQuarantine', { |
22 | extend: 'Ext.container.Container', | |
23 | xtype: 'pmgAttachmentQuarantine', | |
0023ef6a | 24 | |
8fb8931b SI |
25 | border: false, |
26 | layout: { type: 'border' }, | |
0023ef6a | 27 | |
8fb8931b | 28 | defaults: { border: false }, |
0023ef6a | 29 | |
8fb8931b SI |
30 | viewModel: { |
31 | parent: null, | |
32 | data: { | |
33 | mailid: '', | |
0023ef6a | 34 | }, |
8fb8931b SI |
35 | formulas: { |
36 | downloadMailURL: get => '/api2/json/quarantine/download?mailid=' + encodeURIComponent(get('mailid')), | |
c87d46fb | 37 | }, |
0023ef6a | 38 | }, |
c7a67975 | 39 | controller: 'quarantine', |
0023ef6a DC |
40 | items: [ |
41 | { | |
42 | title: gettext('Attachment Quarantine'), | |
43 | xtype: 'pmgQuarantineList', | |
44 | emptyText: gettext('No data in database'), | |
8fb8931b | 45 | selModel: 'checkboxmodel', |
c03e51ed | 46 | quarantineType: 'attachment', |
0023ef6a DC |
47 | reference: 'list', |
48 | region: 'west', | |
49 | width: 500, | |
50 | split: true, | |
51 | collapsible: false, | |
52 | store: { | |
53 | model: 'pmg-attachment-list', | |
54 | groupField: 'day', | |
55 | groupDir: 'DESC', | |
56 | sorters: [{ | |
57 | property: 'time', | |
c87d46fb TL |
58 | direction: 'DESC', |
59 | }], | |
0023ef6a DC |
60 | }, |
61 | ||
62 | columns: [ | |
63 | { | |
ab606ffb | 64 | header: `${gettext('Sender')}/${gettext('Receiver')}/${gettext('Subject')}`, |
0023ef6a | 65 | dataIndex: 'subject', |
cd150758 | 66 | renderer: PMG.Utils.render_sender_receiver, |
c87d46fb | 67 | flex: 1, |
0023ef6a DC |
68 | }, |
69 | { | |
70 | header: gettext('Size') + ' (KB)', | |
2cc13fbc | 71 | renderer: v => Ext.Number.toFixed(v/1024, 0), |
0023ef6a DC |
72 | dataIndex: 'bytes', |
73 | align: 'right', | |
c87d46fb | 74 | width: 90, |
0023ef6a DC |
75 | }, |
76 | { | |
77 | header: gettext('Date'), | |
78 | dataIndex: 'day', | |
c87d46fb | 79 | hidden: true, |
0023ef6a DC |
80 | }, |
81 | { | |
82 | xtype: 'datecolumn', | |
83 | header: gettext('Time'), | |
84 | dataIndex: 'time', | |
c87d46fb TL |
85 | format: 'H:i:s', |
86 | }, | |
87 | ], | |
0023ef6a DC |
88 | }, |
89 | { | |
90 | title: gettext('Selected Mail'), | |
91 | border: false, | |
92 | region: 'center', | |
60a9d6fd | 93 | layout: 'fit', |
0023ef6a DC |
94 | split: true, |
95 | reference: 'preview', | |
96 | disabled: true, | |
97 | dockedItems: [ | |
98 | { | |
99 | xtype: 'toolbar', | |
991d5ec2 | 100 | overflowHandler: 'scroller', |
0023ef6a DC |
101 | dock: 'top', |
102 | items: [ | |
103 | { | |
104 | xtype: 'button', | |
105 | reference: 'raw', | |
106 | text: gettext('Toggle Raw'), | |
107 | enableToggle: true, | |
c87d46fb | 108 | iconCls: 'fa fa-file-code-o', |
0023ef6a | 109 | }, |
9bcb553c | 110 | { |
e950ec72 SS |
111 | xtype: 'tbseparator', |
112 | reference: 'themeCheckSep', | |
113 | }, | |
114 | { | |
115 | xtype: 'proxmoxcheckbox', | |
116 | reference: 'themeCheck', | |
117 | checked: true, | |
118 | boxLabel: gettext('Dark-mode filter'), | |
9bcb553c SS |
119 | iconCls: 'fa fa-paint-brush', |
120 | }, | |
0023ef6a | 121 | '->', |
8fb8931b SI |
122 | { |
123 | xtype: 'button', | |
124 | reference: 'download', | |
125 | text: gettext('Download'), | |
126 | setDownload: function(id) { | |
127 | this.el.dom.download = id + ".eml"; | |
128 | }, | |
129 | bind: { | |
130 | href: '{downloadMailURL}', | |
131 | download: '{mailid}', | |
132 | }, | |
133 | iconCls: 'fa fa-download', | |
134 | }, | |
0023ef6a DC |
135 | { |
136 | reference: 'deliver', | |
137 | text: gettext('Deliver'), | |
365f84c1 | 138 | iconCls: 'fa fa-paper-plane-o info-blue', |
c87d46fb | 139 | handler: 'btnHandler', |
0023ef6a DC |
140 | }, |
141 | { | |
142 | reference: 'delete', | |
143 | text: gettext('Delete'), | |
365f84c1 | 144 | iconCls: 'fa fa-trash-o critical', |
c87d46fb TL |
145 | handler: 'btnHandler', |
146 | }, | |
147 | ], | |
0023ef6a | 148 | }, |
ac6c1fb8 DC |
149 | { |
150 | xtype: 'pmgMailInfo', | |
151 | hidden: true, | |
152 | reference: 'mailinfo', | |
153 | }, | |
38229fc8 TL |
154 | { |
155 | xtype: 'pmgAttachmentGrid', | |
156 | reference: 'attachmentlist', | |
157 | dock: 'bottom', | |
158 | collapsible: false, | |
159 | }, | |
c87d46fb TL |
160 | ], |
161 | }, | |
162 | ], | |
0023ef6a | 163 | }); |