-Ext.require([
- 'Ext.tree.*',
- 'Ext.data.*',
- 'Ext.window.MessageBox'
-]);
-
// avoid errors when running without development tools
if (!Ext.isDefined(Ext.global.console)) {
var console = {
metaData.style = 'white-space:pre-wrap;'
- return value;
+ return Ext.htmlEncode(value);
};
var render_type = function(value, metaData, record) {
var items = [];
+ var clicmdhash = {
+ GET: 'get',
+ POST: 'create',
+ PUT: 'set',
+ DELETE: 'delete'
+ };
+
Ext.Array.each(['GET', 'POST', 'PUT', 'DELETE'], function(method) {
var info = md[method];
if (info) {
+ var usage = "";
+
+ usage += "<table><tr><td>HTTP: </td><td>" + method + " /api2/json" + data.path + "</td></tr><tr><td> </td></tr>";
+ usage += "<tr><td>CLI:</td><td>pvesh " + clicmdhash[method] + " " + data.path + "</td></tr></table>";
+
var sections = [
{
title: 'Description',
- html: info.description,
+ html: Ext.htmlEncode(info.description),
+ bodyPadding: 10
+ },
+ {
+ title: 'Usage',
+ html: usage,
bodyPadding: 10
}
];
}
if (info.permissions.user) {
- if (info.permissions.user === 'world') {
- permhtml += "Accessible without any authententification.";
- } else if (info.permissions.user === 'all') {
- permhtml += "Accessible by all authententicated users.";
- } else {
- permhtml += 'Onyl accessible by user "' +
- info.permissions.user + '"';
+ if (!info.permissions.description) {
+ if (info.permissions.user === 'world') {
+ permhtml += "Accessible without any authententification.";
+ } else if (info.permissions.user === 'all') {
+ permhtml += "Accessible by all authententicated users.";
+ } else {
+ permhtml += 'Onyl accessible by user "' +
+ info.permissions.user + '"';
+ }
}
} else if (info.permissions.check) {
permhtml += "<pre>Check: " +