]>
git.proxmox.com Git - pmg-gui.git/blob - js/MailProxyTLSDestinations.js
1 Ext
.define('pmg-tls-policy', {
2 extend
: 'Ext.data.Model',
3 fields
: ['destination', 'policy'],
4 idProperty
: 'destination',
7 url
: '/api2/json/config/tlspolicy',
10 property
: 'destination',
15 Ext
.define('PMG.TLSDestinationEdit', {
16 extend
: 'Proxmox.window.Edit',
17 xtype
: 'pmgTLSDestinationEdit',
18 onlineHelp
: 'pmgconfig_mailproxy_tls',
20 subject
: gettext('TLS Policy'),
21 initComponent: function() {
24 var isCreate
= !Ext
.isDefined(me
.destination
);
26 var url
= '/api2/extjs/config/tlspolicy' + (isCreate
? '' : '/' + me
.destination
);
27 var method
= isCreate
? 'POST' : 'PUT';
28 var text
= isCreate
? 'Create' : 'Edit';
32 xtype
: isCreate
? 'proxmoxtextfield' : 'displayfield',
34 fieldLabel
: gettext('Destination'),
37 xtype
: 'proxmoxKVComboBox',
39 fieldLabel
: gettext('Policy'),
44 ['encrypt', 'encrypt'],
46 ['dane-only', 'dane-only'],
47 ['fingerprint', 'fingerprint'],
67 Ext
.define('PMG.MailProxyTLSDestinations', {
68 extend
: 'Ext.grid.GridPanel',
69 alias
: ['widget.pmgMailProxyTLSDestinations'],
76 header
: gettext('Destination'),
79 dataIndex
: 'destination',
82 header
: gettext('Policy'),
89 initComponent: function() {
92 var rstore
= Ext
.create('Proxmox.data.UpdateStore', {
93 model
: 'pmg-tls-policy',
94 storeid
: 'pmg-mailproxy-tls-store-' + ++Ext
.idSeed
,
97 var store
= Ext
.create('Proxmox.data.DiffStore', { rstore
: rstore
});
99 var reload = function() {
103 me
.selModel
= Ext
.create('Ext.selection.RowModel', {});
105 var run_editor = function() {
106 var rec
= me
.selModel
.getSelection()[0];
111 var win
= Ext
.createWidget('pmgTLSDestinationEdit', {
112 destination
: rec
.data
.destination
,
116 win
.on('destroy', reload
);
122 xtype
: 'proxmoxButton',
124 text
: gettext('Edit'),
128 text
: gettext('Create'),
129 handler: function() {
130 var win
= Ext
.createWidget('pmgTLSDestinationEdit');
133 win
.on('destroy', reload
);
138 xtype
: 'proxmoxStdRemoveButton',
139 baseurl
: '/config/tlspolicy',
145 Proxmox
.Utils
.monStoreErrors(me
, store
, true);
150 run_editor
: run_editor
,
152 itemdblclick
: run_editor
,
157 me
.on('activate', rstore
.startUpdate
);
158 me
.on('destroy', rstore
.stopUpdate
);
159 me
.on('deactivate', rstore
.stopUpdate
);