pve-manager/www/manager6/form/ACMEAPISelector.js
Thomas Lamprecht f597b16f69 ui: fix spelling in file name
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-06 20:08:02 +02:00

44 lines
881 B
JavaScript

Ext.define('pve-acme-challenges', {
extend: 'Ext.data.Model',
fields: ['id', 'type', 'schema'],
proxy: {
type: 'proxmox',
url: "/api2/json/cluster/acme/challenge-schema",
},
idProperty: 'id',
});
Ext.define('PVE.form.ACMEApiSelector', {
extend: 'Ext.form.field.ComboBox',
alias: 'widget.pveACMEApiSelector',
fieldLabel: gettext('DNS API'),
displayField: 'name',
valueField: 'id',
store: {
model: 'pve-acme-challenges',
autoLoad: true,
},
triggerAction: 'all',
queryMode: 'local',
allowBlank: false,
editable: true,
forceSelection: true,
anyMatch: true,
selectOnFocus: true,
getSchema: function() {
let me = this;
let val = me.getValue();
if (val) {
let record = me.getStore().findRecord('id', val);
if (record) {
return record.data.schema;
}
}
return {};
},
});