]> git.proxmox.com Git - pve-manager.git/blob - www/manager6/form/ACMEAPISelector.js
cleanup: style fix
[pve-manager.git] / www / manager6 / form / ACMEAPISelector.js
1 Ext.define('pve-acme-challenges', {
2 extend: 'Ext.data.Model',
3 fields: ['id', 'type', 'schema'],
4 proxy: {
5 type: 'proxmox',
6 url: "/api2/json/cluster/acme/challenge-schema",
7 },
8 idProperty: 'id',
9 });
10
11 Ext.define('PVE.form.ACMEApiSelector', {
12 extend: 'Ext.form.field.ComboBox',
13 alias: 'widget.pveACMEApiSelector',
14
15 fieldLabel: gettext('DNS API'),
16 displayField: 'name',
17 valueField: 'id',
18
19 store: {
20 model: 'pve-acme-challenges',
21 autoLoad: true,
22 },
23
24 triggerAction: 'all',
25 queryMode: 'local',
26 allowBlank: false,
27 editable: true,
28 forceSelection: true,
29 anyMatch: true,
30 selectOnFocus: true,
31
32 getSchema: function() {
33 let me = this;
34 let val = me.getValue();
35 if (val) {
36 let record = me.getStore().findRecord('id', val, 0, false, true, true);
37 if (record) {
38 return record.data.schema;
39 }
40 }
41 return {};
42 },
43 });