]> git.proxmox.com Git - pve-docs.git/commitdiff
api-viewer: adapt to changes
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 2 Jun 2021 14:19:34 +0000 (16:19 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 2 Jun 2021 14:19:34 +0000 (16:19 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Makefile
api-viewer/PVEAPI.js
extractapi.pl

index 552bbd83b9dc7824c3358afc6b9d9f9da6fd8785..1f24e1509b945f240255d40ef4ed319c9fff5508 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -66,7 +66,7 @@ GEN_SCRIPTS=                                  \
 API_VIEWER_FILES=                                                      \
        api-viewer/apidata.js                                           \
        api-viewer/PVEAPI.js                                            \
-       /usr/share/javascript/proxmox-widget-toolkit-dev/APIVIEWER.js
+       /usr/share/javascript/proxmox-widget-toolkit-dev/APIViewer.js
 
 API_VIEWER_SOURCES=                            \
        api-viewer/index.html                   \
index ae458840126e8b912a0cf91d4dd917ffd50ed9d6..75d486da320d66c5d358fb9e1f78d9c3956da559 100644 (file)
@@ -1,10 +1,10 @@
-var clicmdhash = {
+let method2cmd = {
     GET: 'get',
     POST: 'create',
     PUT: 'set',
     DELETE: 'delete'
 };
 
-function cliusage(method, path) {
-    return `<tr><td>&nbsp;</td></td><tr><td>CLI:</td><td>pvesh ${clicmdhash[method]} ${path}</td></tr></table>`;
+function cliUsageRenderer(method, path) {
+    return `<tr><td>&nbsp;</td></td><tr><td>CLI:</td><td>pvesh ${method2cmd[method]} ${path}</td></tr></table>`;
 }
index 4d3f14350661fa3cc8bfbddb3db61928fe5c8ad6..2144f17b95de4e1fc0a73445eb7877ea13b406a0 100755 (executable)
@@ -10,6 +10,6 @@ use JSON;
 
 my $tree = PVE::RESTHandler::api_dump_remove_refs(PVE::RESTHandler::api_dump('PVE::API2'));
 
-print "var pmxapi = " . to_json($tree, {pretty => 1, canonical => 1}) . ";\n\n";
+print "const apiSchema = " . to_json($tree, {pretty => 1, canonical => 1}) . ";\n\n";
 
 exit(0);