api-viewer: fix path for upgraded HTTP/2 proptocls
This commit is contained in:
parent
aa30663ca5
commit
451856d21d
|
@ -106,6 +106,10 @@ Ext.onReady(function() {
|
|||
return '';
|
||||
};
|
||||
|
||||
var real_path = function(path) {
|
||||
return path.replace(/^.*\/_upgrade_(\/)?/, "/");
|
||||
};
|
||||
|
||||
var render_docu = function(data) {
|
||||
var md = data.info;
|
||||
|
||||
|
@ -126,9 +130,8 @@ Ext.onReady(function() {
|
|||
|
||||
var usage = "";
|
||||
|
||||
usage += "<table><tr><td>HTTP: </td><td>" + method + " /api2/json" + data.path + "</td></tr><tr><td> </td></tr>";
|
||||
|
||||
//usage += "<tr><td>CLI:</td><td>pvesh " + clicmdhash[method] + " " + data.path + "</td></tr></table>";
|
||||
usage += "<table><tr><td>HTTP: </td><td>"
|
||||
+ method + " " + real_path("/api2/json" + data.path) + "</td></tr>";
|
||||
|
||||
var sections = [
|
||||
{
|
||||
|
@ -378,7 +381,7 @@ Ext.onReady(function() {
|
|||
});
|
||||
|
||||
var ct = Ext.getCmp('docview');
|
||||
ct.setTitle("Path: " + data.path);
|
||||
ct.setTitle("Path: " + real_path(data.path));
|
||||
ct.removeAll(true);
|
||||
ct.add(items);
|
||||
ct.setActiveTab(0);
|
||||
|
|
|
@ -76,13 +76,13 @@ fn generate_api_tree() -> String {
|
|||
|
||||
tree.push(data);
|
||||
|
||||
let mut data = dump_api_schema(&api2::backup::BACKUP_API_ROUTER, ".");
|
||||
data["path"] = "/".into();
|
||||
let mut data = dump_api_schema(&api2::backup::BACKUP_API_ROUTER, "/backup/_upgrade_");
|
||||
data["path"] = "/backup/_upgrade_".into();
|
||||
data["text"] = "Backup API (HTTP/2)".into();
|
||||
tree.push(data);
|
||||
|
||||
let mut data = dump_api_schema(&api2::reader::READER_API_ROUTER, ".");
|
||||
data["path"] = "/".into();
|
||||
let mut data = dump_api_schema(&api2::reader::READER_API_ROUTER, "/reader/_upgrade_");
|
||||
data["path"] = "/reader/_upgrade_".into();
|
||||
data["text"] = "Restore API (HTTP/2)".into();
|
||||
tree.push(data);
|
||||
|
||||
|
|
Loading…
Reference in New Issue