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