update: LP set price modal basic structure added

This commit is contained in:
Satinder Grewal 2017-06-15 13:16:40 +12:00
parent c88b75ff80
commit d5a05ff3c0
2 changed files with 70 additions and 48 deletions

View File

@ -59,60 +59,77 @@
</div>
<div class="col-sm-10">
<ul class="nav nav-tabs nav-justified">
<li class="active"><a href="#1b" data-toggle="tab">Client DEX Trading</a></li>
<li><a href="#2b" data-toggle="tab">Liquidity Provider Trading</a></li>
</ul>
<div class="tab-content clearfix">
<div class="tab-pane active" id="1b">
<div class="panel panel-default">
<div class="panel-heading"><strong>Client DEX Trading options</strong><button class="btn btn-default btn-sm refresh_inv_table" style="float: right; font-size: 13px; padding: 0 5px;" data-coin="COIN">Refresh</button></div>
<div class="" style="height:290px;overflow:scroll;">
<table class="table table-striped inv_alice_table" style="margin-bottom: 0;">
<thead>
<tr>
<th>AMOUNT</th>
<th>Max Price</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<ul class="nav nav-tabs nav-justified">
<li class="active">
<a href="#1b" data-toggle="tab">Client DEX Trading</a>
</li>
<li><a href="#2b" data-toggle="tab">Liquidity Provider Trading</a>
</li>
</ul>
</tbody>
</table>
</div>
</div>
</div>
<div class="tab-content clearfix">
<div class="tab-pane active" id="1b">
<div class="tab-pane" id="2b">
<div class="panel panel-default">
<div class="panel-heading"><strong>Client DEX Trading options</strong><button class="btn btn-default btn-sm refresh_inv_table" style="float: right; font-size: 13px; padding: 0 5px;" data-coin="COIN">Refresh</button></div>
<div class="" style="height:290px;overflow:scroll;">
<table class="table table-striped inv_alice_table" style="margin-bottom: 0;">
<thead>
<tr>
<th>AMOUNT</th>
<th>Max Price</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<div class="panel-heading"><strong>Liquidity Provider Trading options</strong><button class="btn btn-default btn-sm refresh_inv_table" style="float: right; font-size: 13px; padding: 0 5px;" data-coin="COIN">Refresh</button></div>
<div class="" style="height:290px;overflow:scroll;">
<table class="table table-striped inv_bob_table" style="margin-bottom: 0;">
<thead>
<tr>
<th>AMOUNT</th>
<!--<th>Max Price</th>-->
<th>Action</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="2b">
<div class="panel panel-default">
<div class="panel-heading"><strong>Liquidity Provider Trading options</strong><button class="btn btn-default btn-sm refresh_inv_table" style="float: right; font-size: 13px; padding: 0 5px;" data-coin="COIN">Refresh</button></div>
<div class="" style="height:290px;overflow:scroll;">
<table class="table table-striped inv_bob_table" style="margin-bottom: 0;">
<thead>
<tr>
<th>AMOUNT</th>
<!--<th>Max Price</th>-->
<th>Action</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="LP_Mode_SetPrice" tabindex="-1" role="dialog" aria-labelledby="LP_Mode_SetPriceLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="LP_Mode_SetPriceLabel">Modal title</h4>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -549,7 +549,7 @@ $('.refresh_inv_table').click(function() {
$('.inv_alice_table tbody').empty();
var test_data = {"result":"success","alice":[{"method":"notified","method2":"notified","coin":"KMD","now":1497477754,"address":"RNjAhmqZoPpadLF6sfFXTcTPmyXHnBdFvA","txid":"dcd082d5ecde2c37021561d375bd62b6752e61184d3a4da02069c7724ae44912","vout":0,"value":"200000000","satoshis":"200000000","txid2":"7711afa7cdb3880a3813fd3b5252eae27ce2e25801ee689b1da0e1aca9d0d509","vout2":0,"value2":"10000000","desthash":"9200ad4422472041ade4bb26511acaa7eb53b7132f0cbb45bc30448a10cbc441"}, {"method":"notified","method2":"notified","coin":"KMD","now":1497477754,"address":"RNjAhmqZoPpadLF6sfFXTcTPmyXHnBdFvA","txid":"bbf1d0304bfa2f8f96d2c06480782c5078f7c32a968772b850b022c9ceb5074b","vout":0,"value":"200000000","satoshis":"200000000","txid2":"53b4f0be9310625b3284b0cd193a64ec5960e951b89f3cd2d51a40cb2f7d0fa3","vout2":0,"value2":"10000000","desthash":"9200ad4422472041ade4bb26511acaa7eb53b7132f0cbb45bc30448a10cbc441"}, {"method":"notified","method2":"notified","coin":"KMD","now":1497477754,"address":"RNjAhmqZoPpadLF6sfFXTcTPmyXHnBdFvA","txid":"5824cc681ad3615c44c962a3fecb2fb6c328d9cdc52281597e9cb51ee5e41094","vout":0,"value":"200000000","satoshis":"200000000","txid2":"25c6cc193e61f102a69a0e71992a08c00fb2368166460aa20823d561517133c3","vout2":0,"value2":"10000000","desthash":"9200ad4422472041ade4bb26511acaa7eb53b7132f0cbb45bc30448a10cbc441"}],"bob":[{"method":"notified","method2":"notified","coin":"KMD","now":1497477754,"address":"RNjAhmqZoPpadLF6sfFXTcTPmyXHnBdFvA","txid":"bbf1d0304bfa2f8f96d2c06480782c5078f7c32a968772b850b022c9ceb5074b","vout":0,"value":"200000000","satoshis":"177688888","txid2":"dcd082d5ecde2c37021561d375bd62b6752e61184d3a4da02069c7724ae44912","vout2":0,"value2":"200000000","srchash":"9200ad4422472041ade4bb26511acaa7eb53b7132f0cbb45bc30448a10cbc441"}, {"method":"notified","method2":"notified","coin":"KMD","now":1497477754,"address":"RNjAhmqZoPpadLF6sfFXTcTPmyXHnBdFvA","txid":"53b4f0be9310625b3284b0cd193a64ec5960e951b89f3cd2d51a40cb2f7d0fa3","vout":0,"value":"10000000","satoshis":"8800000","txid2":"7711afa7cdb3880a3813fd3b5252eae27ce2e25801ee689b1da0e1aca9d0d509","vout2":0,"value2":"10000000","srchash":"9200ad4422472041ade4bb26511acaa7eb53b7132f0cbb45bc30448a10cbc441"}]};
console.log(test_data);
$.each(data.alice, function(index, val) {
$.each(test_data.alice, function(index, val) {
//console.log(index);
//console.log(val);
var inv_alice_table_tr = '';
@ -562,14 +562,14 @@ $('.refresh_inv_table').click(function() {
})
$('.inv_bob_table tbody').empty();
$.each(data.bob, function(index, val) {
$.each(test_data.bob, function(index, val) {
//console.log(index);
//console.log(val);
var inv_bob_table_tr = '';
inv_bob_table_tr += '<tr>';
inv_bob_table_tr += '<td>' + (parseFloat(val.value)/100000000).toFixed(8) + ' ' + val.coin + '</td>';
//inv_bob_table_tr += '<td><input class="form-control input-sm trade_pair_maxprice" type="text" name="price" value="" data-coin="'+val.coin+'" data-txid="'+val.txid+'" data-vout="'+val.vout+'"></td>';
inv_bob_table_tr += '<td><button class="btn btn-default btn-sm inv_lp_setprice" data-coin="'+val.coin+'" data-txid="'+val.txid+'" data-vout="'+val.vout+'">Set Max Trade Price</button></td>';
inv_bob_table_tr += '<td><button class="btn btn-default btn-sm inv_lp_setprice" data-coin="'+val.coin+'" data-txid="'+val.txid+'" data-vout="'+val.vout+'" data-toggle="modal" data-target="#LP_Mode_SetPrice">Set Max Trade Price</button></td>';
inv_bob_table_tr += '</tr>';
$('.inv_bob_table tbody').append(inv_bob_table_tr);
})
@ -690,6 +690,11 @@ $('.inv_alice_table tbody').on('click', '.inv_autotrade', function() {
})
$('.inv_bob_table tbody').on('click', '.inv_lp_setprice', function() {
console.log($(this).data());
$('#LP_Mode_SetPrice').modal('show')
});
//{"userpass":"$userpass","method":"orderbook","base":"REVS","rel":"KMD"}
/*