]> git.proxmox.com Git - proxmox-widget-toolkit.git/blob - src/form/ACME.js
status view: query and update pveInfoWidget too for now
[proxmox-widget-toolkit.git] / src / form / ACME.js
1 Ext.define('Proxmox.form.ACMEApiSelector', {
2 extend: 'Ext.form.field.ComboBox',
3 alias: 'widget.pmxACMEApiSelector',
4
5 fieldLabel: gettext('DNS API'),
6 displayField: 'name',
7 valueField: 'id',
8
9 store: {
10 model: 'proxmox-acme-challenges',
11 autoLoad: true,
12 },
13
14 triggerAction: 'all',
15 queryMode: 'local',
16 allowBlank: false,
17 editable: true,
18 forceSelection: true,
19 anyMatch: true,
20 selectOnFocus: true,
21
22 getSchema: function() {
23 let me = this;
24 let val = me.getValue();
25 if (val) {
26 let record = me.getStore().findRecord('id', val, 0, false, true, true);
27 if (record) {
28 return record.data.schema;
29 }
30 }
31 return {};
32 },
33
34 initComponent: function() {
35 let me = this;
36
37 if (!me.url) {
38 throw "no url given";
39 }
40
41 me.callParent();
42 me.getStore().getProxy().setUrl(me.url);
43 },
44 });
45
46 Ext.define('Proxmox.form.ACMEAccountSelector', {
47 extend: 'Ext.form.field.ComboBox',
48 alias: 'widget.pmxACMEAccountSelector',
49
50 displayField: 'name',
51 valueField: 'name',
52
53 store: {
54 model: 'proxmox-acme-accounts',
55 autoLoad: true,
56 },
57
58 triggerAction: 'all',
59 queryMode: 'local',
60 allowBlank: false,
61 editable: false,
62 forceSelection: true,
63
64 isEmpty: function() {
65 return this.getStore().getData().length === 0;
66 },
67
68 initComponent: function() {
69 let me = this;
70
71 if (!me.url) {
72 throw "no url given";
73 }
74
75 me.callParent();
76 me.getStore().getProxy().setUrl(me.url);
77 },
78 });
79
80 Ext.define('Proxmox.form.ACMEPluginSelector', {
81 extend: 'Ext.form.field.ComboBox',
82 alias: 'widget.pmxACMEPluginSelector',
83
84 fieldLabel: gettext('Plugin'),
85 displayField: 'plugin',
86 valueField: 'plugin',
87
88 store: {
89 model: 'proxmox-acme-plugins',
90 autoLoad: true,
91 filters: item => item.data.type === 'dns',
92 },
93
94 triggerAction: 'all',
95 queryMode: 'local',
96 allowBlank: false,
97 editable: false,
98
99 initComponent: function() {
100 let me = this;
101
102 if (!me.url) {
103 throw "no url given";
104 }
105
106 me.callParent();
107 me.getStore().getProxy().setUrl(me.url);
108 },
109 });