mirror of
git://git.proxmox.com/git/pve-docs.git
synced 2025-01-03 01:17:49 +03:00
api-viewer: adapt to changes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
37d44f8e21
commit
1f79cc8cea
2
Makefile
2
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 \
|
||||
|
@ -1,10 +1,10 @@
|
||||
var clicmdhash = {
|
||||
let method2cmd = {
|
||||
GET: 'get',
|
||||
POST: 'create',
|
||||
PUT: 'set',
|
||||
DELETE: 'delete'
|
||||
};
|
||||
|
||||
function cliusage(method, path) {
|
||||
return `<tr><td> </td></td><tr><td>CLI:</td><td>pvesh ${clicmdhash[method]} ${path}</td></tr></table>`;
|
||||
function cliUsageRenderer(method, path) {
|
||||
return `<tr><td> </td></td><tr><td>CLI:</td><td>pvesh ${method2cmd[method]} ${path}</td></tr></table>`;
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user