rune-workshop

A web ui to make runes
git clone git://jb55.com/rune-workshop
Log | Files | Refs | README

commit 1d0038aaa3c184388a9bd5847f5dd2fc963e41f7
parent d1e6dabd307b428289df113bed05064b1b6f7a94
Author: William Casarin <jb55@jb55.com>
Date:   Sun, 21 Aug 2022 11:47:00 -0700

add nodeid restrictions

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mindex.html | 2+-
Mrune-workshop.js | 24++++++++++++++++++++++++
2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/index.html b/index.html @@ -25,6 +25,6 @@ </section> </div> </body> - <script src="rune-workshop.js?v=2" ></script> + <script src="rune-workshop.js?v=3" ></script> </html> diff --git a/rune-workshop.js b/rune-workshop.js @@ -83,6 +83,23 @@ function render_time_restriction() ` } +function change_id(el) +{ + const r = STATE.restrictions = STATE.restrictions || {} + + r.id = el.value + + update_command(r) +} + +function render_id_restriction() +{ + return ` + <span class="param-name">Node ID</span> + <input style="width: 100%" type="text" onkeyup="change_id(this)" id="id-input"></input> + ` +} + function render_rate_restriction() { return ` @@ -105,6 +122,9 @@ function render_generic_restrictions_section(rpcs) return ` <h2>Restrictions</h2> <div> + ${render_id_restriction()} + </div> + <div> ${render_time_restriction()} </div> <div> @@ -302,6 +322,10 @@ function build_command(r) rs.push(restriction(`time<${r.time}`)) } + if (r.id) { + rs.push(restriction(`id=${r.id}`)) + } + const out = JSON.stringify(rs) return `lightning-cli commando-rune restrictions='${out}'`