for parameters only for now, also only implement the basic use case we
want to have currently: use in section config apis where we have more
than one type.
we could improve upon that, e.g. by properly grouping the type relevant
options, and also implementing that for return types.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
'name', 'type', 'typetext', 'description', 'verbose_description',
'enum', 'minimum', 'maximum', 'minLength', 'maxLength',
'pattern', 'title', 'requires', 'format', 'default',
'name', 'type', 'typetext', 'description', 'verbose_description',
'enum', 'minimum', 'maximum', 'minLength', 'maxLength',
'pattern', 'title', 'requires', 'format', 'default',
- 'disallow', 'extends', 'links',
+ 'disallow', 'extends', 'links', 'instance-types',
{
name: 'optional',
type: 'boolean',
{
name: 'optional',
type: 'boolean',
},
groupField: 'optional',
sorters: [
},
groupField: 'optional',
sorters: [
+ {
+ property: 'instance-types',
+ direction: 'ASC',
+ },
{
property: 'name',
direction: 'ASC',
{
property: 'name',
direction: 'ASC',
+ let has_type_properties = false;
+
Ext.Object.each(info.parameters.properties, function(name, pdef) {
Ext.Object.each(info.parameters.properties, function(name, pdef) {
- pdef.name = name;
- pstore.add(pdef);
+ if (pdef.oneOf) {
+ pdef.oneOf.forEach((alternative) => {
+ alternative.name = name;
+ pstore.add(alternative);
+ has_type_properties = true;
+ });
+ } else if (pdef['instance-types']) {
+ pdef['instance-types'].forEach((type) => {
+ let typePdef = Ext.apply({}, pdef);
+ typePdef.name = name;
+ typePdef['instance-types'] = [type];
+ pstore.add(typePdef);
+ has_type_properties = true;
+ });
+ } else {
+ pdef.name = name;
+ pstore.add(pdef);
+ }
renderer: render_type,
flex: 1,
},
renderer: render_type,
flex: 1,
},
+ {
+ header: 'For Types',
+ dataIndex: 'instance-types',
+ hidden: !has_type_properties,
+ flex: 1,
+ },
{
header: 'Default',
dataIndex: 'default',
{
header: 'Default',
dataIndex: 'default',