From 42e59b2544e35111086ba46eca4cf706110ec253 Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Sat, 8 May 2021 21:37:45 -0500 Subject: [PATCH] Add ability to pin open lightning details --- rootfs/standard/var/www/mynode/api.py | 20 ++++++++++++++ rootfs/standard/var/www/mynode/device_info.py | 8 ++++++ .../var/www/mynode/static/css/mynode.css | 7 +++++ .../var/www/mynode/static/images/pin.png | Bin 0 -> 5596 bytes .../var/www/mynode/static/images/unpin.png | Bin 0 -> 7833 bytes .../mynode/templates/includes/services.html | 25 ++++++------------ .../var/www/mynode/templates/main.html | 18 ++++++++++++- 7 files changed, 60 insertions(+), 18 deletions(-) create mode 100644 rootfs/standard/var/www/mynode/static/images/pin.png create mode 100644 rootfs/standard/var/www/mynode/static/images/unpin.png diff --git a/rootfs/standard/var/www/mynode/api.py b/rootfs/standard/var/www/mynode/api.py index 9bf69024..9d3dcbb9 100644 --- a/rootfs/standard/var/www/mynode/api.py +++ b/rootfs/standard/var/www/mynode/api.py @@ -146,4 +146,24 @@ def api_get_message(): data = {} data["message"] = get_message(funny) + return jsonify(data) + +@mynode_api.route("/api/toggle_setting") +def api_toggle_setting(): + check_logged_in() + + data = {} + data["status"] = "unknown" + + if not request.args.get("setting"): + data["status"] = "no_setting_specified" + return jsonify(data) + + setting = request.args.get("setting") + if setting == "pinned_lightning_details": + toggle_pinned_lightning_details() + data["status"] = "success" + else: + data["status"] = "unknown_setting" + return jsonify(data) \ No newline at end of file diff --git a/rootfs/standard/var/www/mynode/device_info.py b/rootfs/standard/var/www/mynode/device_info.py index 8b6bd7bd..415e5c44 100644 --- a/rootfs/standard/var/www/mynode/device_info.py +++ b/rootfs/standard/var/www/mynode/device_info.py @@ -471,6 +471,14 @@ def toggle_darkmode(): else: enable_darkmode() +def toggle_pinned_lightning_details(): + ui_settings = read_ui_settings() + if "pinned_lightning_details" not in ui_settings or ui_settings["pinned_lightning_details"] == False: + ui_settings["pinned_lightning_details"] = True + else: + ui_settings["pinned_lightning_details"] = False + write_ui_settings(ui_settings) + def set_background(background): ui_settings = read_ui_settings() ui_settings['background'] = background diff --git a/rootfs/standard/var/www/mynode/static/css/mynode.css b/rootfs/standard/var/www/mynode/static/css/mynode.css index 92f456ad..90a245eb 100644 --- a/rootfs/standard/var/www/mynode/static/css/mynode.css +++ b/rootfs/standard/var/www/mynode/static/css/mynode.css @@ -310,6 +310,13 @@ td, th { .lightning_channel_container { width: 1000px; } +.lightning_pin_details_icon { + width: 26px; + position: absolute; + top: 5px; + right: 5px; + cursor: pointer; +} .lightning_channel_top_row { margin-bottom: 3px; height: 25px; diff --git a/rootfs/standard/var/www/mynode/static/images/pin.png b/rootfs/standard/var/www/mynode/static/images/pin.png new file mode 100644 index 0000000000000000000000000000000000000000..115a0e2902187a1d52baa5dd9db5f594c3d372cd GIT binary patch literal 5596 zcmeHLc~}$I77r+khzcqeTZ?1B1$DAa_I!yz03iE^LV&#Mg&QC7JaY8GDXY%4ieq+Gu*CQ=Z4{kKZDgKs&0n*Z6&OW*T) z6<-9k#5<&pWJTO+A7zcs72`` zrbzC5t_g}3IyO1$qw}VYuR3tIapuI+!@ep`4Qc%O*sh3kr%oa>!gh(){Jvz?dnK-= zjD^^32kG~>WjUqiCY+phUbJS^{%r2z`7JI{zx|SSxjb1CSxrxL-ylzQt&Olh^83bL z_Fi;lw5GF9$ZSrS6%(4a-cn@DBZ+Qq2{>-OeAb04w`M|nX4P!8*`oIHSX#g+R=8DL z!>)VcGu1wqL#)=?8)oH9vHAf1WX4p{oI}o2HjbWSBRW4e+0Htw)t1Uz=W()fV`bBm zZ{suY)~XGRkn%HDwQzsV?`zu^+OF z-W$WZQdc6b;#~?mavLtL+w1;W%7cdR;&x#-vT2F$+)4bpL)YCi_49V=7WYVdbKh>> z(@AF8HTaLp%Wn3Fcbm@N_JM1Fb>jBnn=T5rsYB@ct#_v#ff-BFkn;KwUtIFAO+7sB ze*XIA$@(!(q7BbZWoU1Ga=6=`=CUtDk(?mA&Vv6p|Vo`#k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Q7?mB($i2JW)$Rf%c3%XhQ+a)f z8213p;59@Ha^^X;rcUa+l-W0;MDJE3Pq(7E2&g_cV6*d5w5%ftK2b{fCE7y$Qa1|f)TX!y3WRO1~ z&3SLj;rZ`g=cgC~3MqH)mfg6YG`H;Rq_RiB=q$Zc0A1cTIqPXVf;e6II5^;7N#wpf zre`7}S<#)!QpUpjY@Z8NY2QzYyqOX-bk#6QLu|%%qP^c=X7FqKS(flrKMMHH&1#H# zRl$cWu^j1d@zECafyfI4=cVFBR+-5#+983i??vk@>ONPD=)-A{K&immqI)f8?-gCX z9gzkfPj(6Jmz`MiJ~G!Z!Lsiy^90CjRoZodCPLEKUghB_yok}h%|mJDX?S@< z>|oExO81MoD=kv^s4x4!9q=b!5_$h(fN3)Mq{FIztz z+usUFZ4>EK>iqF=X5%&UmSY-Fv{!Gapr;kVIkmKWz{~!#x5`2F$Hfx&vlPPful6GL z>}P1H0G>OvugPH%eMnKu`uvF8v8n@|!i#10v)WLiPwtK5bUV^Mr+fjo1BjW4rSVlm H_k;fe%lM<; literal 0 HcmV?d00001 diff --git a/rootfs/standard/var/www/mynode/templates/includes/services.html b/rootfs/standard/var/www/mynode/templates/includes/services.html index 41a6044d..3ac6f16d 100644 --- a/rootfs/standard/var/www/mynode/templates/includes/services.html +++ b/rootfs/standard/var/www/mynode/templates/includes/services.html @@ -93,7 +93,7 @@
{% if lnd_wallet_exists and lnd_ready %} - + {% endif %} @@ -166,24 +166,16 @@