mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 04:05:49 +00:00
WS Tool: adjust labels on permalink, disable curl syntax for ws-only command
This commit is contained in:
@@ -162,8 +162,8 @@ Request('ledger_entry', {
|
|||||||
|
|
||||||
Request("Transaction Methods")
|
Request("Transaction Methods")
|
||||||
|
|
||||||
// TODO: maybe special case sign/sign_for so you can use those if you're
|
// Future feature: special case sign/sign_for so you can use those if you're
|
||||||
// connected to a local server?
|
// connected to a local server (with big warning)
|
||||||
|
|
||||||
Request('submit', {
|
Request('submit', {
|
||||||
description: "Submits a transaction to the network to be confirmed and included in future ledgers.",
|
description: "Submits a transaction to the network to be confirmed and included in future ledgers.",
|
||||||
@@ -278,6 +278,7 @@ Request('deposit_authorized', {
|
|||||||
Request('path_find', {
|
Request('path_find', {
|
||||||
description: "Searches for a path along which a payment can possibly be made, and periodically sends updates when the path changes over time.",
|
description: "Searches for a path along which a payment can possibly be made, and periodically sends updates when the path changes over time.",
|
||||||
link: "path_find.html",
|
link: "path_find.html",
|
||||||
|
ws_only: true,
|
||||||
body: {
|
body: {
|
||||||
"id": 8,
|
"id": 8,
|
||||||
"command": "path_find",
|
"command": "path_find",
|
||||||
|
|||||||
@@ -106,6 +106,11 @@ function select_request(request) {
|
|||||||
} else {
|
} else {
|
||||||
$(".api-method-description-wrapper .api-readmore").hide()
|
$(".api-method-description-wrapper .api-readmore").hide()
|
||||||
}
|
}
|
||||||
|
if (command.ws_only) {
|
||||||
|
$(".curl").hide()
|
||||||
|
} else {
|
||||||
|
$(".curl").show()
|
||||||
|
}
|
||||||
|
|
||||||
$(".selected_command").attr('href', command.link).text(command.name)
|
$(".selected_command").attr('href', command.link).text(command.name)
|
||||||
|
|
||||||
@@ -288,13 +293,29 @@ function load_from_permalink(params) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let req_body = params.get("req")
|
let req_body = params.get("req")
|
||||||
|
let cmd_name = ""
|
||||||
if (req_body) {
|
if (req_body) {
|
||||||
try {
|
try {
|
||||||
req_body_json = JSON.parse(req_body)
|
req_body_json = JSON.parse(req_body)
|
||||||
req_body = JSON.stringify(req_body_json, null, 2)
|
req_body = JSON.stringify(req_body_json, null, 2)
|
||||||
|
cmd_name = req_body_json.command
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.warn("Loaded request body is invalid JSON:", e)
|
console.warn("Loaded request body is invalid JSON:", e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(".selected_command").text(cmd_name)
|
||||||
|
if (requests.hasOwnProperty(slugify(cmd_name))) {
|
||||||
|
const req = requests[slugify(cmd_name)]
|
||||||
|
$(".selected_command").attr('href', req.link)
|
||||||
|
$(".api-method-description-wrapper .blurb").html(req.description)
|
||||||
|
$(".api-method-description-wrapper .api-readmore").attr("href", req.link)
|
||||||
|
$(".api-method-description-wrapper .api-readmore").show()
|
||||||
|
} else {
|
||||||
|
console.debug("Unknown command:", cmd_name)
|
||||||
|
$(".selected_command").attr('href', "")
|
||||||
|
$(".api-method-description-wrapper .blurb").empty()
|
||||||
|
$(".api-method-description-wrapper .api-readmore").hide()
|
||||||
|
}
|
||||||
cm_request.setValue(req_body)
|
cm_request.setValue(req_body)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user