[pve-devel] applied: [PATCH docs 2/3] apiviewer: format return values as grid with optionial toggle raw

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Dec 10 14:53:57 CET 2019


On 12/10/19 2:04 PM, Tim Marx wrote:
> Signed-off-by: Tim Marx <t.marx at proxmox.com>
> ---
>  api-viewer/PVEAPI.js | 112 ++++++++++++++++++++++++++++++++++++++-----
>  1 file changed, 100 insertions(+), 12 deletions(-)
> 

applied, with the following followup:

diff --git a/api-viewer/PVEAPI.js b/api-viewer/PVEAPI.js
index dadc45b..d0da407 100644
--- a/api-viewer/PVEAPI.js
+++ b/api-viewer/PVEAPI.js
@@ -241,8 +241,7 @@ Ext.onReady(function() {
                    }
 
                    var rawSection = Ext.create('Ext.panel.Panel', {
-                       title: 'RAW ' + rtype,
-                       bodyPadding: 10,
+                       bodyPadding: '0px 10px 10px 10px',
                        html: returnhtml,
                        hidden: true
                    });
@@ -286,12 +285,13 @@ Ext.onReady(function() {
                            flex: 6
                        }
                    ],
-                   tbar: [
+                   bbar: [
                        {
                            xtype: 'button',
-                           text: 'Toggle RAW',
-                           handler: function() {
+                           text: 'Show RAW',
+                           handler: function(btn) {
                                rawSection.setVisible(!rawSection.isVisible());
+                               btn.setText(rawSection.isVisible() ? 'Hide RAW' : 'Show RAW');
                            }}
                    ]
                });




More information about the pve-devel mailing list