Add Fully Noded QR Code for Pairing

This commit is contained in:
Taylor Helsper 2020-03-26 23:27:31 -05:00
parent 76e557029d
commit bad0634960
3 changed files with 39 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -3,6 +3,8 @@
<title>{{ title }}</title>
{% include 'includes/head.html' %}
<script src="{{ url_for('static', filename='js/qrcode.js')}}"></script>
<script>
$(document).ready(function() {
hidden=1
@ -19,6 +21,25 @@
hidden=1;
}
});
fully_noded_qr_dialog = $( "#fully-noded-qr-dialog" ).dialog({
autoOpen: false,
resizable: false,
height: "auto",
width: 600,
modal: true,
position: { my: "center top", at: "center top", of: window, collision: "none" },
});
$("#fully_noded_show_qr_button").on("click", function() {
fully_noded_qr_dialog.dialog( "open" );
});
var qrcode = new QRCode("fully_noded_qr_code", {
text: "{{ fully_noded_link }}",
width: 400,
height: 400,
correctLevel : QRCode.CorrectLevel.H
});
});
</script>
<style>
@ -92,12 +113,28 @@
<div class="app_title">Fully Noded</div>
<div class="app_status"></div>
<div class="app_contents">
<a class="ui-button ui-widget ui-corner-all mynode_button" href="{{ fully_noded_link }}" target="_blank">Connect</a>
<button id="fully_noded_show_qr_button" class="ui-button ui-widget ui-corner-all mynode_button">Show QR</button>
</div>
</div>
</div>
<div id="fully-noded-qr-dialog" title="Fully Noded QR Code" style="display:none; width: 600px;">
<p>Scan this QR code in Fully Noded to pair your myNode.</p>
<div id="fully_noded_qr_code" style="height:400px; width: 400px; margin: auto;"></div>
<br/><br/>
<center>
<span style="font-size: 8px;">{{fully_noded_link}}</span>
<br/><br/>
<a class="ui-button ui-widget ui-corner-all mynode_button" style="margin:auto;" href="{{ fully_noded_link }}" target="_blank">Link</a>
<br/>
</center>
</div>
</div>
</div>
{% include 'includes/footer.html' %}
</body>
</html>

View File

@ -42,7 +42,7 @@ def page_tor():
# App links
rpc_password = get_bitcoin_rpc_password()
fully_noded_link = "btcrpc://mynode:{}@{}:8332?label=myNode%20Tor".format(rpc_password, btc_onion_url)
fully_noded_link = "btcstandup://mynode:{}@{}:8332?label=myNode%20Tor".format(rpc_password, btc_onion_url)
# Load page
templateData = {