Commit Graph

11 Commits

Author SHA1 Message Date
Aaron Lauterer
a95dbf6dea parameter and return grid: allow text selection
Making it easier for people to copy & paste parameter and retrun value
names.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2023-01-02 17:44:24 +01:00
Matthias Heiserer
28a000898f api-viewer: show min/max for values without any other format
Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
2022-11-16 20:35:22 +01:00
Matthias Heiserer
7148e22691 fix #4271: api-viewer: display nested formats instead of [object Object]
I tried to keep the format as close to the HTML docs as possible, but
there are a few discrepancies between HTML docs and how this patch
displays parameters, instead of:
- <enum>,the enum variants are displayed. [1]
- <0|1>, <boolean> is displayed.

[1] The HTML docs explain parameters after the initial format string,
which the GUI doesn't (and there's no space for that). Showing the
variants inline is the easiest way to not loose information here.

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
2022-11-16 20:35:22 +01:00
Thomas Lamprecht
f0de3268af api-viewer: ensure path starts with slash
should always be the case, but this is now an assumption, so better
to ensure it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-19 17:38:25 +02:00
Dominik Csapak
6cc360f2b4 api-viewer: drop extra slash in api path
'endpoint' already begins with a slash, so drop it after /api2/json

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-07-19 17:32:23 +02:00
Thomas Lamprecht
ac4fa7fee8 api-viewer: eslint fixes, code cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 16:08:32 +02:00
Thomas Lamprecht
5eb59676c3 api-viewer: drop unused clicmdhash
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 16:08:06 +02:00
Thomas Lamprecht
8556628c93 api viewer: rename gloabl schema variable and tell eslint about it
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 14:46:32 +02:00
Thomas Lamprecht
52428d6055 api viewer: eslint (auto) fixes + slight cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 14:43:51 +02:00
Thomas Lamprecht
2f80505306 don't shout: s/APIVIEWER/APIViewer/
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-02 14:43:13 +02:00
Dominik Csapak
4ae75df35d add api-viewer source
so that we can reuse it across products
source was 'pbs' since that had the most features (http upgrade check)

a few changes to combine pve/pbs/pmg:
* use an optional 'cliusage' function it it exists to determine CLI usage
* check allowtoken for undefined to see if it is allowed or not
* use 'pmxapi' instead of pbs/pmg/pveapi
* rename all occurrences of 'pve' to 'pmx'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-02 13:44:37 +02:00