mirror of
https://git.proxmox.com/git/pve-docs
synced 2025-06-15 01:50:10 +00:00
api-viewer: show full return info if available
if we have extended information available about what a API call returns the show it. Just stringify the items and/or properties object and put it in <pre> tags. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
8eb81ff6c3
commit
69c4b95624
@ -189,14 +189,26 @@ Ext.onReady(function() {
|
|||||||
|
|
||||||
if (info.returns) {
|
if (info.returns) {
|
||||||
|
|
||||||
var rtype = info.returns.type;
|
var retinf = info.returns;
|
||||||
if (!rtype && info.returns.items)
|
var rtype = retinf.type;
|
||||||
|
if (!rtype && retinf.items)
|
||||||
rtype = 'array';
|
rtype = 'array';
|
||||||
if (!rtype)
|
if (!rtype)
|
||||||
rtype = 'object';
|
rtype = 'object';
|
||||||
|
|
||||||
|
var returnhtml;
|
||||||
|
if (retinf.items) {
|
||||||
|
returnhtml = '<pre>items: ' + JSON.stringify(retinf.items, null, 4) + '</pre>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (retinf.properties) {
|
||||||
|
returnhtml = returnhtml || '';
|
||||||
|
returnhtml += '<pre>properties:' + JSON.stringify(retinf.properties, null, 4);
|
||||||
|
}
|
||||||
|
|
||||||
sections.push({
|
sections.push({
|
||||||
title: 'Returns: ' + rtype
|
title: 'Returns: ' + rtype,
|
||||||
|
html: returnhtml
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user