X-Git-Url: https://git.proxmox.com/?p=pve-docs.git;a=blobdiff_plain;f=api-viewer%2FPVEAPI.js;h=1c34ef2e850deca859d107e2644bf582cf42fdf5;hp=ff3cd447fde239547a2a3eb8368e0df8db937783;hb=94958b8b9230d5b9b5e2e70c481f115b18a5fa0b;hpb=356064f40dacbe57c9c662ae75ed7ec065bca7c4
diff --git a/api-viewer/PVEAPI.js b/api-viewer/PVEAPI.js
index ff3cd44..1c34ef2 100644
--- a/api-viewer/PVEAPI.js
+++ b/api-viewer/PVEAPI.js
@@ -11,8 +11,8 @@ Ext.onReady(function() {
Ext.define('pve-param-schema', {
extend: 'Ext.data.Model',
fields: [
- 'name', 'type', 'typetext', 'description', 'enum',
- 'minimum', 'maximum', 'minLength', 'maxLength',
+ 'name', 'type', 'typetext', 'description', 'verbose_description',
+ 'enum', 'minimum', 'maximum', 'minLength', 'maxLength',
'pattern', 'title', 'requires', 'format', 'default',
'disallow', 'extends', 'links',
{
@@ -42,9 +42,13 @@ Ext.onReady(function() {
}]
});
- var render_text = function(value, metaData, record) {
+ var render_description = function(value, metaData, record) {
var pdef = record.data;
+ value = pdef.verbose_description || value;
+
+ // TODO: try to render asciidoc correctly
+
metaData.style = 'white-space:pre-wrap;'
return Ext.htmlEncode(value);
@@ -62,7 +66,7 @@ Ext.onReady(function() {
metaData.style = 'white-space:normal;'
if (pdef.typetext)
- return pdef.typetext;
+ return Ext.htmlEncode(pdef.typetext);
if (pdef['enum'])
return pdef['enum'].join(' | ');
@@ -71,7 +75,7 @@ Ext.onReady(function() {
return pdef.format;
if (pdef.pattern)
- return pdef.pattern;
+ return Ext.htmlEncode(pdef.pattern);
return '';
};
@@ -137,7 +141,7 @@ Ext.onReady(function() {
var groupingFeature = Ext.create('Ext.grid.feature.Grouping',{
enableGroupingMenu: false,
- groupHeaderTpl: '
items: ' + Ext.htmlEncode(JSON.stringify(retinf.items, null, 4)) + ''; + } + + if (retinf.properties) { + returnhtml = returnhtml || ''; + returnhtml += '
properties:' + Ext.htmlEncode(JSON.stringify(retinf.properties, null, 4)); + } + sections.push({ - title: 'Returns: ' + rtype + title: 'Returns: ' + rtype, + bodyPadding: 10, + html: returnhtml }); } @@ -201,9 +225,9 @@ Ext.onReady(function() { if (info.permissions.user) { if (!info.permissions.description) { if (info.permissions.user === 'world') { - permhtml += "Accessible without any authententification."; + permhtml += "Accessible without any authentication."; } else if (info.permissions.user === 'all') { - permhtml += "Accessible by all authententicated users."; + permhtml += "Accessible by all authenticated users."; } else { permhtml += 'Onyl accessible by user "' + info.permissions.user + '"'; @@ -239,6 +263,7 @@ Ext.onReady(function() { ct.setTitle("Path: " + data.path); ct.removeAll(true); ct.add(items); + ct.setActiveTab(0); }; var tree = Ext.create('Ext.tree.Panel', {