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:
parent
37d44f8e21
commit
1f79cc8cea
2
Makefile
2
Makefile
@ -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 \
|
||||||
|
@ -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> </td></td><tr><td>CLI:</td><td>pvesh ${clicmdhash[method]} ${path}</td></tr></table>`;
|
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'));
|
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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user