From 1f79cc8ceabd3beab543072e03be2d85a23883f1 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 2 Jun 2021 16:19:34 +0200 Subject: [PATCH] api-viewer: adapt to changes Signed-off-by: Thomas Lamprecht --- Makefile | 2 +- api-viewer/PVEAPI.js | 6 +++--- extractapi.pl | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 552bbd8..1f24e15 100644 --- 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 \ diff --git a/api-viewer/PVEAPI.js b/api-viewer/PVEAPI.js index ae45884..75d486d 100644 --- a/api-viewer/PVEAPI.js +++ b/api-viewer/PVEAPI.js @@ -1,10 +1,10 @@ -var clicmdhash = { +let method2cmd = { GET: 'get', POST: 'create', PUT: 'set', DELETE: 'delete' }; -function cliusage(method, path) { - return ` CLI:pvesh ${clicmdhash[method]} ${path}`; +function cliUsageRenderer(method, path) { + return ` CLI:pvesh ${method2cmd[method]} ${path}`; } diff --git a/extractapi.pl b/extractapi.pl index 4d3f143..2144f17 100755 --- a/extractapi.pl +++ b/extractapi.pl @@ -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); -- 2.39.2