[pve-devel] [PATCH docs 3/3] apiviewer: add api endpoint deeplink ability

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Dec 10 14:55:29 CET 2019


On 12/10/19 2:04 PM, Tim Marx wrote:
> use #/<endpoint> to deeplink to a specific endpoint
> 
> Signed-off-by: Tim Marx <t.marx at proxmox.com>
> ---
>  api-viewer/PVEAPI.js | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/api-viewer/PVEAPI.js b/api-viewer/PVEAPI.js
> index dadc45b..bc03d88 100644
> --- a/api-viewer/PVEAPI.js
> +++ b/api-viewer/PVEAPI.js
> @@ -389,4 +389,14 @@ Ext.onReady(function() {
>  	]
>      });
>  
> +    var path = window.location.hash.substring(1);
> +    var endpoint = store.findNode('path', path);
> +
> +
> +    if (endpoint) {
> +	tree.getSelectionModel().select(endpoint);
> +	tree.expandPath(endpoint.getPath());
> +	render_docu(endpoint.data);
> +    }
> +
>  });
> 

nice, but only works on full new load of the page. Further, it would
be nice to set the url when on selects a tree-node, so that it can
be easily copied.




More information about the pve-devel mailing list