5
0
mirror of git://git.proxmox.com/git/pve-docs.git synced 2025-01-20 14:03:42 +03:00

api-viewer: adapt to changes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-06-02 16:19:34 +02:00
parent 37d44f8e21
commit 1f79cc8cea
3 changed files with 5 additions and 5 deletions

View File

@ -66,7 +66,7 @@ GEN_SCRIPTS= \
API_VIEWER_FILES= \ API_VIEWER_FILES= \
api-viewer/apidata.js \ api-viewer/apidata.js \
api-viewer/PVEAPI.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_SOURCES= \
api-viewer/index.html \ api-viewer/index.html \

View File

@ -1,10 +1,10 @@
var clicmdhash = { let method2cmd = {
GET: 'get', GET: 'get',
POST: 'create', POST: 'create',
PUT: 'set', PUT: 'set',
DELETE: 'delete' DELETE: 'delete'
}; };
function cliusage(method, path) { function cliUsageRenderer(method, path) {
return `<tr><td>&nbsp;</td></td><tr><td>CLI:</td><td>pvesh ${clicmdhash[method]} ${path}</td></tr></table>`; return `<tr><td>&nbsp;</td></td><tr><td>CLI:</td><td>pvesh ${method2cmd[method]} ${path}</td></tr></table>`;
} }

View File

@ -10,6 +10,6 @@ use JSON;
my $tree = PVE::RESTHandler::api_dump_remove_refs(PVE::RESTHandler::api_dump('PVE::API2')); 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); exit(0);