]>
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 | ||
15 | fieldLabel: gettext('API'), | |
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, | |
27 | editable: false, | |
28 | ||
29 | getSchema: function() { | |
30 | let me = this; | |
31 | let val = me.getValue(); | |
32 | if (val) { | |
56e7fc7b | 33 | let record = me.getStore().findRecord('id', val); |
f81ef757 DC |
34 | if (record) { |
35 | return record.data.schema; | |
36 | } | |
37 | } | |
38 | return {}; | |
39 | }, | |
40 | }); |