btc-rpc-explorer/views/rpc-terminal.pug
Dan Janosik 1b3264ef3c
Massive commit for majority of v3.0:
- major visual refresh - new design, layout, fonts, colors, icons, etc
- new dark theme, now the default
- new app icon ("Bitcoin Map Marker")
- cleaner, simpler homepage content
- css for light/dark themes built from scss ("npm run css")
- theme-switcher button in footer, instead of checked items in header dropdown
- cleanup header links and dropdowns, and larger search box
- url change: /unconfirmed-tx -> /mempool-tx
- support for "estimated coin supply" used at startup or on slow devices when UTXO set unavailable
- display fee rate along with TX details on /mempool-tx
- copy-to-clipboard added for lots of longer strings
- major code reuse improvements with pug mixins
- simplify userSettings
- minor error handling improvements for /tx pages in prune/noTxIndex situations
- query fewer tx inputs on /address pages for performance
- exponents on /difficulty-history graph labels
- fixed colors of labels/gridlines on graphs (esp in dark theme)
- drop LTC config (no longer maintained)
- /admin/resetUserSettings
2021-03-31 17:45:47 -04:00

67 lines
1.7 KiB
Text

extends layout
block headContent
title RPC Terminal
block content
+pageTitle("RPC Terminal")
if (!config.demoSite && (!config.credentials.rpc || !config.credentials.rpc.rpc))
.mb-2
a.btn.btn-secondary(href="./disconnect") Disconnect from node
+dismissableInfoAlert("rpcTermPageNoteDismissed", "About RPC Terminal...")
.mb-2 This tool lets you send custom RPC commands to your node and will display the results below.
.mb-2 To browse all available RPC commands you can use the <a href="./rpc-browser">RPC Browser</a>.
div.card.shadow-sm.mb-3
div.card-body
form(id="terminal-form")
.mb-3
label(for="input-cmd") Command
input.form-control(type="text", id="input-cmd", name="cmd")
input.btn.btn-primary.w-100(type="submit", value="Send")
hr
div(id="terminal-output")
block endOfBody
script.
var csrfToken = $('meta[name=csrf-token]').attr('content');
$(document).ready(function() {
$("#terminal-form").submit(function(e) {
e.preventDefault();
var cmd = $("#input-cmd").val()
var postData = {};
postData.cmd = cmd;
postData._csrf = csrfToken;
$.post(
"./rpc-terminal",
postData,
function(response, textStatus, jqXHR) {
var t = new Date().getTime();
$("#terminal-output").prepend("<div id='output-" + t + "' class='card mb-3 shadow-sm'><div class='card-body'><h5>" + cmd + "</h5><pre><code class='json'>" + response + "</code></pre></div></div>");
console.log(response);
$("#output-" + t + " pre code").each(function(i, block) {
hljs.highlightBlock(block);
});
return false;
})
.done(function(data) {
});
return false;
});
});