Browse Source

Merge pull request #50 from pbca26/master

added komodod best chain activation progress update bit
master
Satinder Grewal 8 years ago
committed by GitHub
parent
commit
c940849407
  1. 5
      assets/css/dashboard-wallet-widgets.css
  2. 8
      assets/css/dashboard.css
  3. 4
      assets/css/progress-bars.css
  4. 23
      assets/pages/login.css
  5. 2
      assets/pages/register.css
  6. 217
      assets/scripts/atomicexplorer.js
  7. 1
      assets/scripts/dashboard.js
  8. 2
      assets/scripts/iguana_api.js
  9. 65
      assets/scripts/kmd_wallet_dashboard.js
  10. 2
      index.html

5
assets/css/dashboard-wallet-widgets.css

@ -67,9 +67,6 @@
height: 100%;
margin-left: 450px !important;
}
#edex-footer {
/*margin-left: 450px !important;*/
}
.page-aside-inner {
height: 100%;
@ -83,8 +80,6 @@
.page-aside-inner .wallet-widgets-list {
height: 100%;
/*height: -webkit-calc(100% - 72px);
height: calc(100% - 72px);*/
}
.page-aside-inner .wallet-widgets-list-body {

8
assets/css/dashboard.css

@ -18,18 +18,14 @@
box-shadow: 0 3px 10px 0px rgba(0, 0, 0, 0.32);
}
/*#section-iguana-wallet-settings, #section-iguana-atomic-explorer, #section-extcoin {
padding-top: 0;
}*/
.kmd-wallet-header {
background: url("assets/images/bg/kmd_transparent_header_bg.png") !important;
background: url('assets/images/bg/kmd_transparent_header_bg.png') !important;
background-repeat: no-repeat !important;
background-position: 0% !important;
}
#edex-footer {
padding: 0px !important;
padding: 0 !important;
}
.header-easydex {

4
assets/css/progress-bars.css

@ -3,6 +3,6 @@
}
.progress {
margin-bottom: 0px;
border-radius: 0px;
margin-bottom: 0;
border-radius: 0;
}

23
assets/pages/login.css

@ -16,28 +16,27 @@
.page-login a {
color: #9fa8da;
}
@media (max-width: 767px) {
.page-login form {
width: auto;
}
}
.style-addcoin-lbl-mdl-login > label, .style-addcoin-lbl-mdl > label {
.style-addcoin-lbl-mdl-login > label,
.style-addcoin-lbl-mdl > label {
margin: auto;
}
#register-btn, #register-back-btn, #logint-another-wallet {
#register-btn, #register-back-btn,
#logint-another-wallet {
border: 1px solid #5d5d5d;
color: #fff;
}
#register-btn:hover, #register-back-btn:hover, #logint-another-wallet:hover {
#register-btn:hover,
#register-back-btn:hover,
#logint-another-wallet:hover {
border: 1px solid #a7a7a7;
color: #fff;
}
.page-register:before {
background-image: url("../images/DAY_TO_NIGHT_SERENGETI_Master_172.jpg");
background-image: url('../images/DAY_TO_NIGHT_SERENGETI_Master_172.jpg');
}
.page-register a {
color: #9fa8da;
@ -51,6 +50,12 @@
.page-register .form-control:focus + .floating-label {
color: #bdbdbd;
}
@media (max-width: 767px) {
.page-login form {
width: auto;
}
}
@media (max-width: 480px) {
.page-register form {
width: auto;

2
assets/pages/register.css

@ -1,5 +1,5 @@
.page-register:before {
background-image: url("../images/DAY_TO_NIGHT_SERENGETI_Master_172.jpg");
background-image: url('../images/DAY_TO_NIGHT_SERENGETI_Master_172.jpg');
}
.page-register a {
color: #9fa8da;

217
assets/scripts/atomicexplorer.js

@ -1,147 +1,154 @@
var AtomicExplorer = function() {
toastr.options = {
"closeButton": true,
"debug": false,
"positionClass": "toast-top-right",
"showDuration": "5000",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
'closeButton': true,
'debug': false,
'positionClass': 'toast-top-right',
'showDuration': '5000',
'hideDuration': '1000',
'timeOut': '5000',
'extendedTimeOut': '1000',
'showEasing': 'swing',
'hideEasing': 'linear',
'showMethod': 'fadeIn',
'hideMethod': 'fadeOut'
}
var handleExplorer = function() {
$('#atomic_explorer_getcoinpeers_btn').click(function() {
NProgress.done(true);
NProgress.configure({
template: '<div class="bar nprogress-bar-header nprogress-bar-info" role="bar"></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'
template: '<div class="bar nprogress-bar-header nprogress-bar-info" role="bar"></div>' +
'<div class="spinner" role="spinner">' +
'<div class="spinner-icon"></div>' +
'</div>'
});
NProgress.start();
console.log("button pushed in atomic explorer");
var atomic_explorer_select_coin_val = $("select[id='atomic_explorer_select_coin_options']").val();
var atomic_explorer_select_command_val = $("select[id='atomic_explorer_select_command_options']").val();
var atomic_explorer_input_data_val = $("#atomic_explorer_input_data").val();
var atomic_explorer_select_coin_val = $('select[id=\'atomic_explorer_select_coin_options\']').val(),
atomic_explorer_select_command_val = $('select[id=\'atomic_explorer_select_command_options\']').val(),
atomic_explorer_input_data_val = $('#atomic_explorer_input_data').val(),
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ExplorerInputData;
console.log(atomic_explorer_select_coin_val);
console.log(atomic_explorer_select_command_val);
console.log(atomic_explorer_input_data_val);
var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth');
if (atomic_explorer_select_command_val === 'history') {
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"timeout":20000,"agent":"basilisk","method":"history","vals":{"coin":atomic_explorer_select_coin_val,"addresses":[atomic_explorer_input_data_val]}}
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'getbalance') {
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"coin":atomic_explorer_select_coin_val,"method":"getbalance","params":[atomic_explorer_input_data_val]}
console.log(ExplorerInputData);
switch (atomic_explorer_select_command_val) {
case 'history':
ExplorerInputData = {
'userpass': tmpIguanaRPCAuth,
'timeout': 20000,
'agent': 'basilisk',
'method': 'history',
'vals': {
'coin': atomic_explorer_select_coin_val,
'addresses': [atomic_explorer_input_data_val]
}
if (atomic_explorer_select_command_val === 'listunspent') {
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"coin":atomic_explorer_select_coin_val,"method":"listunspent","params":[1, 9999999, [atomic_explorer_input_data_val]]}
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'txid') {
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"coin":atomic_explorer_select_coin_val,"method":"getrawtransaction","params":[atomic_explorer_input_data_val]}
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'blockash') {
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"coin":atomic_explorer_select_coin_val,"agent":"bitcoinrpc","method":"getblockhash","height":atomic_explorer_input_data_val}
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'chaintip') {
};
break;
case 'getbalance':
ExplorerInputData = {
'userpass': tmpIguanaRPCAuth,
'coin': atomic_explorer_select_coin_val,
'method': 'getbalance',
'params': [atomic_explorer_input_data_val]
};
break;
case 'listunspent':
ExplorerInputData = {
'userpass': tmpIguanaRPCAuth,
'coin': atomic_explorer_select_coin_val,
'method': 'listunspent',
'params': [1, 9999999, [atomic_explorer_input_data_val]]
};
break;
case 'txid':
ExplorerInputData = {
'userpass': tmpIguanaRPCAuth,
'coin': atomic_explorer_select_coin_val,
'method': 'getrawtransaction',
'params': [atomic_explorer_input_data_val]
};
break;
case 'blockash':
ExplorerInputData = {
'userpass': tmpIguanaRPCAuth,
'coin': atomic_explorer_select_coin_val,
'agent': 'bitcoinrpc',
'method': 'getblockhash',
'height': atomic_explorer_input_data_val
};
break;
case 'chaintip':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"coin":atomic_explorer_select_coin_val,"agent":"bitcoinrpc","method":"getbestblockhash"}
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'gettransaction') {
break;
case 'gettransaction':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"coin":atomic_explorer_select_coin_val,"agent":"bitcoinrpc","method":"gettransaction","txid":atomic_explorer_input_data_val}
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_getinfo') {
break;
case 'dex_getinfo':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getinfo","symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_getnotaries') {
break;
case 'dex_getnotaries':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getnotaries","symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_alladdresses') {
break;
case 'dex_alladdresses':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"alladdresses","symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_importaddress') {
break;
case 'dex_importaddress':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"importaddress","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_checkaddress') {
break;
case 'dex_checkaddress':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"checkaddress","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_validateaddress') {
break;
case 'dex_validateaddress':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"validateaddress","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_getbestblockhash') {
break;
case 'dex_getbestblockhash':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getbestblockhash","symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_listtransactions') {
break;
case 'dex_listtransactions':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"listtransactions","address":atomic_explorer_input_data_val,"count":100,"skip":0,"symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_listtransactions2') {
break;
case 'dex_listtransactions2':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"listtransactions2","address":atomic_explorer_input_data_val,"count":100,"skip":0,"symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_listunspent') {
break;
case 'dex_listunspent':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"listunspent","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_listspent') {
break;
case 'dex_listspent':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"listspent","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_listunspent2') {
break;
case 'dex_listunspent2':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"listunspent2","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_getblockhash') {
break;
case 'dex_getblockhash':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getblockhash","height":100,"symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_getblock') {
break;
case 'dex_getblock':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getblock","hash":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_gettxin') {
break;
case 'dex_gettxin':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"gettxin","vout":0,"txid":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_gettxout') {
break;
case 'dex_gettxout':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"gettxout","vout":0,"txid":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_gettransaction') {
break;
case 'dex_gettransaction':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"gettransaction","txid":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_getbalance') {
break;
case 'dex_getbalance':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getbalance","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'dex_getsupply') {
break;
case 'dex_getsupply':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"dex","method":"getbalance","address":"*","symbol":atomic_explorer_select_coin_val,"timeout":600000};
console.log(ExplorerInputData);
}
if (atomic_explorer_select_command_val === 'basilisk_refresh') {
break;
case 'basilisk_refresh':
ExplorerInputData = {'userpass':tmpIguanaRPCAuth,"agent":"basilisk","method":"refresh","address":atomic_explorer_input_data_val,"symbol":atomic_explorer_select_coin_val,"timeout":600000}
console.log(ExplorerInputData);
break;
}
console.log(ExplorerInputData);
$.ajax({
type: 'POST',
@ -208,9 +215,7 @@ var AtomicExplorer = function() {
init: function() {
handleExplorer();
}
};
}();
jQuery(document).ready(function() {

1
assets/scripts/dashboard.js

@ -492,7 +492,6 @@ var Dashboard = function() {
}
});
});
}
var handleWalletWidgetBtns = function() {

2
assets/scripts/iguana_api.js

@ -1226,7 +1226,7 @@ function EDEXimportprivkey(params_data) {
}
function Iguana_SetRPCAuth() {
var tmpPass = md5(PassPhraseGenerator.generatePassPhrase(128));
var tmpPass = 1234;//md5(PassPhraseGenerator.generatePassPhrase(128));
sessionStorage.setItem('IguanaRPCAuth', tmpPass);
}

65
assets/scripts/kmd_wallet_dashboard.js

@ -320,6 +320,65 @@ function RunKMDInitFunctions() {
$('#extcoin-wallet').show();
$('#extcoin-wallet-connection-alert').hide();
function getRemoteCurrentHeight() {
$.ajax({
type: 'GET',
url: 'http://localhost:7778/api/dex/getinfo?userpass=tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth') + '&symbol=KMD',
//dataType: 'text',
success: function(data, textStatus, jqXHR) {
//$('#read_debug_log_textarea').text(JSON.parse(data));
if (data && data.info && data.info.blocks) {
totalBlocksInExplorer = data.info.blocks;
}
},
error: function(xhr, textStatus, error) {
console.log('failed getinfo from dex api');
console.log(xhr.statusText);
console.log(textStatus);
console.log(error);
}
});
}
getRemoteCurrentHeight();
var totalBlocksInExplorer = 0;
var totalBlocksInExplorerInterval = setInterval(function() {
getRemoteCurrentHeight();
}, 60000);
var currentBestBlockInterval = setInterval(function() {
$.ajax({
type: 'POST',
data: { 'herdname': 'komodo', 'lastLines': 1 },
url: 'http://127.0.0.1:17777/shepherd/debuglog',
//dataType: 'text',
success: function(data, textStatus, jqXHR) {
//$('#read_debug_log_textarea').text(JSON.parse(data));
if (data.indexOf('UpdateTip') > -1) {
var temp = data.split(' ');
for (var i = 0; i < temp.length; i++) {
if (temp[i].indexOf('height=') > -1) {
var currentBestChain = temp[i].replace('height=', '');
$('#activating-komodod-tridot').hide();
$('#activating-komodod-progress').html(': ' + Math.floor(currentBestChain * 100 / totalBlocksInExplorer) + '% (blocks ' + currentBestChain + ' / ' + totalBlocksInExplorer + ')');
if (currentBestChain === totalBlocksInExplorer) {
clearInterval(totalBlocksInExplorerInterval);
clearInterval(currentBestBlockInterval);
}
}
}
}
},
error: function(xhr, textStatus, error) {
console.log('failed getting debug.log');
console.log(xhr.statusText);
console.log(textStatus);
console.log(error);
}
});
}, 1000);
$('#kmd_wallet_dashoard_section').show();
$('#kmd_wallet_dashboardinfo').show();
$('#kmd_wallet_send').hide();
@ -399,9 +458,9 @@ function getTotalKMDBalance() {
$('#kmd_widget_get_total_balance_tzi').addClass(' col-lg-4');
$('#kmd_widget_get_total_balance_tzi').removeClass(' col-lg-3');
}
$('#kmd_transparent_balance').text(parseFloat(AjaxOutputData.transparent).toFixed(8)+' '+extcoin);
$('#kmd_private_balance').text(parseFloat(AjaxOutputData.private).toFixed(8)+' '+extcoin);
$('#kmd_total_tz_balance').text(parseFloat(AjaxOutputData.total).toFixed(8)+' '+extcoin);
$('#kmd_transparent_balance').text((AjaxOutputData.transparent ? parseFloat(AjaxOutputData.transparent).toFixed(8) : 0) + ' ' + extcoin);
$('#kmd_private_balance').text((AjaxOutputData.private ? parseFloat(AjaxOutputData.private).toFixed(8) : 0) + ' ' + extcoin);
$('#kmd_total_tz_balance').text((AjaxOutputData.total ? parseFloat(AjaxOutputData.total).toFixed(8) : 0) + ' ' + extcoin);
},
error: function(xhr, textStatus, error) {
console.log('failed getting Coin History.');

2
index.html

@ -1184,7 +1184,7 @@
<div role="alert" class="alert alert-info alert-dismissible" data-extcoin="COIN" id="extcoin-wallet-activating-alert" style="display: none;">
<button aria-label="Close" data-dismiss="alert" class="close" type="button"><span aria-hidden="true">×</span></button>
<h4>Activating best chain...</h4>
<h4>Activating best chain<span id="activating-komodod-tridot">...</span><span id="activating-komodod-progress"></span></h4>
<p data-extcoin="COIN" id="extcoin-wallet-connection-alert-text">Komodo daemon has been started and is processing.<br>Please wait while the best chain is being activated.</p>
</div>

Loading…
Cancel
Save