Add button to copy RPC password

This commit is contained in:
Taylor Helsper 2021-10-21 23:53:58 -05:00
parent 72cc7ab502
commit c74ebc6d91

View File

@ -7,10 +7,19 @@
<script>
$(document).ready(function() {
$( document ).tooltip();
$("#show_rpc_password").on("click", function() {
$("#show_rpc_password").hide(0);
$("#rpc_password").show();
});
$("#copy_rpc_password").on("click", function() {
navigator.clipboard.writeText("{{rpc_password}}").then(function() {
showAlertPopup("alert_popup", "<b>Password copied!</b>");
}, function() {
showAlertPopup("alert_popup", "<b>Password copy failed!</b>");
});
});
});
</script>
@ -81,7 +90,7 @@
<tr>
<th>RPC Password</th>
<td>
<p id="rpc_password" style="display: none; margin: 0;">{{rpc_password}}</p>
<p id="rpc_password" style="display: none; margin: 0;">{{rpc_password}} <span id="copy_rpc_password" class="ui-icon ui-icon-copy" style="cursor: pointer;" title="Copy Password"></span></p>
<a id="show_rpc_password" class="ui-button ui-widget ui-corner-all mynode_button_small" style="width: 70%;">show</a>
</td>
</tr>
@ -196,6 +205,8 @@
</tbody>
</table>
<div id="alert_popup" class="bottom_center_alert_popup"></div>
{% include 'includes/footer.html' %}
</body>
</html>