]> git.proxmox.com Git - pmg-gui.git/blob - js/MailInfo.js
backup config: add icons to tab buttons
[pmg-gui.git] / js / MailInfo.js
1 Ext.define('PMG.MailInfoBox', {
2 extend: 'Ext.container.Container',
3 xtype: 'pmgMailInfo',
4
5 cls: 'x-toolbar-default',
6 style: {
7 'border-left': '0px',
8 'border-right': '0px',
9 },
10
11 update: function(data) {
12 let me = this;
13 let escaped = {};
14 for (const [key, value] of Object.entries(data || {})) {
15 escaped[key] = Ext.util.Format.ellipsis(Ext.htmlEncode(value), 103);
16 }
17 me.items.each((item) => item.update(escaped));
18 },
19
20 layout: {
21 type: 'vbox',
22 align: 'stretch',
23 },
24
25 defaults: {
26 xtype: 'tbtext',
27 margin: '2 2 0 0 ',
28 },
29
30 items: [
31 {
32 tpl: `<b class="bold">${gettext("From")}:</b> {from}`
33 + `<span style="float:right;white-space:normal;overflow-wrap:break-word;">`
34 + `<b class="bold">${gettext("Receiver")}:</b> {receiver}</span>`,
35 },
36 { tpl: `<b class="bold">${gettext("Subject")}:</b> {subject}` },
37 ],
38 });