public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Shannon Sterz" <s.sterz@proxmox.com>
To: "Thomas Lamprecht" <t.lamprecht@proxmox.com>
Cc: Proxmox Datacenter Manager development discussion
	<pdm-devel@lists.proxmox.com>,
	Thomas Lamprecht <t.lamprecht@proxmox.com>
Subject: Re: [pdm-devel] [PATCH widget-toolkit v5 1/1] api viewer: add support for endpoints that are marked as unstable
Date: Mon, 01 Dec 2025 17:36:33 +0100	[thread overview]
Message-ID: <DEN0Z1GJGQ8K.14AXOQCFXWR7J@proxmox.com> (raw)
In-Reply-To: <cffa8165-5f4b-48c3-a570-288ebbbc5046@proxmox.com>

On Mon Dec 1, 2025 at 5:26 PM CET, Thomas Lamprecht wrote:
> Am 01.12.25 um 11:28 schrieb Shannon Sterz:
>> display a warning when an endpoint is marked as unstable.
>>
>> Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
>> Tested-by: Lukas Wagner <l.wagner@proxmox.com>
>> Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
>> ---
>>  src/api-viewer/APIViewer.js | 18 ++++++++++++++++--
>>  1 file changed, 16 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/api-viewer/APIViewer.js b/src/api-viewer/APIViewer.js
>> index 7f27e0d..1357741 100644
>> --- a/src/api-viewer/APIViewer.js
>> +++ b/src/api-viewer/APIViewer.js
>> @@ -210,7 +210,21 @@ Ext.onReady(function () {
>>                      usage += cliUsageRenderer(method, endpoint);
>>                  }
>>
>> -                let sections = [
>> +                let sections = [];
>> +
>> +                if (info.unstable) {
>> +                    sections.push({
>> +                        title: 'Unstable',
>> +                        html: `<div class="proxmox-warning-row" style="padding: 10px;">
>> +                                <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
>> +                                This API endpoint is marked as unstable. All information on this
>> +                                page is subject to change, including input parameters, return values
>> +                                and permissions.
>> +                            </div>`,
>> +                    });
>> +                }
>> +
>> +                sections.concat([
>
> The concat [0] array method always returns a new array, so with your change
> fully rolled out (installing this and then, e.g., rebuilding pve-docs with it)
> the Description and Usage section vanished. I simply switched this out with doing
> an sections.push, which modifies sections itself.
>
> [0]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat

ah sorry missed that somehow, thanks for catching this.

>>                      {
>>                          title: 'Description',
>>                          html: Ext.htmlEncode(info.description),
>> @@ -221,7 +235,7 @@ Ext.onReady(function () {
>>                          html: usage,
>>                          bodyPadding: 10,
>>                      },
>> -                ];
>> +                ]);
>>
>>                  if (info.parameters && info.parameters.properties) {
>>                      let pstore = Ext.create('Ext.data.Store', {
>> --
>> 2.47.3



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


  reply	other threads:[~2025-12-01 16:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 10:28 [pdm-devel] [PATCH datacenter-manager/proxmox{, -backup}/widget-toolkit v5 0/9] unstable flag and pdm api viewer Shannon Sterz
2025-12-01 10:28 ` [pdm-devel] [PATCH proxmox v5 1/5] router/api-macro: add unstable flag for ApiMethod Shannon Sterz
2025-12-01 16:33   ` [pdm-devel] applied: " Thomas Lamprecht
2025-12-01 10:28 ` [pdm-devel] [PATCH proxmox v5 2/5] pve-api-types: generate array objects Shannon Sterz
2025-12-01 16:33   ` [pdm-devel] applied: " Thomas Lamprecht
2025-12-01 10:28 ` [pdm-devel] [PATCH proxmox v5 3/5] pve-api-types: fix clippy lints Shannon Sterz
2025-12-01 16:34   ` [pdm-devel] applied: " Thomas Lamprecht
2025-12-01 10:28 ` [pdm-devel] [PATCH proxmox v5 4/5] docgen: add docgen crate Shannon Sterz
2025-12-01 16:34   ` [pdm-devel] applied: " Thomas Lamprecht
2025-12-01 10:28 ` [pdm-devel] [PATCH proxmox v5 5/5] docgen: add support for the new unstable flag Shannon Sterz
2025-12-01 16:34   ` [pdm-devel] applied: " Thomas Lamprecht
2025-12-01 10:28 ` [pdm-devel] [PATCH widget-toolkit v5 1/1] api viewer: add support for endpoints that are marked as unstable Shannon Sterz
2025-12-01 16:26   ` Thomas Lamprecht
2025-12-01 16:36     ` Shannon Sterz [this message]
2025-12-05 15:34   ` [pdm-devel] applied: " Thomas Lamprecht
2025-12-01 10:28 ` [pdm-devel] [PATCH proxmox-backup v5 1/1] docgen: use proxmox-rs docgen crate Shannon Sterz
2025-12-01 10:28 ` [pdm-devel] [PATCH datacenter-manager v5 1/2] docgen: switch to " Shannon Sterz
2025-12-01 19:31   ` [pdm-devel] applied: " Thomas Lamprecht
2025-12-01 10:28 ` [pdm-devel] [PATCH datacenter-manager v5 2/2] api-viewer: add an api-viewer package Shannon Sterz
2025-12-01 19:31   ` [pdm-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DEN0Z1GJGQ8K.14AXOQCFXWR7J@proxmox.com \
    --to=s.sterz@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal