mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-15 12:20:21 +01:00
Added templates for lnfaucet extension
Ideally, these need to be moved to the lnfaucet template
This commit is contained in:
parent
33d6f3080a
commit
aef01e2566
5 changed files with 1383 additions and 0 deletions
345
lnbits/templates/displaywithdraw.html
Normal file
345
lnbits/templates/displaywithdraw.html
Normal file
|
@ -0,0 +1,345 @@
|
|||
<!-- @format -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>LNBits Wallet</title>
|
||||
<meta
|
||||
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
|
||||
name="viewport"
|
||||
/>
|
||||
<!-- Bootstrap 3.3.2 -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='bootstrap/css/bootstrap.min.css') }}"
|
||||
/>
|
||||
<!-- FontAwesome 4.3.0 -->
|
||||
<link
|
||||
href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<!-- Ionicons 2.0.0 -->
|
||||
<link
|
||||
href="http://code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
|
||||
<!-- Theme style -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='dist/css/AdminLTE.min.css') }}"
|
||||
/>
|
||||
<!-- AdminLTE Skins. Choose a skin from the css/skins
|
||||
folder instead of downloading all of them to reduce the load. -->
|
||||
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='dist/css/skins/_all-skins.min.css') }}"
|
||||
/>
|
||||
|
||||
<!-- iCheck -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='plugins/iCheck/flat/blue.css') }}"
|
||||
/>
|
||||
|
||||
<!-- Morris chart -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='plugins/morris/morris.css') }}"
|
||||
/>
|
||||
|
||||
<!-- jvectormap -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='plugins/jvectormap/jquery-jvectormap-1.2.2.css') }}"
|
||||
/>
|
||||
|
||||
<!-- Date Picker -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='plugins/datepicker/datepicker3.css') }}"
|
||||
/>
|
||||
|
||||
<!-- Daterange picker -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='plugins/daterangepicker/daterangepicker-bs3.css') }}"
|
||||
/>
|
||||
|
||||
<!-- bootstrap wysihtml5 - text editor -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') }}"
|
||||
/>
|
||||
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<style>
|
||||
.small-box > .small-box-footer {
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
#loadingMessage {
|
||||
text-align: center;
|
||||
padding: 40px;
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
#canvas {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#output {
|
||||
margin-top: 20px;
|
||||
background: #eee;
|
||||
padding: 10px;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
#output div {
|
||||
padding-bottom: 10px;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
#noQRFound {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- jQuery 2.1.3 -->
|
||||
<script src="{{ url_for('static', filename='plugins/jQuery/jQuery-2.1.3.min.js') }}"></script>
|
||||
<!-- jQuery UI 1.11.2 -->
|
||||
<script
|
||||
src="http://code.jquery.com/ui/1.11.2/jquery-ui.min.js"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
|
||||
<script>
|
||||
$.widget.bridge('uibutton', $.ui.button)
|
||||
</script>
|
||||
<!-- Bootstrap 3.3.2 JS -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='bootstrap/js/bootstrap.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- Morris.js charts -->
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/morris/morris.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- Sparkline -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/sparkline/jquery.sparkline.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- jvectormap -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/jvectormap/jquery-jvectormap-1.2.2.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/jvectormap/jquery-jvectormap-world-mill-en.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- jQuery Knob Chart -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/knob/jquery.knob.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- daterangepicker -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/daterangepicker/daterangepicker.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- datepicker -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/datepicker/bootstrap-datepicker.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- Bootstrap WYSIHTML5 -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- iCheck -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/iCheck/icheck.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- Slimscroll -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/slimScroll/jquery.slimscroll.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- FastClick -->
|
||||
<script src="{{ url_for('static', filename='plugins/fastclick/fastclick.min.js') }}"></script>
|
||||
<!-- AdminLTE App -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='dist/js/app.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
|
||||
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='dist/js/pages/dashboard.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
|
||||
<!-- AdminLTE for demo purposes -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='dist/js/demo.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/datatables/jquery.dataTables.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css"
|
||||
/>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script>
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/jscam/JS.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/jscam/qrcode.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/bolt11/decoder.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/bolt11/utils.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
</head>
|
||||
<body class="skin-blue layout-boxed sidebar-collapse sidebar-open">
|
||||
<div class="wrapper">
|
||||
<header class="main-header">
|
||||
<!-- Logo -->
|
||||
<a href="/" class="logo"><b>LN</b>bits</a>
|
||||
<!-- Header Navbar: style can be found in header.less -->
|
||||
<nav class="navbar navbar-static-top" role="navigation">
|
||||
<!-- Sidebar toggle button-->
|
||||
<a
|
||||
href="#"
|
||||
class="sidebar-toggle"
|
||||
data-toggle="offcanvas"
|
||||
role="button"
|
||||
>
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</a>
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<!-- Messages: style can be found in dropdown.less-->
|
||||
<li class="dropdown messages-menu">
|
||||
{% block messages %}{% endblock %}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<!-- Right side column. Contains the navbar and content of the page -->
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
LNURL Withdraw Link
|
||||
<small>Use LNURL compatible bitcoin wallet</small>
|
||||
</h1>
|
||||
|
||||
</section>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">><br/><br/>
|
||||
<center><h1 style="font-size:500%">Withdraw Link: {{ user_fau[0][6] }}</h1></center>
|
||||
|
||||
<center><br/><br/> <div id="qrcode"></div><br/><br/>
|
||||
<div style="width:55%;word-wrap: break-word;" id="qrcodetxt"></div> <br/></center>
|
||||
|
||||
</section><!-- /.content -->
|
||||
</div><!-- /.content-wrapper -->
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
function getAjax(url, thekey, success) {
|
||||
var xhr = window.XMLHttpRequest
|
||||
? new XMLHttpRequest()
|
||||
: new ActiveXObject('Microsoft.XMLHTTP')
|
||||
xhr.open('GET', url, true)
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState > 3 && xhr.status == 200) {
|
||||
success(xhr.responseText)
|
||||
}
|
||||
}
|
||||
xhr.setRequestHeader('Grpc-Metadata-macaroon', thekey)
|
||||
xhr.setRequestHeader('Content-Type', 'application/json')
|
||||
|
||||
xhr.send()
|
||||
return xhr
|
||||
}
|
||||
|
||||
|
||||
function drawwithdraw(data) {
|
||||
|
||||
|
||||
console.log(data)
|
||||
|
||||
|
||||
getAjax('/v1/lnurlencode/'+ window.location.hostname + "/" + data, "filla", function(datab) {
|
||||
if (JSON.parse(datab).STATUS == 'TRUE') {
|
||||
console.log(JSON.parse(datab).STATUS)
|
||||
lnurlfau = (JSON.parse(datab).LNURL)
|
||||
|
||||
|
||||
new QRCode(document.getElementById('qrcode'), {
|
||||
text: lnurlfau,
|
||||
width: 300,
|
||||
height: 300,
|
||||
colorDark: '#000000',
|
||||
colorLight: '#ffffff',
|
||||
correctLevel: QRCode.CorrectLevel.M
|
||||
})
|
||||
document.getElementById('qrcodetxt').innerHTML = lnurlfau + "<br/><br/>"
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
data = "Failed to build LNURL"
|
||||
}
|
||||
})
|
||||
}
|
||||
drawwithdraw("{{ user_fau[0][5] }}")
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</html>
|
254
lnbits/templates/extensions.html
Normal file
254
lnbits/templates/extensions.html
Normal file
|
@ -0,0 +1,254 @@
|
|||
<!-- @format -->
|
||||
|
||||
{% extends "base.html" %} {% block messages %}
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-bell-o"></i>
|
||||
<span class="label label-danger">!</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="header"><b>Instant wallet, bookmark to save</b></li>
|
||||
<li></li>
|
||||
</ul>
|
||||
{% endblock %} {% block menuitems %}
|
||||
<li class="treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-bitcoin"></i> <span>Wallets</span>
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
{% for w in user_wallets %}
|
||||
<li>
|
||||
<a href="wallet?wal={{ w.id }}&usr={{ w.user }}"
|
||||
><i class="fa fa-bolt"></i> {{ w.name }}</a
|
||||
>
|
||||
</li>
|
||||
{% endfor %}
|
||||
<li><a onclick="sidebarmake()">Add a wallet +</a></li>
|
||||
<div id="sidebarmake"></div>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="active treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-th"></i> <span>Extensions</span>
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
|
||||
|
||||
{% if user_ext[0][1] %}
|
||||
<li>
|
||||
<a href="lnevents?usr={{ user_ext[0][0]}}"
|
||||
><i class="fa fa-plus"></i> LNEvents</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if user_ext[0][2] %}
|
||||
<li>
|
||||
<a href="lnjoust?usr={{ user_ext[0][0]}}"
|
||||
><i class="fa fa-plus"></i> LNJoust</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if user_ext[0][3] %}
|
||||
<li>
|
||||
<a href="withdraw?usr={{ user_ext[0][0]}}"
|
||||
><i class="fa fa-plus"></i> LNURLw</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li>
|
||||
<a href="extensions?usr={{ user }}"
|
||||
>Manager </a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
{% endblock %} {% block body %}
|
||||
<!-- Right side column. Contains the navbar and content of the page -->
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
Wallet
|
||||
<small
|
||||
>Control panel
|
||||
<div id="wonga"></div
|
||||
></small>
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li>
|
||||
<a href="#"><i class="fa fa-dashboard"></i> Home</a>
|
||||
</li>
|
||||
<li class="active">Extensions</li>
|
||||
|
||||
</ol>
|
||||
<br /><br />
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<h4>
|
||||
Bookmark to save your wallet. Wallet is in BETA, use with caution.
|
||||
</h4>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<!-- Small boxes (Stat box) -->
|
||||
<div class="row">
|
||||
|
||||
{% if not user_ext[0][2] %}
|
||||
<div class="col-lg-3 col-xs-6">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-green">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
LNJoust
|
||||
</h3>
|
||||
<p>
|
||||
LN powered Joust gamesmaster
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-wand"></i>
|
||||
</div>
|
||||
|
||||
<a href="extensions?usr={{user}}&lnjoust=1" class="small-box-footer">
|
||||
Activate <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
|
||||
{% else %}
|
||||
<div class="col-lg-3 col-xs-6">
|
||||
<!-- small box -->
|
||||
|
||||
<div class="small-box bg-green">
|
||||
<div class="inner">
|
||||
<a href="lnjoust?usr={{user}}" style="color: inherit;">
|
||||
<h3>
|
||||
LNJoust
|
||||
</h3>
|
||||
<p>
|
||||
LN powered Joust gamesmaster
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-wand"></i>
|
||||
</div>
|
||||
</a>
|
||||
<a href="extensions?usr={{user}}&lnjoust=0" class="small-box-footer">
|
||||
Deactivate <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
{% endif %}
|
||||
{% if not user_ext[0][1] %}
|
||||
<div class="col-lg-3 col-xs-6">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-yellow">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
LNEvents
|
||||
</h3>
|
||||
<p>
|
||||
Lightning powered tickets
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-calendar"></i>
|
||||
</div>
|
||||
<a href="extensions?usr={{user}}&lnevents=1" class="small-box-footer">
|
||||
Activate <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
|
||||
{% else %}
|
||||
<div class="col-lg-3 col-xs-6">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-yellow">
|
||||
<div class="inner">
|
||||
<a href="lnevents?usr={{user}}" style="color: inherit;">
|
||||
<h3>
|
||||
LNEvents
|
||||
</h3>
|
||||
<p>
|
||||
Lightning powered tickets
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-calendar"></i>
|
||||
</div>
|
||||
</a>
|
||||
<a href="extensions?usr={{user}}&lnevents=0" class="small-box-footer">
|
||||
Deactivate <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
{% endif %}
|
||||
{% if not user_ext[0][3] %}
|
||||
<div class="col-lg-3 col-xs-6">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-red">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
LNURLw
|
||||
</h3>
|
||||
<p>
|
||||
Make LNURL withdraw links
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-beer"></i>
|
||||
</div>
|
||||
<a href="extensions?usr={{user}}&withdraw=1" class="small-box-footer">
|
||||
Activate <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
{% else %}
|
||||
|
||||
<div class="col-lg-3 col-xs-6">
|
||||
<!-- small box -->
|
||||
|
||||
<div class="small-box bg-red">
|
||||
|
||||
<div class="inner">
|
||||
<a href="withdraw?usr={{user}}" style="color: inherit;">
|
||||
<h3>
|
||||
LNURLw
|
||||
</h3>
|
||||
<p>
|
||||
Make LNURL withdraw links
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="icon">
|
||||
|
||||
<i class="ion ion-beer"></i>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<a href="extensions?usr={{user}}&withdraw=0" class="small-box-footer">
|
||||
Deactivate <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div><!-- ./col -->
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- /.content -->
|
||||
</section>
|
||||
|
||||
<script>
|
||||
window.user = {{ user | megajson | safe }}
|
||||
window.user_wallets = {{ user_wallets | megajson | safe }}
|
||||
window.user_ext = {{ user_ext | megajson | safe }}
|
||||
|
||||
</script>
|
||||
</div>
|
||||
{% endblock %}
|
BIN
lnbits/templates/note.jpg
Normal file
BIN
lnbits/templates/note.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 79 KiB |
327
lnbits/templates/printwithdraws.html
Normal file
327
lnbits/templates/printwithdraws.html
Normal file
|
@ -0,0 +1,327 @@
|
|||
<!DOCTYPE html>
|
||||
<html style="background-color:grey;">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>LNBits Wallet</title>
|
||||
<meta
|
||||
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
|
||||
name="viewport"
|
||||
/>
|
||||
<!-- Bootstrap 3.3.2 -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='bootstrap/css/bootstrap.min.css') }}"
|
||||
/>
|
||||
<!-- FontAwesome 4.3.0 -->
|
||||
<link
|
||||
href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<!-- Ionicons 2.0.0 -->
|
||||
<link
|
||||
href="http://code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
|
||||
<!-- Theme style -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='dist/css/AdminLTE.min.css') }}"
|
||||
/>
|
||||
<!-- AdminLTE Skins. Choose a skin from the css/skins
|
||||
folder instead of downloading all of them to reduce the load. -->
|
||||
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='dist/css/skins/_all-skins.min.css') }}"
|
||||
/>
|
||||
|
||||
<!-- iCheck -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='plugins/iCheck/flat/blue.css') }}"
|
||||
/>
|
||||
|
||||
<!-- Morris chart -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='plugins/morris/morris.css') }}"
|
||||
/>
|
||||
|
||||
<!-- jvectormap -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='plugins/jvectormap/jquery-jvectormap-1.2.2.css') }}"
|
||||
/>
|
||||
|
||||
<!-- Date Picker -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='plugins/datepicker/datepicker3.css') }}"
|
||||
/>
|
||||
|
||||
<!-- Daterange picker -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='plugins/daterangepicker/daterangepicker-bs3.css') }}"
|
||||
/>
|
||||
|
||||
<!-- bootstrap wysihtml5 - text editor -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
media="screen"
|
||||
href="{{ url_for('static', filename='plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') }}"
|
||||
/>
|
||||
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<style>
|
||||
.small-box > .small-box-footer {
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
#loadingMessage {
|
||||
text-align: center;
|
||||
padding: 40px;
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
#canvas {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#output {
|
||||
margin-top: 20px;
|
||||
background: #eee;
|
||||
padding: 10px;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
#output div {
|
||||
padding-bottom: 10px;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
#noQRFound {
|
||||
text-align: center;
|
||||
}
|
||||
.layout-boxed {
|
||||
background: white;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- jQuery 2.1.3 -->
|
||||
<script src="{{ url_for('static', filename='plugins/jQuery/jQuery-2.1.3.min.js') }}"></script>
|
||||
<!-- jQuery UI 1.11.2 -->
|
||||
<script
|
||||
src="http://code.jquery.com/ui/1.11.2/jquery-ui.min.js"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
|
||||
<script>
|
||||
$.widget.bridge('uibutton', $.ui.button)
|
||||
</script>
|
||||
<!-- Bootstrap 3.3.2 JS -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='bootstrap/js/bootstrap.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- Morris.js charts -->
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/morris/morris.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- Sparkline -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/sparkline/jquery.sparkline.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- jvectormap -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/jvectormap/jquery-jvectormap-1.2.2.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/jvectormap/jquery-jvectormap-world-mill-en.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- jQuery Knob Chart -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/knob/jquery.knob.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- daterangepicker -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/daterangepicker/daterangepicker.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- datepicker -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/datepicker/bootstrap-datepicker.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- Bootstrap WYSIHTML5 -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- iCheck -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/iCheck/icheck.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- Slimscroll -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/slimScroll/jquery.slimscroll.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<!-- FastClick -->
|
||||
<script src="{{ url_for('static', filename='plugins/fastclick/fastclick.min.js') }}"></script>
|
||||
<!-- AdminLTE App -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='dist/js/app.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
|
||||
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='dist/js/pages/dashboard.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
|
||||
<!-- AdminLTE for demo purposes -->
|
||||
<script
|
||||
src="{{ url_for('static', filename='dist/js/demo.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/datatables/jquery.dataTables.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css"
|
||||
/>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script>
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/jscam/JS.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/jscam/qrcode.min.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/bolt11/decoder.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<script
|
||||
src="{{ url_for('static', filename='plugins/bolt11/utils.js') }}"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
</head>
|
||||
<body class="skin-white layout-boxed sidebar-collapse sidebar-open">
|
||||
<div class="wrapper">
|
||||
|
||||
<style>
|
||||
body {
|
||||
width: 210mm;
|
||||
/* to centre page on screen*/
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
background-color:white;
|
||||
}
|
||||
.layout-boxed .wrapper {
|
||||
box-shadow: none;
|
||||
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="allqrs"></div>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
<script>
|
||||
function getAjax(url, thekey, success) {
|
||||
var xhr = window.XMLHttpRequest
|
||||
? new XMLHttpRequest()
|
||||
: new ActiveXObject('Microsoft.XMLHTTP')
|
||||
xhr.open('GET', url, true)
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState > 3 && xhr.status == 200) {
|
||||
success(xhr.responseText)
|
||||
}
|
||||
}
|
||||
xhr.setRequestHeader('Grpc-Metadata-macaroon', thekey)
|
||||
xhr.setRequestHeader('Content-Type', 'application/json')
|
||||
|
||||
xhr.send()
|
||||
return xhr
|
||||
}
|
||||
|
||||
window.user_fau = {{ user_fau | megajson | safe }}
|
||||
|
||||
|
||||
function drawwithdraw(data, id) {
|
||||
|
||||
new QRCode(document.getElementById(id), {
|
||||
text: data,
|
||||
width: 120,
|
||||
height: 120,
|
||||
colorDark: '#000000',
|
||||
colorLight: '#ffffff',
|
||||
correctLevel: QRCode.CorrectLevel.M
|
||||
} )
|
||||
|
||||
|
||||
}
|
||||
lnurlar = {{ lnurlar|tojson }}
|
||||
lnurlamt = user_fau["inc"]
|
||||
console.log(user_fau)
|
||||
allqr = ""
|
||||
|
||||
for (i = 0; i < lnurlamt; i++) {
|
||||
allqr += "<div style='float:left;padding:20px; background-image: url(/static/note.jpg); width: 500px;height: 248px;'><div style='width:120px;float:right;margin-top:-16px;margin-right:-19px;background-color: white;'><div id='qrcode" + i + "'></div><center><p>{{user_fau[7]}} FREE SATS! <br/> <small style='font-size: 52%;'>SCAN AND FOLLOW LINK OR<br/>USE LN BITCOIN WALLET</small></p></center></div></div>"
|
||||
}
|
||||
|
||||
document.getElementById("allqrs").innerHTML = allqr
|
||||
|
||||
if (typeof lnurlar[1] != 'undefined'){
|
||||
for (i = 0; i < lnurlamt; i++) {
|
||||
drawwithdraw(lnurlar[i], "qrcode" + i)
|
||||
}
|
||||
window.print()
|
||||
}
|
||||
else{
|
||||
for (i = 0; i < lnurlamt; i++) {
|
||||
drawwithdraw(lnurlar[0], "qrcode" + i)
|
||||
}
|
||||
window.print()
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</html>
|
457
lnbits/templates/withdraw.html
Normal file
457
lnbits/templates/withdraw.html
Normal file
|
@ -0,0 +1,457 @@
|
|||
<!-- @format -->
|
||||
|
||||
{% extends "base.html" %} {% block messages %}
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-bell-o"></i>
|
||||
<span class="label label-danger">!</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="header"><b>Instant wallet, bookmark to save</b></li>
|
||||
<li></li>
|
||||
</ul>
|
||||
{% endblock %} {% block menuitems %}
|
||||
<li class="treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-bitcoin"></i> <span>Wallets</span>
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
{% for w in user_wallets %}
|
||||
<li>
|
||||
<a href="wallet?wal={{ w.id }}&usr={{ w.user }}"
|
||||
><i class="fa fa-bolt"></i> {{ w.name }}</a
|
||||
>
|
||||
</li>
|
||||
{% endfor %}
|
||||
<li><a onclick="sidebarmake()">Add a wallet +</a></li>
|
||||
<div id="sidebarmake"></div>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="active treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-th"></i> <span>Extensions</span>
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
{% if user_ext[0][1] %}
|
||||
<li>
|
||||
<a href="lnevents?usr={{ user_ext[0][0]}}"
|
||||
><i class="fa fa-plus"></i> LNEvents</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if user_ext[0][2] %}
|
||||
<li>
|
||||
<a href="lnjoust?usr={{ user_ext[0][0]}}"
|
||||
><i class="fa fa-plus"></i> LNJoust</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if user_ext[0][3] %}
|
||||
<li>
|
||||
<a href="withdraw?usr={{ user_ext[0][0]}}"
|
||||
><i class="fa fa-plus"></i> LNURLw</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li>
|
||||
<a href="extensions?usr={{ user }}"
|
||||
>Manager </a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
{% endblock %} {% block body %}
|
||||
<!-- Right side column. Contains the navbar and content of the page -->
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
Withdraw link maker
|
||||
<small>powered by LNURL</small>
|
||||
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li>
|
||||
<a href="/wallet?usr={{ user }}"><i class="fa fa-dashboard"></i> Home</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/extensions?usr={{ user }}"><li class="fa fa-dashboard">Extensions</li></a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="active" class="fa fa-dashboard">Withdraw link maker</i>
|
||||
</li>
|
||||
</ol>
|
||||
<br /><br />
|
||||
</section>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<!-- Small boxes (Stat box) -->
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6">
|
||||
<!-- general form elements -->
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"> Make a link</h3>
|
||||
</div><!-- /.box-header -->
|
||||
<!-- form start -->
|
||||
<form role="form">
|
||||
<div class="box-body">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Link title</label>
|
||||
<input id="tit" type="text" class="form-control" >
|
||||
</div>
|
||||
<!-- select -->
|
||||
<div class="form-group">
|
||||
<label>Select a wallet</label>
|
||||
<select id="wal" class="form-control">
|
||||
<option></option>
|
||||
{% for w in user_wallets %}
|
||||
<option>{{w.name}}-{{w.id}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Max withdraw:</label>
|
||||
<input id="maxamt" type="number" class="form-control" placeholder="1"></input>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Min withdraw:</label>
|
||||
<input id="minamt" type="number" class="form-control" placeholder="1"></input>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputPassword1">Amount of uses:</label>
|
||||
<input id="amt" type="number" class="form-control" placeholder="1"></input>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputPassword1">Time between withdrawals:</label>
|
||||
<input id="tme" type="number" class="form-control" placeholder="0" max="86400"></input>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input id="uniq" type="checkbox"> Unique links
|
||||
</label>
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
|
||||
<div class="box-footer">
|
||||
|
||||
<button onclick="postfau()" type="button" class="btn btn-info">Create link(s)</button>
|
||||
</div>
|
||||
</form>
|
||||
</div><!-- /.box -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-6">
|
||||
<!-- general form elements -->
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Select a link</h3>
|
||||
</div><!-- /.box-header -->
|
||||
<form role="form">
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
|
||||
<select class="form-control" >
|
||||
|
||||
{% for w in user_fau %}
|
||||
<option id="{{w.uni}}" onclick="drawwithdraw( '{{w.uni}}' )" >{{w.tit}}-{{w.uni}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<center> <br/><div id="qrcode" ></div><br/><div style="width:75%;word-wrap: break-word;" id="qrcodetxt" ></div></center>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div><!-- /.box -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Withdraw links <b id="withdraws"></b></h3>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body no-padding">
|
||||
<table id="pagnation" class="table table-bordered table-striped">
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<th style="width:15%">Link/ID</th>
|
||||
<th style="width:15%">Max Withdraw</th>
|
||||
<th style="width:15%">No. uses</th>
|
||||
<th style="width:15%">Wait</th>
|
||||
<th style="width:15%">Wallet</th>
|
||||
<th style="width:10%">Edit</th>
|
||||
<th style="width:10%">Del</th>
|
||||
</tr>
|
||||
<tbody id="transactions"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="editlink"></div>
|
||||
|
||||
<!-- /.content -->
|
||||
</section>
|
||||
|
||||
<script>
|
||||
window.user = {{ user | megajson | safe }}
|
||||
window.user_wallets = {{ user_wallets | megajson | safe }}
|
||||
window.user_ext = {{ user_ext | megajson | safe }}
|
||||
window.user_fau = {{ user_fau | megajson | safe }}
|
||||
|
||||
const user_fau = window.user_fau
|
||||
console.log(user_fau)
|
||||
|
||||
|
||||
function drawChart(user_fau) {
|
||||
var transactionsHTML = ''
|
||||
|
||||
for (var i = 0; i < user_fau.length; i++) {
|
||||
var tx = user_fau[i]
|
||||
console.log(tx.nme)
|
||||
// make the transactions table
|
||||
transactionsHTML =
|
||||
"<tr><td style='width: 50%'>" +
|
||||
tx.tit +
|
||||
'</td><td >' +
|
||||
"<a href='" + "/displaywithdraw?id=" + tx.uni + "'>" + tx.uni.substring(0, 4) + "...</a>" +
|
||||
'</td><td>' +
|
||||
tx.maxamt +
|
||||
'</td><td>' +
|
||||
tx.inc +
|
||||
'</td><td>' +
|
||||
tx.tme +
|
||||
'</td><td>' +
|
||||
"<a href='/wallet?usr="+ user +"'>" + tx.uni.substring(0, 4) + "...</a>" +
|
||||
'</td><td>' +
|
||||
"<i onclick='editlink("+ i +")'' class='fa fa-edit'></i>" +
|
||||
'</td><td>' +
|
||||
"<b><a style='color:red;' href='" + "/withdraw?del=" + tx.uni + "&usr=" + user +"'>" + "<i class='fa fa-trash'></i>" + "</a></b>" +
|
||||
'</td></tr>' +
|
||||
transactionsHTML
|
||||
document.getElementById('transactions').innerHTML = transactionsHTML
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (user_fau.length) {
|
||||
drawChart(user_fau)
|
||||
}
|
||||
|
||||
|
||||
//draws withdraw QR code
|
||||
function drawwithdraw(data) {
|
||||
|
||||
walname = document.getElementById(data).value
|
||||
thewithdraw = walname.split("-");
|
||||
console.log(window.location.hostname + "-" + thewithdraw[1])
|
||||
|
||||
getAjax('/v1/lnurlencode/'+ window.location.hostname + "/" + thewithdraw[1], "filla", function(datab) {
|
||||
if (JSON.parse(datab).STATUS == 'TRUE') {
|
||||
console.log(JSON.parse(datab).STATUS)
|
||||
lnurlfau = (JSON.parse(datab).LNURL)
|
||||
|
||||
|
||||
new QRCode(document.getElementById('qrcode'), {
|
||||
text: lnurlfau,
|
||||
width: 300,
|
||||
height: 300,
|
||||
colorDark: '#000000',
|
||||
colorLight: '#ffffff',
|
||||
correctLevel: QRCode.CorrectLevel.M
|
||||
})
|
||||
document.getElementById('qrcodetxt').innerHTML = lnurlfau
|
||||
+
|
||||
"<a target='_blank' href='/displaywithdraw?id=" + thewithdraw[1] + "'><h4>Shareable link</h4></a>" +
|
||||
"<a target='_blank' href='/printwithdraw/" + window.location.hostname + "/?id=" + thewithdraw[1] + "'><h4>Print all withdraws</h4></a>"
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
thewithdraw[1] = "Failed to build LNURL"
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function postfau(){
|
||||
|
||||
wal = document.getElementById('wal').value
|
||||
tit = document.getElementById('tit').value
|
||||
amt = document.getElementById('amt').value
|
||||
maxamt = document.getElementById('maxamt').value
|
||||
minamt = document.getElementById('minamt').value
|
||||
tme = document.getElementById('tme').value
|
||||
uniq = document.getElementById('uniq').checked
|
||||
|
||||
|
||||
console.log(wal)
|
||||
console.log(tit)
|
||||
console.log(amt)
|
||||
console.log(maxamt)
|
||||
console.log(minamt)
|
||||
console.log(wal)
|
||||
console.log(tme)
|
||||
|
||||
postAjax(
|
||||
'/withdrawmaker',
|
||||
JSON.stringify({"tit": tit, "amt": amt, "maxamt": maxamt, "minamt": minamt, "tme": tme, "wal": wal, "usr": user, "uniq": uniq}),
|
||||
"filla",
|
||||
|
||||
function(data) { location.replace("/withdraw?usr=" + user)
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function editlink(linknum){
|
||||
|
||||
faudetails = user_fau[linknum]
|
||||
|
||||
console.log(faudetails)
|
||||
wallpick = ""
|
||||
|
||||
checkbox = ""
|
||||
if (faudetails.uniq == 1){
|
||||
checkbox = "checked"}
|
||||
|
||||
document.getElementById('editlink').innerHTML = "<div class='row'>"+
|
||||
"<div class='col-md-6'>"+
|
||||
" <!-- general form elements -->"+
|
||||
"<div class='box box-primary'>"+
|
||||
"<div class='box-header'>"+
|
||||
"<h3 class='box-title'> Edit: <i id='unid'>" + faudetails.tit + "-" + faudetails.uni + "</i> </h3>"+
|
||||
"<div class='box-tools pull-right'>" +
|
||||
"<button class='btn btn-box-tool' data-widget='remove'><i class='fa fa-times'></i></button>" +
|
||||
"</div>" +
|
||||
" </div><!-- /.box-header -->"+
|
||||
" <!-- form start -->"+
|
||||
"<form role='form'>"+
|
||||
"<div class='box-body'>"+
|
||||
"<div class='col-sm-3 col-md-4'>"+
|
||||
"<div class='form-group'>"+
|
||||
"<label for='exampleInputEmail1'>Link title</label>"+
|
||||
"<input id='edittit' type='text' class='form-control' value='"+
|
||||
faudetails.tit +
|
||||
"'></input> </div>"+
|
||||
" </div>"+
|
||||
" <div class='col-sm-4 col-md-4'>"+
|
||||
" <!-- select -->"+
|
||||
" <div class='form-group'>"+
|
||||
" <label>Select a wallet</label>"+
|
||||
"<select id='editwal' class='form-control'>"+
|
||||
" <option>" + faudetails.walnme + "-" + faudetails.wal + "</option>"+
|
||||
" {% for w in user_wallets %}"+
|
||||
|
||||
" <option>{{w.name}}-{{w.id}}</option>"+
|
||||
|
||||
" {% endfor %}"+
|
||||
" </select>"+
|
||||
" </div>"+
|
||||
" </div>"+
|
||||
" <div class='col-sm-3 col-md-4'>"+
|
||||
"<div class='form-group'>"+
|
||||
" <label for='exampleInputPassword1'>Time between withdrawals:</label>"+
|
||||
" <input id='edittme' type='number' class='form-control' placeholder='0' max='86400' value='"+
|
||||
faudetails.tme +
|
||||
"'></input>"+
|
||||
"</div> </div>"+
|
||||
" <div class='col-sm-3 col-md-4'>"+
|
||||
"<div class='form-group'>"+
|
||||
"<label for='exampleInputEmail1'>Max withdraw:</label>"+
|
||||
" <input id='editmaxamt' type='number' class='form-control' placeholder='1' value='"+
|
||||
faudetails.maxamt +
|
||||
"'></input>"+
|
||||
" </div></div>"+
|
||||
" <div class='col-sm-3 col-md-4'>"+
|
||||
" <div class='form-group'>"+
|
||||
" <label for='exampleInputEmail1'>Min withdraw:</label>"+
|
||||
" <input id='editminamt' type='number' class='form-control' placeholder='1' value='"+
|
||||
faudetails.minamt +
|
||||
"'></input>"+
|
||||
" </div></div>"+
|
||||
" <div class='col-sm-3 col-md-4'>"+
|
||||
"<div class='form-group'>"+
|
||||
" <label for='exampleInputPassword1'>Amount of uses:</label>"+
|
||||
" <input id='editamt' type='number' class='form-control' placeholder='1' value='"+
|
||||
faudetails.inc +
|
||||
"'></input>"+
|
||||
" </div> </div>"+
|
||||
" <div class='col-sm-3 col-md-4'>"+
|
||||
" <div class='checkbox'>"+
|
||||
"<label data-toggle='tooltip' title='Some tooltip text!'><input id='edituniq' type='checkbox' "+
|
||||
checkbox +
|
||||
">"+
|
||||
"Unique links</label>"+
|
||||
"</div></div><!-- /.box-body -->"+
|
||||
" </div><br/>"+
|
||||
" <div class='box-footer'>"+
|
||||
" <button onclick='editlinkcont()' type='button' class='btn btn-info'>Edit link(s)</button>"+
|
||||
" </div></form></div><!-- /.box --></div></div>"
|
||||
|
||||
|
||||
}
|
||||
|
||||
function editlinkcont(){
|
||||
|
||||
unid = document.getElementById('unid').innerHTML
|
||||
wal = document.getElementById('editwal').value
|
||||
tit = document.getElementById('edittit').value
|
||||
amt = document.getElementById('editamt').value
|
||||
maxamt = document.getElementById('editmaxamt').value
|
||||
minamt = document.getElementById('editminamt').value
|
||||
tme = document.getElementById('edittme').value
|
||||
uniq = document.getElementById('edituniq').checked
|
||||
|
||||
|
||||
console.log(wal)
|
||||
console.log(tit)
|
||||
console.log(amt)
|
||||
console.log(maxamt)
|
||||
console.log(minamt)
|
||||
console.log(tme)
|
||||
|
||||
|
||||
|
||||
postAjax(
|
||||
'/withdrawmaker',
|
||||
JSON.stringify({"id": unid, "tit": tit, "amt": amt, "maxamt": maxamt, "minamt": minamt, "tme": tme, "wal": wal, "usr": user, "uniq": uniq}),
|
||||
"filla",
|
||||
|
||||
function(data) { location.replace("/withdraw?usr=" + user)
|
||||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Add table
Reference in a new issue