whitespace cleanup

Signed-off-by: Tim Marx <t.marx@proxmox.com>
This commit is contained in:
Tim Marx 2019-12-10 14:04:27 +01:00 committed by Thomas Lamprecht
parent 8c0f75259d
commit 87ec83f4b8

View File

@ -1,8 +1,8 @@
// avoid errors when running without development tools // avoid errors when running without development tools
if (!Ext.isDefined(Ext.global.console)) { if (!Ext.isDefined(Ext.global.console)) {
var console = { var console = {
dir: function() {}, dir: function() {},
log: function() {} log: function() {}
}; };
} }
@ -10,7 +10,7 @@ Ext.onReady(function() {
Ext.define('pve-param-schema', { Ext.define('pve-param-schema', {
extend: 'Ext.data.Model', extend: 'Ext.data.Model',
fields: [ fields: [
'name', 'type', 'typetext', 'description', 'verbose_description', 'name', 'type', 'typetext', 'description', 'verbose_description',
'enum', 'minimum', 'maximum', 'minLength', 'maxLength', 'enum', 'minimum', 'maximum', 'minLength', 'maxLength',
'pattern', 'title', 'requires', 'format', 'default', 'pattern', 'title', 'requires', 'format', 'default',
@ -25,7 +25,7 @@ Ext.onReady(function() {
var store = Ext.create('Ext.data.TreeStore', { var store = Ext.create('Ext.data.TreeStore', {
model: Ext.define('pve-api-doc', { model: Ext.define('pve-api-doc', {
extend: 'Ext.data.Model', extend: 'Ext.data.Model',
fields: [ fields: [
'path', 'info', 'text', 'path', 'info', 'text',
] ]
}), }),
@ -41,7 +41,7 @@ Ext.onReady(function() {
direction: 'ASC' direction: 'ASC'
}] }]
}); });
var render_description = function(value, metaData, record) { var render_description = function(value, metaData, record) {
var pdef = record.data; var pdef = record.data;
@ -71,10 +71,10 @@ Ext.onReady(function() {
if (pdef['enum']) if (pdef['enum'])
return pdef['enum'].join(' | '); return pdef['enum'].join(' | ');
if (pdef.format) if (pdef.format)
return pdef.format; return pdef.format;
if (pdef.pattern) if (pdef.pattern)
return Ext.htmlEncode(pdef.pattern); return Ext.htmlEncode(pdef.pattern);
return ''; return '';
@ -196,21 +196,21 @@ Ext.onReady(function() {
if (!rtype) if (!rtype)
rtype = 'object'; rtype = 'object';
var returnhtml; var returnhtml;
if (retinf.items) { if (retinf.items) {
returnhtml = '<pre>items: ' + Ext.htmlEncode(JSON.stringify(retinf.items, null, 4)) + '</pre>'; returnhtml = '<pre>items: ' + Ext.htmlEncode(JSON.stringify(retinf.items, null, 4)) + '</pre>';
} }
if (retinf.properties) { if (retinf.properties) {
returnhtml = returnhtml || ''; returnhtml = returnhtml || '';
returnhtml += '<pre>properties:' + Ext.htmlEncode(JSON.stringify(retinf.properties, null, 4)) + '</pre>'; returnhtml += '<pre>properties:' + Ext.htmlEncode(JSON.stringify(retinf.properties, null, 4)) + '</pre>';
} }
sections.push({ sections.push({
title: 'Returns: ' + rtype, title: 'Returns: ' + rtype,
bodyPadding: 10, bodyPadding: 10,
html: returnhtml html: returnhtml
}); });
} }
var permhtml = ''; var permhtml = '';
@ -229,12 +229,12 @@ Ext.onReady(function() {
} else if (info.permissions.user === 'all') { } else if (info.permissions.user === 'all') {
permhtml += "Accessible by all authenticated users."; permhtml += "Accessible by all authenticated users.";
} else { } else {
permhtml += 'Onyl accessible by user "' + permhtml += 'Onyl accessible by user "' +
info.permissions.user + '"'; info.permissions.user + '"';
} }
} }
} else if (info.permissions.check) { } else if (info.permissions.check) {
permhtml += "<pre>Check: " + permhtml += "<pre>Check: " +
Ext.htmlEncode(Ext.JSON.encode(info.permissions.check)) + "</pre>"; Ext.htmlEncode(Ext.JSON.encode(info.permissions.check)) + "</pre>";
} else { } else {
permhtml += "Unknown systax!"; permhtml += "Unknown systax!";
@ -246,8 +246,8 @@ Ext.onReady(function() {
bodyPadding: 10, bodyPadding: 10,
html: permhtml html: permhtml
}); });
items.push({ items.push({
title: method, title: method,
autoScroll: true, autoScroll: true,