mirror of
https://github.com/lnbits/lnbits.git
synced 2025-07-19 17:32:45 +02:00
Update app.js
This commit is contained in:
@ -105,7 +105,7 @@ function sendfundspaste() {
|
|||||||
function receive() {
|
function receive() {
|
||||||
document.getElementById('receive').innerHTML =
|
document.getElementById('receive').innerHTML =
|
||||||
"<div class='modal fade receives' tabindex='-1' role='dialog' aria-labelledby='myLargeModalLabel' aria-hidden='true'>"+
|
"<div class='modal fade receives' tabindex='-1' role='dialog' aria-labelledby='myLargeModalLabel' aria-hidden='true'>"+
|
||||||
"<div class='modal-dialog' ><div id='QRCODE'><div class='modal-content' style='padding: 0 10px 0 10px;'>"+
|
"<div class='modal-dialog' ><div id='QRCODE' ><div class='modal-content' style='padding: 0 10px 0 10px;'>"+
|
||||||
"<br/><center><input style='width:80%' type='number' class='form-control' id='amount' placeholder='Amount' max='1000000' required>" +
|
"<br/><center><input style='width:80%' type='number' class='form-control' id='amount' placeholder='Amount' max='1000000' required>" +
|
||||||
"<input style='width:80%' type='text' class='form-control' id='memo' placeholder='Memo' required></center></div>" +
|
"<input style='width:80%' type='text' class='form-control' id='memo' placeholder='Memo' required></center></div>" +
|
||||||
"<div class='modal-footer'>"+
|
"<div class='modal-footer'>"+
|
||||||
@ -416,3 +416,52 @@ if (transactions.length) {
|
|||||||
if (wallet) {
|
if (wallet) {
|
||||||
postAjax('/v1/checkpending', '', wallet.adminkey, function(data) {})
|
postAjax('/v1/checkpending', '', wallet.adminkey, function(data) {})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function download_csv(csv, filename) {
|
||||||
|
var csvFile;
|
||||||
|
var downloadLink;
|
||||||
|
|
||||||
|
// CSV FILE
|
||||||
|
csvFile = new Blob([csv], {type: "text/csv"});
|
||||||
|
|
||||||
|
// Download link
|
||||||
|
downloadLink = document.createElement("a");
|
||||||
|
|
||||||
|
// File name
|
||||||
|
downloadLink.download = filename;
|
||||||
|
|
||||||
|
// We have to create a link to the file
|
||||||
|
downloadLink.href = window.URL.createObjectURL(csvFile);
|
||||||
|
|
||||||
|
// Make sure that the link is not displayed
|
||||||
|
downloadLink.style.display = "none";
|
||||||
|
|
||||||
|
// Add the link to your DOM
|
||||||
|
document.body.appendChild(downloadLink);
|
||||||
|
|
||||||
|
// Lanzamos
|
||||||
|
downloadLink.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
function export_table_to_csv(html, filename) {
|
||||||
|
var csv = [];
|
||||||
|
var rows = document.querySelectorAll("table tr");
|
||||||
|
|
||||||
|
for (var i = 0; i < rows.length; i++) {
|
||||||
|
var row = [], cols = rows[i].querySelectorAll("td, th");
|
||||||
|
|
||||||
|
for (var j = 0; j < cols.length; j++)
|
||||||
|
row.push(cols[j].innerText);
|
||||||
|
|
||||||
|
csv.push(row.join(","));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Download CSV
|
||||||
|
download_csv(csv.join("\n"), filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
function exportbut(){
|
||||||
|
var html = document.querySelector("table").outerHTML;
|
||||||
|
export_table_to_csv(html, "table.csv");
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user