committed by
GitHub
9 changed files with 4063 additions and 3640 deletions
@ -1,4 +1,5 @@ |
|||||
if (navigator.appName == 'Microsoft Internet Explorer') { |
if (navigator.appName == 'Microsoft Internet Explorer') { |
||||
$('#section-login').fadeOut(); $('#section-ie-warning').fadeIn(); |
$('#section-login').fadeOut(); |
||||
$(body).css("background-color","#757575"); |
$('#section-ie-warning').fadeIn(); |
||||
|
$(body).css('background-color', '#757575'); |
||||
} |
} |
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,321 +1,341 @@ |
|||||
var WalletSettings = function() { |
var WalletSettings = function() { |
||||
|
var handleWalletExportKeys = function() { |
||||
var handleWalletExportKeys = function() { |
$('.wifkeys-form').validate({ |
||||
$('.wifkeys-form').validate({ |
//errorElement: 'span', //default input error message container
|
||||
//errorElement: 'span', //default input error message container
|
//errorClass: 'help-block', // default input error message class
|
||||
//errorClass: 'help-block', // default input error message class
|
//focusInvalid: false, // do not focus the last invalid input
|
||||
//focusInvalid: false, // do not focus the last invalid input
|
rules: { |
||||
rules: { |
wifkeys_passphrase: { |
||||
wifkeys_passphrase: { |
required: true |
||||
required: true |
} |
||||
} |
}, |
||||
}, |
messages: { |
||||
|
wifkeys_passphrase: { |
||||
messages: { |
required: 'Passphrase is required.' |
||||
wifkeys_passphrase: { |
} |
||||
required: "Passphrase is required." |
}, |
||||
} |
submitHandler: function(form) { |
||||
}, |
console.log('wait till peer ip added to selected coin...') |
||||
|
|
||||
submitHandler: function(form) { |
var Getwifkeys_passphrase = $('#wifkeys_passphrase').val(), |
||||
console.log("wait till peer ip added to selected coin...") |
WifKeyDivContent = ''; |
||||
|
|
||||
var Getwifkeys_passphrase = $("#wifkeys_passphrase").val(); |
//First check which coins are active. Execute API for each mode of wallet
|
||||
|
$.each([ |
||||
var WifKeyDivContent = ''; |
'native', |
||||
|
'basilisk', |
||||
//First check which coins are active. Execute API for each mode of wallet
|
'full'], function( index, value ) { |
||||
$.each([ 'native','basilisk', 'full' ], function( index, value ) { |
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'); |
||||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); |
allcoins_ajax_data = { |
||||
var allcoins_ajax_data = {'userpass':tmpIguanaRPCAuth,"agent":"InstantDEX","method":"allcoins"}; |
'userpass': tmpIguanaRPCAuth, |
||||
$.ajax({ |
'agent': 'InstantDEX', |
||||
type: 'POST', |
'method': 'allcoins' |
||||
data: JSON.stringify(allcoins_ajax_data), |
}; |
||||
url: 'http://127.0.0.1:7778', |
|
||||
//dataType: 'text',
|
$.ajax({ |
||||
success: function(data, textStatus, jqXHR) { |
type: 'POST', |
||||
var AllcoinsDataOutput = JSON.parse(data); |
data: JSON.stringify(allcoins_ajax_data), |
||||
//Only execute further code if that mode has any coins active it. if none, skill checking on them.
|
url: 'http://127.0.0.1:7778', |
||||
if (AllcoinsDataOutput[value].length !== 0 ) { |
success: function(data, textStatus, jqXHR) { |
||||
console.log('== AllCoins Data OutPut =='); |
var AllcoinsDataOutput = JSON.parse(data); |
||||
console.log(value); |
//Only execute further code if that mode has any coins active it. if none, skill checking on them.
|
||||
console.log(AllcoinsDataOutput[value]); |
if (AllcoinsDataOutput[value].length !== 0 ) { |
||||
|
console.log('== AllCoins Data OutPut =='); |
||||
//First Run Encryptwallet API to get wif keys for each active coin
|
console.log(value); |
||||
$.each(AllcoinsDataOutput[value], function(index) { |
console.log(AllcoinsDataOutput[value]); |
||||
|
|
||||
var wifkey_coin_handle = AllcoinsDataOutput[value][index]; |
//First Run Encryptwallet API to get wif keys for each active coin
|
||||
|
$.each(AllcoinsDataOutput[value], function(index) { |
||||
console.log(AllcoinsDataOutput[value][index]); |
|
||||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); |
var wifkey_coin_handle = AllcoinsDataOutput[value][index]; |
||||
var EncryptWallet_ajax_data = {'userpass':tmpIguanaRPCAuth,"agent":"bitcoinrpc","method":"encryptwallet","passphrase":Getwifkeys_passphrase} |
|
||||
$.ajax({ |
console.log(AllcoinsDataOutput[value][index]); |
||||
type: 'POST', |
var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); |
||||
data: JSON.stringify(EncryptWallet_ajax_data), |
var EncryptWallet_ajax_data = {'userpass':tmpIguanaRPCAuth,"agent":"bitcoinrpc","method":"encryptwallet","passphrase":Getwifkeys_passphrase} |
||||
url: 'http://127.0.0.1:7778', |
$.ajax({ |
||||
//dataType: 'text',
|
type: 'POST', |
||||
success: function(data, textStatus, jqXHR) { |
data: JSON.stringify(EncryptWallet_ajax_data), |
||||
var EncryptWalletDataOutput = JSON.parse(data); |
url: 'http://127.0.0.1:7778', |
||||
console.log(EncryptWalletDataOutput[wifkey_coin_handle+'wif']); |
//dataType: 'text',
|
||||
WifKeyDivContent += '<table class="table">'; |
success: function(data, textStatus, jqXHR) { |
||||
WifKeyDivContent += '<tr><td style="width: 5%;"><b>'+wifkey_coin_handle+'</b></td><td>'+EncryptWalletDataOutput[wifkey_coin_handle]+'</td></tr>'; |
var EncryptWalletDataOutput = JSON.parse(data); |
||||
WifKeyDivContent += '<tr><td><b>'+wifkey_coin_handle+'Wif</b></td><td>'+EncryptWalletDataOutput[wifkey_coin_handle+'wif']+'</td></tr>'; |
console.log(EncryptWalletDataOutput[wifkey_coin_handle+'wif']); |
||||
WifKeyDivContent += '</table>'; |
WifKeyDivContent += '<table class="table">'; |
||||
$('#wif-priv-keys').html(WifKeyDivContent); |
WifKeyDivContent += '<tr><td style="width: 5%;"><b>'+wifkey_coin_handle+'</b></td><td>'+EncryptWalletDataOutput[wifkey_coin_handle]+'</td></tr>'; |
||||
}, |
WifKeyDivContent += '<tr><td><b>'+wifkey_coin_handle+'Wif</b></td><td>'+EncryptWalletDataOutput[wifkey_coin_handle+'wif']+'</td></tr>'; |
||||
error: function(xhr, textStatus, error) { |
WifKeyDivContent += '</table>'; |
||||
console.log('failed getting Coin History.'); |
$('#wif-priv-keys').html(WifKeyDivContent); |
||||
console.log(xhr.statusText); |
}, |
||||
if ( xhr.readyState == 0 ) { |
error: function(xhr, textStatus, error) { |
||||
Iguana_ServiceUnavailable(); |
console.log('failed getting Coin History.'); |
||||
} |
console.log(xhr.statusText); |
||||
console.log(textStatus); |
if ( xhr.readyState == 0 ) { |
||||
console.log(error); |
Iguana_ServiceUnavailable(); |
||||
} |
} |
||||
}); |
console.log(textStatus); |
||||
}); |
console.log(error); |
||||
|
} |
||||
//Second run walletpassphrase again to make sure wallet is unlocked as before login.
|
}); |
||||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); |
}); |
||||
var WalletPassphrase_ajax_data = {'userpass':tmpIguanaRPCAuth,"agent":"bitcoinrpc","method":"walletpassphrase","password":Getwifkeys_passphrase,'timeout': '2592000'} |
|
||||
$.ajax({ |
//Second run walletpassphrase again to make sure wallet is unlocked as before login.
|
||||
type: 'POST', |
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
||||
data: JSON.stringify(WalletPassphrase_ajax_data), |
WalletPassphrase_ajax_data = { |
||||
url: 'http://127.0.0.1:7778', |
'userpass': tmpIguanaRPCAuth, |
||||
//dataType: 'text',
|
'agent': 'bitcoinrpc', |
||||
success: function(data, textStatus, jqXHR) { |
'method': 'walletpassphrase', |
||||
var WalletPassphraseDataOutput = JSON.parse(data); |
'password': Getwifkeys_passphrase, |
||||
console.log(WalletPassphraseDataOutput); |
'timeout': '2592000' |
||||
}, |
}; |
||||
error: function(xhr, textStatus, error) { |
|
||||
console.log('failed getting Coin History.'); |
$.ajax({ |
||||
console.log(xhr.statusText); |
type: 'POST', |
||||
if ( xhr.readyState == 0 ) { |
data: JSON.stringify(WalletPassphrase_ajax_data), |
||||
Iguana_ServiceUnavailable(); |
url: 'http://127.0.0.1:7778', |
||||
} |
success: function(data, textStatus, jqXHR) { |
||||
console.log(textStatus); |
var WalletPassphraseDataOutput = JSON.parse(data); |
||||
console.log(error); |
console.log(WalletPassphraseDataOutput); |
||||
} |
}, |
||||
}); |
error: function(xhr, textStatus, error) { |
||||
} |
console.log('failed getting Coin History.'); |
||||
}, |
console.log(xhr.statusText); |
||||
error: function(xhr, textStatus, error) { |
if ( xhr.readyState == 0 ) { |
||||
console.log('failed getting Coin History.'); |
Iguana_ServiceUnavailable(); |
||||
console.log(xhr.statusText); |
} |
||||
if ( xhr.readyState == 0 ) { |
console.log(textStatus); |
||||
Iguana_ServiceUnavailable(); |
console.log(error); |
||||
} |
} |
||||
console.log(textStatus); |
}); |
||||
console.log(error); |
} |
||||
} |
}, |
||||
}); |
error: function(xhr, textStatus, error) { |
||||
}); |
console.log('failed getting Coin History.'); |
||||
} |
console.log(xhr.statusText); |
||||
}); |
if ( xhr.readyState == 0 ) { |
||||
|
Iguana_ServiceUnavailable(); |
||||
$('.wifkeys-form input').keypress(function(e) { |
} |
||||
if (e.which == 13) { |
console.log(textStatus); |
||||
if ($('.wifkeys-form').validate().form()) { |
console.log(error); |
||||
$('.wifkeys-form').submit(); //form validation success, call ajax form submit
|
} |
||||
} |
}); |
||||
return false; |
}); |
||||
} |
} |
||||
}); |
}); |
||||
|
|
||||
|
$('.wifkeys-form input').keypress(function(e) { |
||||
}; |
if (e.which == 13) { |
||||
|
if ($('.wifkeys-form').validate().form()) { |
||||
var handleWalletImportKeys = function() { |
$('.wifkeys-form').submit(); //form validation success, call ajax form submit
|
||||
$('.wifkeys-import-form').validate({ |
} |
||||
//errorElement: 'span', //default input error message container
|
|
||||
//errorClass: 'help-block', // default input error message class
|
return false; |
||||
//focusInvalid: false, // do not focus the last invalid input
|
} |
||||
rules: { |
}); |
||||
import_wifkey: { |
}; |
||||
required: true |
|
||||
} |
var handleWalletImportKeys = function() { |
||||
}, |
$('.wifkeys-import-form').validate({ |
||||
|
//errorElement: 'span', //default input error message container
|
||||
messages: { |
//errorClass: 'help-block', // default input error message class
|
||||
import_wifkey: { |
//focusInvalid: false, // do not focus the last invalid input
|
||||
required: "Private Key is required." |
rules: { |
||||
} |
import_wifkey: { |
||||
}, |
required: true |
||||
|
} |
||||
submitHandler: function(form) { |
}, |
||||
var Getimport_wifkey = $("#import_wifkey").val(); |
messages: { |
||||
//console.log(Getimport_wifkey);
|
import_wifkey: { |
||||
EDEXimportprivkey(Getimport_wifkey).then(function(result){ |
required: 'Private Key is required.' |
||||
console.log(result) |
} |
||||
if ( result.result !== undefined && result.result == 'success' ) { |
}, |
||||
toastr.success("Private Key Imported Successfully!", "Settings Notification"); |
submitHandler: function(form) { |
||||
$("#import_wifkey").val('') |
var Getimport_wifkey = $('#import_wifkey').val(); |
||||
} |
//console.log(Getimport_wifkey);
|
||||
if ( result.error !== undefined && result.error == 'null return from iguana_bitcoinRPC' ) { |
EDEXimportprivkey(Getimport_wifkey).then(function(result){ |
||||
toastr.info("Private Key is not imported.", "Settings Notification"); |
console.log(result) |
||||
toastr.error("null return from iguana_bitcoinRPC", "Settings Notification"); |
if ( result.result !== undefined && result.result == 'success' ) { |
||||
} |
toastr.success('Private Key Imported Successfully!', 'Settings Notification'); |
||||
}) |
$('#import_wifkey').val(''); |
||||
} |
} |
||||
}); |
if ( result.error !== undefined && result.error == 'null return from iguana_bitcoinRPC' ) { |
||||
|
toastr.info('Private Key is not imported.', 'Settings Notification'); |
||||
$('.wifkeys-import-form input').keypress(function(e) { |
toastr.error('null return from iguana_bitcoinRPC', 'Settings Notification'); |
||||
if (e.which == 13) { |
} |
||||
if ($('.wifkeys-import-form').validate().form()) { |
}); |
||||
$('.wifkeys-import-form').submit(); //form validation success, call ajax form submit
|
} |
||||
} |
}); |
||||
return false; |
|
||||
} |
$('.wifkeys-import-form input').keypress(function(e) { |
||||
}); |
if (e.which == 13) { |
||||
|
if ($('.wifkeys-import-form').validate().form()) { |
||||
|
$('.wifkeys-import-form').submit(); //form validation success, call ajax form submit
|
||||
}; |
} |
||||
|
|
||||
return { |
return false; |
||||
//main function to initiate the module
|
} |
||||
init: function() { |
}); |
||||
|
}; |
||||
handleWalletExportKeys(); |
|
||||
handleWalletImportKeys(); |
return { |
||||
} |
//main function to initiate the module
|
||||
|
init: function() { |
||||
}; |
handleWalletExportKeys(); |
||||
|
handleWalletImportKeys(); |
||||
|
} |
||||
|
}; |
||||
}(); |
}(); |
||||
|
|
||||
jQuery(document).ready(function() { |
|
||||
WalletSettings.init(); |
|
||||
}); |
|
||||
|
|
||||
|
|
||||
// DOM Ready =============================================================
|
// DOM Ready =============================================================
|
||||
$(document).ready(function() { |
$(document).ready(function() { |
||||
|
WalletSettings.init(); |
||||
}); |
}); |
||||
|
|
||||
// Functions =============================================================
|
// Functions =============================================================
|
||||
|
|
||||
function Settings_ShowWalletInfo() { |
function Settings_ShowWalletInfo() { |
||||
var CheckLoginData = JSON.parse(sessionStorage.getItem('IguanaActiveAccount')); |
var CheckLoginData = JSON.parse(sessionStorage.getItem('IguanaActiveAccount')); |
||||
console.log(JSON.parse(CheckLoginData)); |
console.log(JSON.parse(CheckLoginData)); |
||||
$("#winfo_pubkey_value").text(JSON.parse(CheckLoginData).pubkey); |
$('#winfo_pubkey_value').text(JSON.parse(CheckLoginData).pubkey); |
||||
$("#winfo_btcpubkey_value").text(JSON.parse(CheckLoginData).btcpubkey); |
$('#winfo_btcpubkey_value').text(JSON.parse(CheckLoginData).btcpubkey); |
||||
$("#winfo_rmd160_value").text(JSON.parse(CheckLoginData).rmd160); |
$('#winfo_rmd160_value').text(JSON.parse(CheckLoginData).rmd160); |
||||
$("#winfo_NXT_value").text(JSON.parse(CheckLoginData).NXT); |
$('#winfo_NXT_value').text(JSON.parse(CheckLoginData).NXT); |
||||
$("#winfo_notary_value").text(JSON.parse(CheckLoginData).notary); |
$('#winfo_notary_value').text(JSON.parse(CheckLoginData).notary); |
||||
$("#winfo_status_value").text(JSON.parse(CheckLoginData).status); |
$('#winfo_status_value').text(JSON.parse(CheckLoginData).status); |
||||
//$("#winfo_duration_value").text(JSON.parse(CheckLoginData).duration);
|
|
||||
} |
} |
||||
|
|
||||
function Settings_ShowCoinPeers() { |
function Settings_ShowCoinPeers() { |
||||
console.log('waiting getpeers api to complete...'); |
console.log('waiting getpeers api to complete...'); |
||||
$("#coin_supernetpeers_h").text(''); |
$('#coin_supernetpeers_h').text(''); |
||||
$("#coin_supernetpeers").text(''); |
$('#coin_supernetpeers').text(''); |
||||
$("#coin_rawpeers_h").text(''); |
$('#coin_rawpeers_h').text(''); |
||||
$("#coin_rawpeers").text(''); |
$('#coin_rawpeers').text(''); |
||||
var settings_selected_coinname_code_val = $("option:selected","#settings_select_coin_options").val(); |
var settings_selected_coinname_code_val = $('option:selected', '#settings_select_coin_options').val(); |
||||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); |
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'); |
||||
var ajax_data = {'userpass':tmpIguanaRPCAuth,"agent":"SuperNET","method":"getpeers","activecoin": settings_selected_coinname_code_val}; |
ajax_data = { |
||||
$.ajax({ |
'userpass': tmpIguanaRPCAuth, |
||||
type: 'POST', |
'agent': 'SuperNET', |
||||
data: JSON.stringify(ajax_data), |
'method': 'getpeers', |
||||
url: 'http://127.0.0.1:7778', |
'activecoin': settings_selected_coinname_code_val |
||||
//dataType: 'text',
|
}; |
||||
success: function(data, textStatus, jqXHR) { |
|
||||
var getCoinPeers = JSON.parse(data); |
|
||||
console.log(getCoinPeers); |
|
||||
|
|
||||
if (getCoinPeers.supernet[0].peers !== undefined ) { |
$.ajax({ |
||||
var supernet_peers_list = getCoinPeers.supernet[0].peers; |
type: 'POST', |
||||
if (supernet_peers_list != 0 ) { |
data: JSON.stringify(ajax_data), |
||||
$("#coin_supernetpeers_h").text(getCoinPeers.supernet[0].coin); |
url: 'http://127.0.0.1:7778', |
||||
$.each(supernet_peers_list, function( index, value ) { |
//dataType: 'text',
|
||||
var br_val = ""; |
success: function(data, textStatus, jqXHR) { |
||||
if ( index != 0 ) { br_val = "<br>" } |
var getCoinPeers = JSON.parse(data); |
||||
$("#coin_supernetpeers").append(br_val+value); |
console.log(getCoinPeers); |
||||
}); |
|
||||
} |
if (getCoinPeers.supernet[0].peers !== undefined ) { |
||||
} |
var supernet_peers_list = getCoinPeers.supernet[0].peers; |
||||
|
if (supernet_peers_list != 0 ) { |
||||
if (getCoinPeers.rawpeers[0].peers !== undefined ) { |
$('#coin_supernetpeers_h').text(getCoinPeers.supernet[0].coin); |
||||
var raw_peers_list = getCoinPeers.rawpeers[0].peers; |
$.each(supernet_peers_list, function( index, value ) { |
||||
if (raw_peers_list != 0 ) { |
var br_val = ''; |
||||
$("#coin_rawpeers_h").text(getCoinPeers.supernet[0].coin); |
|
||||
$.each(raw_peers_list, function( index, value ) { |
if ( index != 0 ) { |
||||
var br_val = ""; |
br_val = '<br>'; |
||||
if ( index != 0 ) { br_val = "<br>" } |
} |
||||
$("#coin_rawpeers").append(br_val+value); |
|
||||
}); |
$('#coin_supernetpeers').append(br_val + value); |
||||
} |
}); |
||||
} |
} |
||||
}, |
} |
||||
error: function(xhr, textStatus, error) { |
|
||||
console.log('failed getting Coin History.'); |
if (getCoinPeers.rawpeers[0].peers !== undefined ) { |
||||
console.log(xhr.statusText); |
var raw_peers_list = getCoinPeers.rawpeers[0].peers; |
||||
if ( xhr.readyState == 0 ) { |
if (raw_peers_list != 0 ) { |
||||
Iguana_ServiceUnavailable(); |
$('#coin_rawpeers_h').text(getCoinPeers.supernet[0].coin); |
||||
} |
$.each(raw_peers_list, function( index, value ) { |
||||
console.log(textStatus); |
var br_val = ''; |
||||
console.log(error); |
|
||||
} |
if ( index != 0 ) { |
||||
}); |
br_val = '<br>'; |
||||
|
} |
||||
|
|
||||
|
$('#coin_rawpeers').append(br_val + value); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
error: function(xhr, textStatus, error) { |
||||
|
console.log('failed getting Coin History.'); |
||||
|
console.log(xhr.statusText); |
||||
|
if ( xhr.readyState == 0 ) { |
||||
|
Iguana_ServiceUnavailable(); |
||||
|
} |
||||
|
console.log(textStatus); |
||||
|
console.log(error); |
||||
|
} |
||||
|
}); |
||||
} |
} |
||||
|
|
||||
|
|
||||
|
|
||||
function Settings_AddCoinPeers() { |
function Settings_AddCoinPeers() { |
||||
console.log("wait till peer ip added to selected coin...") |
console.log('wait till peer ip added to selected coin...') |
||||
var settings_selected_coinname_code_val = $("option:selected","#settings_select_coin_addpeer_options").val(); |
var settings_selected_coinname_code_val = $('option:selected', '#settings_select_coin_addpeer_options').val(), |
||||
var settings_add_peer_ip_val = $("#settings_add_peer_ip").val(); |
settings_add_peer_ip_val = $("#settings_add_peer_ip").val(), |
||||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@'+sessionStorage.getItem('IguanaRPCAuth'); |
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
||||
var ajax_data = {'userpass':tmpIguanaRPCAuth,"agent":"iguana","method":"addnode","activecoin": settings_selected_coinname_code_val,"ipaddr": settings_add_peer_ip_val}; |
ajax_data = { |
||||
|
'userpass': tmpIguanaRPCAuth, |
||||
|
'agent': 'iguana', |
||||
|
'method': 'addnode', |
||||
|
'activecoin': settings_selected_coinname_code_val, |
||||
|
'ipaddr': settings_add_peer_ip_val |
||||
|
}; |
||||
|
|
||||
$.ajax({ |
$.ajax({ |
||||
type: 'POST', |
type: 'POST', |
||||
data: JSON.stringify(ajax_data), |
data: JSON.stringify(ajax_data), |
||||
url: 'http://127.0.0.1:7778', |
url: 'http://127.0.0.1:7778', |
||||
//dataType: 'text',
|
//dataType: 'text',
|
||||
success: function(data, textStatus, jqXHR) { |
success: function(data, textStatus, jqXHR) { |
||||
var getAddCoinPeers = JSON.parse(data); |
var getAddCoinPeers = JSON.parse(data); |
||||
console.log(getAddCoinPeers); |
console.log(getAddCoinPeers); |
||||
if ( getAddCoinPeers.result == 'addnode submitted' ) { |
if ( getAddCoinPeers.result == 'addnode submitted' ) { |
||||
toastr.success(settings_add_peer_ip_val + " added to " + settings_selected_coinname_code_val + " Successfully", "Coin Notification"); |
toastr.success(settings_add_peer_ip_val + ' added to ' + settings_selected_coinname_code_val + ' Successfully', 'Coin Notification'); |
||||
$("#settings_add_peer_ip").val(''); |
$('#settings_add_peer_ip').val(''); |
||||
} |
} |
||||
}, |
}, |
||||
error: function(xhr, textStatus, error) { |
error: function(xhr, textStatus, error) { |
||||
console.log('failed getting Coin History.'); |
console.log('failed getting Coin History.'); |
||||
console.log(xhr.statusText); |
console.log(xhr.statusText); |
||||
if ( xhr.readyState == 0 ) { |
if ( xhr.readyState == 0 ) { |
||||
Iguana_ServiceUnavailable(); |
Iguana_ServiceUnavailable(); |
||||
} |
} |
||||
console.log(textStatus); |
console.log(textStatus); |
||||
console.log(error); |
console.log(error); |
||||
} |
} |
||||
}); |
}); |
||||
} |
} |
||||
|
|
||||
function Settings_LoadDebugLog() { |
function Settings_LoadDebugLog() { |
||||
|
var settings_selected_targed_val = $('option:selected', '#settings_select_debuglog_options').val(), |
||||
|
numLinesToRead = $('#read_debug_log_lines').val(), |
||||
|
ajax_data = { |
||||
|
'herdname': settings_selected_targed_val, |
||||
|
'lastLines': numLinesToRead |
||||
|
}; |
||||
|
|
||||
var settings_selected_targed_val = $("option:selected","#settings_select_debuglog_options").val(); |
$.ajax({ |
||||
var numLinesToRead = $('#read_debug_log_lines').val(); |
type: 'POST', |
||||
var ajax_data = { 'herdname': settings_selected_targed_val, 'lastLines': numLinesToRead }; |
data: ajax_data, |
||||
$.ajax({ |
url: 'http://127.0.0.1:17777/shepherd/debuglog', |
||||
type: 'POST', |
//dataType: 'text',
|
||||
data: ajax_data, |
success: function(data, textStatus, jqXHR) { |
||||
url: 'http://127.0.0.1:17777/shepherd/debuglog', |
$('#read_debug_log_textarea').text(JSON.parse(data).result.replace('\n', '<br/>')); |
||||
//dataType: 'text',
|
console.log(data); |
||||
success: function(data, textStatus, jqXHR) { |
}, |
||||
$('#read_debug_log_textarea').text(JSON.parse(data).result.replace('\n', '<br/>')); |
error: function(xhr, textStatus, error) { |
||||
console.log(data); |
console.log('failed getting debug.log'); |
||||
}, |
console.log(xhr.statusText); |
||||
error: function(xhr, textStatus, error) { |
if ( xhr.readyState == 0 ) { |
||||
console.log('failed getting debug.log'); |
Iguana_ServiceUnavailable(); |
||||
console.log(xhr.statusText); |
} |
||||
if ( xhr.readyState == 0 ) { |
console.log(textStatus); |
||||
Iguana_ServiceUnavailable(); |
console.log(error); |
||||
} |
$('#read_debug_log_textarea').text(error); |
||||
console.log(textStatus); |
} |
||||
console.log(error); |
}); |
||||
$('#read_debug_log_textarea').text(error); |
|
||||
} |
|
||||
}); |
|
||||
} |
} |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue