mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-26 02:41:30 +00:00
ui: add ACMEAPiSelector field
which return all api types from /cluster/acme/challengeschema and has a convenience method for getting the schema of the current value Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
c0afd5cc0a
commit
f81ef75756
@ -72,6 +72,7 @@ JSSRC= \
|
|||||||
form/SDNZoneSelector.js \
|
form/SDNZoneSelector.js \
|
||||||
form/SDNControllerSelector.js \
|
form/SDNControllerSelector.js \
|
||||||
form/TFASelector.js \
|
form/TFASelector.js \
|
||||||
|
form/ACMEAPiSelector.js \
|
||||||
dc/Tasks.js \
|
dc/Tasks.js \
|
||||||
dc/Log.js \
|
dc/Log.js \
|
||||||
panel/StatusPanel.js \
|
panel/StatusPanel.js \
|
||||||
|
40
www/manager6/form/ACMEAPiSelector.js
Normal file
40
www/manager6/form/ACMEAPiSelector.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
Ext.define('pve-acme-challenges', {
|
||||||
|
extend: 'Ext.data.Model',
|
||||||
|
fields: ['name', 'schema'],
|
||||||
|
proxy: {
|
||||||
|
type: 'proxmox',
|
||||||
|
url: "/api2/json/cluster/acme/challengeschema",
|
||||||
|
},
|
||||||
|
idProperty: 'name',
|
||||||
|
});
|
||||||
|
|
||||||
|
Ext.define('PVE.form.ACMEApiSelector', {
|
||||||
|
extend: 'Ext.form.field.ComboBox',
|
||||||
|
alias: 'widget.pveACMEApiSelector',
|
||||||
|
|
||||||
|
fieldLabel: gettext('API'),
|
||||||
|
displayField: 'name',
|
||||||
|
valueField: 'name',
|
||||||
|
|
||||||
|
store: {
|
||||||
|
model: 'pve-acme-challenges',
|
||||||
|
autoLoad: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
triggerAction: 'all',
|
||||||
|
queryMode: 'local',
|
||||||
|
allowBlank: false,
|
||||||
|
editable: false,
|
||||||
|
|
||||||
|
getSchema: function() {
|
||||||
|
let me = this;
|
||||||
|
let val = me.getValue();
|
||||||
|
if (val) {
|
||||||
|
let record = me.getStore().findRecord('name', val);
|
||||||
|
if (record) {
|
||||||
|
return record.data.schema;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user