Browse Source

update

- coin images
- api call for history/balance
master
Satinder Grewal 9 years ago
parent
commit
37fdd570c8
  1. BIN
      assets/images/cryptologo/namecoin.png
  2. BIN
      assets/images/cryptologo/syscoin.png
  3. BIN
      assets/images/cryptologo/vpncoin.png
  4. BIN
      assets/images/cryptologo/zcash.png
  5. 252
      assets/scripts/dashboard.js
  6. 8
      index.html

BIN
assets/images/cryptologo/namecoin.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
assets/images/cryptologo/syscoin.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
assets/images/cryptologo/vpncoin.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
assets/images/cryptologo/zcash.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

252
assets/scripts/dashboard.js

@ -19,131 +19,161 @@ var Dashboard = function() {
var walletDivContent = ''; var walletDivContent = '';
$.ajax({ $.each([ 'basilisk', 'full', 'virtual' ], function( index, value ) {
type: 'GET',
url: 'http://127.0.0.1:7778/api/InstantDEX/allcoins', $.ajax({
dataType: 'text', type: 'GET',
success: function(data, textStatus, jqXHR) { url: 'http://127.0.0.1:7778/api/InstantDEX/allcoins',
var AllcoinsDataOutput = JSON.parse(data); dataType: 'text',
//console.log('== Data OutPut =='); success: function(data, textStatus, jqXHR) {
//console.log(AllcoinsDataOutput.basilisk); var AllcoinsDataOutput = JSON.parse(data);
//console.log('== Data OutPut ==');
$.each(AllcoinsDataOutput.basilisk, function(index) { //console.log(value);
//console.log(AllcoinsDataOutput[value]);
var coinlogo = '';
var coinname = ''; $.each(AllcoinsDataOutput[value], function(index) {
if ( AllcoinsDataOutput.basilisk[index] == 'BTC' ) { var coinlogo = '';
coinlogo = 'bitcoin'; var coinname = '';
coinname = 'Bitcoin'; var modecode = '';
} var modetip = '';
if ( AllcoinsDataOutput.basilisk[index] == 'BTCD' ) { var modecolor = '';
coinlogo = 'bitcoindark';
coinname = 'BitcoinDark'; if ( value == 'basilisk' ) { modecode = 'B'; modetip = 'Basilisk'; modecolor = 'info'; }
} if ( value == 'full' ) { modecode = 'F'; modetip = 'Full'; modecolor = 'success'; }
if ( AllcoinsDataOutput.basilisk[index] == 'LTC' ) { if ( value == 'virtual' ) { modecode = 'V'; modetip = 'Virtual'; modecolor = 'danger'; }
coinlogo = 'litecoin';
coinname = 'Litecoin'; if ( AllcoinsDataOutput[value][index] == 'BTC' ) { coinlogo = 'bitcoin'; coinname = 'Bitcoin'; }
} if ( AllcoinsDataOutput[value][index] == 'BTCD' ) { coinlogo = 'bitcoindark'; coinname = 'BitcoinDark'; }
if ( AllcoinsDataOutput[value][index] == 'LTC' ) { coinlogo = 'litecoin'; coinname = 'Litecoin'; }
//console.log(AllcoinsDataOutput.basilisk[index]); if ( AllcoinsDataOutput[value][index] == 'VPN' ) { coinlogo = 'vpncoin'; coinname = 'VPNcoin'; }
walletDivContent += '<!-- Begin' + AllcoinsDataOutput.basilisk[index] + 'wallet widget -->'; if ( AllcoinsDataOutput[value][index] == 'SYS' ) { coinlogo = 'syscoin'; coinname = 'Syscoin'; }
walletDivContent += '<div class="col-md-6 col-xs-12 masonry-item">'; if ( AllcoinsDataOutput[value][index] == 'ZEC' ) { coinlogo = 'zcash'; coinname = 'Zcash'; }
walletDivContent += '<div class="widget widget-shadow">'; if ( AllcoinsDataOutput[value][index] == 'NMC' ) { coinlogo = 'namecoin'; coinname = 'Namecoin'; }
walletDivContent += '<div class="widget-header wallet-widget-header padding-15 clearfix">';
walletDivContent += '<div class="row no-space">';
walletDivContent += '<div class="col-xs-7">'; //console.log(AllcoinsDataOutput[value][index]);
walletDivContent += '<a class="avatar avatar-lg pull-left margin-right-20 img-bordered" href="javascript:void(0)" data-currency="' + AllcoinsDataOutput.basilisk[index] + '">'; walletDivContent += '<!-- Begin' + AllcoinsDataOutput[value][index] + 'wallet widget -->';
walletDivContent += '<img src="assets/images/cryptologo/' + coinlogo + '.png" alt="">'; walletDivContent += '<div class="col-md-6 col-xs-12 masonry-item">';
walletDivContent += '<span class="badge up badge-info" id="basfull" data-currency="' + AllcoinsDataOutput.basilisk[index] + '" data-toggle="tooltip" data-placement="top" data-original-title="Basilisk">B</span>'; walletDivContent += '<div class="widget widget-shadow">';
walletDivContent += '</a>'; walletDivContent += '<div class="widget-header wallet-widget-header padding-15 clearfix">';
walletDivContent += '<div>'; walletDivContent += '<div class="row no-space">';
walletDivContent += '<div class="font-size-20 hidden-xs" data-currency="' + AllcoinsDataOutput.basilisk[index] + '" id="currency-name">' + coinname + '</div>'; walletDivContent += '<div class="col-xs-7">';
walletDivContent += '<div class="form-material hidden-md hidden-xs">'; walletDivContent += '<a class="avatar avatar-lg pull-left margin-right-20 img-bordered" href="javascript:void(0)" data-currency="' + AllcoinsDataOutput[value][index] + '">';
walletDivContent += '<select class="form-control font-size-12" data-currency="' + AllcoinsDataOutput.basilisk[index] + '" id="currency-addr" style="width: 235px;">'; walletDivContent += '<img src="assets/images/cryptologo/' + coinlogo + '.png" alt="">';
//walletDivContent += '<option>1LkTfkQLXg2v86oc1MoLz68nKoshh5ARTC</option>'; walletDivContent += '<span class="badge up badge-' + modecolor + '" id="basfull" data-currency="' + AllcoinsDataOutput[value][index] + '" data-toggle="tooltip" data-placement="top" data-original-title="' + modetip + '">' + modecode + '</span>';
//walletDivContent += '<option>1LkTfkQLXg2v86oc1MoLz68nKoshh5ARTC</option>'; walletDivContent += '</a>';
walletDivContent += '</select>'; walletDivContent += '<div>';
walletDivContent += '</div>'; walletDivContent += '<div class="font-size-20 hidden-xs" data-currency="' + AllcoinsDataOutput[value][index] + '" id="currency-name">' + coinname + '</div>';
walletDivContent += '<div class="font-size-12 hidden-xs"></div>'; walletDivContent += '<div class="form-material hidden-md hidden-xs">';
walletDivContent += '</div>'; walletDivContent += '<select class="form-control font-size-12" data-currency="' + AllcoinsDataOutput[value][index] + '" id="currency-addr" style="width: 235px;">';
walletDivContent += '</div>'; //walletDivContent += '<option>1LkTfkQLXg2v86oc1MoLz68nKoshh5ARTC</option>';
walletDivContent += '<div class="col-xs-5">'; //walletDivContent += '<option>1LkTfkQLXg2v86oc1MoLz68nKoshh5ARTC</option>';
walletDivContent += '<div class="row no-space text-center">'; walletDivContent += '</select>';
walletDivContent += '<div class="col-md-4 col-xs-6">'; walletDivContent += '</div>';
walletDivContent += '<div class="counter" data-toggle="tooltip" data-placement="top" data-original-title="Balance">'; walletDivContent += '<div class="font-size-12 hidden-xs"></div>';
walletDivContent += '<div class="counter-icon"><i class="icon">' + AllcoinsDataOutput.basilisk[index] + '</i></div>';
walletDivContent += '<span class="counter-number" data-currency="' + AllcoinsDataOutput.basilisk[index] + '" id="currency-balance">6.584</span>';
walletDivContent += '</div>'; walletDivContent += '</div>';
walletDivContent += '</div>'; walletDivContent += '</div>';
walletDivContent += '<div class="col-md-4 col-xs-6">'; walletDivContent += '<div class="col-xs-5">';
walletDivContent += '<div class="counter" data-toggle="tooltip" data-placement="top" data-original-title="Unconfirmed">'; walletDivContent += '<div class="row no-space text-center">';
walletDivContent += '<div class="counter-icon"><i class="icon fa-spinner"></i></div>'; walletDivContent += '<div class="col-md-4 col-xs-6">';
walletDivContent += '<span class="counter-number" data-currency="' + AllcoinsDataOutput.basilisk[index] + '" id="currency-unconfirmed">3</span>'; walletDivContent += '<div class="counter" data-toggle="tooltip" data-placement="top" data-original-title="Balance">';
walletDivContent += '</div>'; walletDivContent += '<div class="counter-icon"><i class="icon">' + AllcoinsDataOutput[value][index] + '</i></div>';
walletDivContent += '</div>'; walletDivContent += '<span class="counter-number" data-currency="' + AllcoinsDataOutput[value][index] + '" id="currency-balance">6.584</span>';
walletDivContent += '<div class="col-md-4 hidden-xs hidden-sm">'; walletDivContent += '</div>';
walletDivContent += '<div class="counter" data-toggle="tooltip" data-placement="top" data-original-title="No. of Transactions">'; walletDivContent += '</div>';
walletDivContent += '<div class="counter-icon"><i class="icon fa-book"></i></div>'; walletDivContent += '<div class="col-md-4 col-xs-6">';
walletDivContent += '<span class="counter-number" data-currency="' + AllcoinsDataOutput.basilisk[index] + '" id="currency-nooftransactions">325</span>'; walletDivContent += '<div class="counter" data-toggle="tooltip" data-placement="top" data-original-title="Unconfirmed">';
walletDivContent += '<div class="counter-icon"><i class="icon fa-spinner"></i></div>';
walletDivContent += '<span class="counter-number" data-currency="' + AllcoinsDataOutput[value][index] + '" id="currency-unconfirmed">3</span>';
walletDivContent += '</div>';
walletDivContent += '</div>';
walletDivContent += '<div class="col-md-4 hidden-xs hidden-sm">';
walletDivContent += '<div class="counter" data-toggle="tooltip" data-placement="top" data-original-title="No. of Transactions">';
walletDivContent += '<div class="counter-icon"><i class="icon fa-book"></i></div>';
walletDivContent += '<span class="counter-number" data-currency="' + AllcoinsDataOutput[value][index] + '" id="currency-nooftransactions">325</span>';
walletDivContent += '</div>';
walletDivContent += '</div>';
walletDivContent += '</div>'; walletDivContent += '</div>';
walletDivContent += '</div>'; walletDivContent += '</div>';
walletDivContent += '</div>'; walletDivContent += '</div>';
walletDivContent += '</div>';
walletDivContent += '</div>'; walletDivContent += '</div>';
walletDivContent += '</div>'; walletDivContent += '<div class="widget-content history-body hidden-sm hidden-xs">';
walletDivContent += '<div class="widget-content history-body hidden-sm hidden-xs">'; walletDivContent += '<div class="height-200 scrollbar-dynamic" id="tblscroll">';
walletDivContent += '<div class="height-200 scrollbar-dynamic" id="tblscroll">'; walletDivContent += '<div data-role="container">';
walletDivContent += '<div data-role="container">'; walletDivContent += '<div data-role="content">';
walletDivContent += '<div data-role="content">'; walletDivContent += '<table class="table font-size-12" data-currency="' + AllcoinsDataOutput[value][index] + '" id="currency-tbl">';
walletDivContent += '<table class="table font-size-12" data-currency="' + AllcoinsDataOutput.basilisk[index] + '" id="currency-tbl">'; walletDivContent += '<tbody>';
walletDivContent += '<tbody>'; walletDivContent += '</tbody>';
walletDivContent += '</tbody>'; walletDivContent += '</table>';
walletDivContent += '</table>'; walletDivContent += '</div>';
walletDivContent += '</div>';
walletDivContent += '</div>'; walletDivContent += '</div>';
walletDivContent += '</div>'; walletDivContent += '</div>';
walletDivContent += '</div>'; walletDivContent += '</div>';
walletDivContent += '</div>'; walletDivContent += '</div>';
walletDivContent += '</div>'; walletDivContent += '<!-- End' + AllcoinsDataOutput[value][index] + 'wallet widget -->';
walletDivContent += '</div>';
walletDivContent += '<!-- End' + AllcoinsDataOutput.basilisk[index] + 'wallet widget -->'; $('#wallet-widgets').html(walletDivContent);
$('.scrollbar-dynamic').scrollbar(); //Make sure widget-body has scrollbar for transactions history
$('#wallet-widgets').html(walletDivContent); $('[data-toggle="tooltip"]').tooltip(); //Make sure tooltips are working for wallet widgets and anywhere else in wallet.
$('.scrollbar-dynamic').scrollbar(); //Make sure widget-body has scrollbar for transactions history //console.log(walletDivContent);
$('[data-toggle="tooltip"]').tooltip(); //Make sure tooltips are working for wallet widgets and anywhere else in wallet.
//console.log(walletDivContent); //console.log('http://127.0.0.1:7778/api/bitcoinrpc/getaddressesbyaccount?coin=' + AllcoinsDataOutput[value][index] + '&account=*');
//$('select[data-currency="' + AllcoinsDataOutput[value][index] + '"]').empty();
//console.log('http://127.0.0.1:7778/api/bitcoinrpc/getaddressesbyaccount?coin=' + AllcoinsDataOutput.basilisk[index] + '&account=*'); //Get list of address per coin and pupulate that to wallet widget
//$('select[data-currency="' + AllcoinsDataOutput.basilisk[index] + '"]').empty(); $.getJSON( 'http://127.0.0.1:7778/api/bitcoinrpc/getaddressesbyaccount?coin=' + AllcoinsDataOutput[value][index] + '&account=*', function( data ) {
$.getJSON( 'http://127.0.0.1:7778/api/bitcoinrpc/getaddressesbyaccount?coin=' + AllcoinsDataOutput.basilisk[index] + '&account=*', function( data ) { //var CoinAddrList = '';
var CoinAddrList = ''; //console.log(data.result);
//console.log(data.result); $.each(data.result, function(coin_index){
$.each(data.result, function(coin_index){ //console.log(coin_index);
//console.log(coin_index); //console.log(data.result[index]);
//console.log(data.result[index]); //console.log(AllcoinsDataOutput[value][index]);
//console.log(AllcoinsDataOutput.basilisk[index]); CoinAddrList = '<option value="' + data.result[coin_index] + '" data-select-options="' + AllcoinsDataOutput[value][index] + '">' + data.result[coin_index] + '</option>';
CoinAddrList = '<option value="' + data.result[coin_index] + '" data-select-options="' + AllcoinsDataOutput.basilisk[index] + '">' + data.result[coin_index] + '</option>';
//console.log(CoinAddrList);
//console.log(CoinAddrList); // Inject the whole content string into our existing HTML table
// Inject the whole content string into our existing HTML table $('select[data-currency="' + AllcoinsDataOutput[value][index] + '"]').append(CoinAddrList);
$('select[data-currency="' + AllcoinsDataOutput.basilisk[index] + '"]').append(CoinAddrList);
});
//console.log(data);
//console.log(data[0]);*/
});
var historyvalues = {"timeout":20000,"agent":"basilisk","method":"history","vals":{"coin":"LTC"}};
//Get coin history and pupulate balance and other info to wallet widget
$.ajax({
type: 'POST',
data: historyvalues,
url: 'http://127.0.0.1:7778/api/basilisk/history',
dataType: 'text',
success: function(data, textStatus, jqXHR) {
var CoinHistoryData = JSON.parse(data);
console.log('== Data OutPut ==');
console.log(CoinHistoryData);
},
error: function(xhr, textStatus, error) {
console.log('failed getting Coin History.');
console.log(xhr.statusText);
console.log(textStatus);
console.log(error);
}
}); });
//console.log(data);
//console.log(data[0]);*/
}); });
}); },
}, error: function(xhr, textStatus, error) {
error: function(xhr, textStatus, error) { console.log('failed starting BitcoinDark.');
console.log('failed starting BitcoinDark.'); console.log(xhr.statusText);
console.log(xhr.statusText); console.log(textStatus);
console.log(textStatus); console.log(error);
console.log(error); //swal("Oops...", "Something went wrong!", "error");
//swal("Oops...", "Something went wrong!", "error"); if (xhr.readyState == '0' ) {
if (xhr.readyState == '0' ) { toastr.error("Unable to connect to Iguana", "Account Notification")
toastr.error("Unable to connect to Iguana", "Account Notification") }
} }
} });
}); });
} }

8
index.html

@ -35,7 +35,7 @@
<link rel="stylesheet" href="assets/global/fonts/material-design/material-design.min.css"> <link rel="stylesheet" href="assets/global/fonts/material-design/material-design.min.css">
<link rel="stylesheet" href="assets/global/fonts/web-icons/web-icons.css"> <link rel="stylesheet" href="assets/global/fonts/web-icons/web-icons.css">
<link rel="stylesheet" href="assets/global/fonts/brand-icons/brand-icons.min.css"> <link rel="stylesheet" href="assets/global/fonts/brand-icons/brand-icons.min.css">
<link rel='stylesheet' href='http://fonts.googleapis.com/css?family=Roboto:300,400,500,300italic'> <!--<link rel='stylesheet' href='http://fonts.googleapis.com/css?family=Roboto:300,400,500,300italic'>-->
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="assets/global/vendor/html5shiv/html5shiv.min.js"></script> <script src="assets/global/vendor/html5shiv/html5shiv.min.js"></script>
<![endif]--> <![endif]-->
@ -263,21 +263,21 @@
</div> </div>
<!-- End page header --> <!-- End page header -->
<div class="page-content" id="section-dashboard"> <div class="page-content" id="section-dashboard">
<div class="row" id="wallet-widgets" data-plugin="masonry" style="position: relative; height: 800px;"> <div class="row" id="wallet-widgets" data-plugin="masonry">
</div> </div>
</div> </div>
<!-- END DASHBOARD CONTENT BODY --> <!-- END DASHBOARD CONTENT BODY -->
<!-- BEGIN EASYDEX CONTENT BODY --> <!-- BEGIN EASYDEX CONTENT BODY -->
<div class="page-content" id="section-easydex" style="height: 800px;"> <div class="page-content" id="section-easydex">
<h2>EasyDEX</h2> <h2>EasyDEX</h2>
<p>Page content goes here</p> <p>Page content goes here</p>
</div> </div>
<!-- END EASYDEX CONTENT BODY --> <!-- END EASYDEX CONTENT BODY -->
<!-- BEGIN ABOUT SUPERNET IGUANA CONTENT BODY --> <!-- BEGIN ABOUT SUPERNET IGUANA CONTENT BODY -->
<div class="page-content" id="section-about-iguana" style="height: 800px;"> <div class="page-content" id="section-about-iguana">
<h2>About Iguana</h2> <h2>About Iguana</h2>
<p>Page content goes here</p> <p>Page content goes here</p>
</div> </div>

Loading…
Cancel
Save