mirror of https://github.com/lukechilds/Agama.git
ca333
7 years ago
committed by
GitHub
19 changed files with 825 additions and 518 deletions
@ -1 +1 @@ |
|||
Subproject commit ba50df3108aa7c3dc27583f15e4f85d80ac08cda |
|||
Subproject commit 7399c05db6464596edf4c242f5a3a57445c70ded |
@ -0,0 +1,28 @@ |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
|||
<html> |
|||
<head> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
|||
<link rel="stylesheet" href="EasyDEX-GUI/assets/global/css/bootstrap.min.css"> |
|||
<link rel="stylesheet" href="EasyDEX-GUI/assets/mainWindow/css/jRoll.min.css"> |
|||
<link rel="stylesheet" href="EasyDEX-GUI/assets/mainWindow/css/loading.css"> |
|||
<script type="text/javascript" src="EasyDEX-GUI/assets/mainWindow/js/module-hack.js"></script> |
|||
<script type="text/javascript" src="EasyDEX-GUI/assets/global/vendor/jquery/jquery.min.js"></script> |
|||
<script type="text/javascript" src="EasyDEX-GUI/assets/scripts/config.js"></script> |
|||
<script type="text/javascript" src="EasyDEX-GUI/assets/mainWindow/js/bluebird.min.js"></script> |
|||
<script type="text/javascript" src="EasyDEX-GUI/assets/mainWindow/js/loading.js"></script> |
|||
<script type="text/javascript" src="EasyDEX-GUI/assets/mainWindow/js/jRoll.min.js"></script> |
|||
<script>if (window.module) module = window.module;</script> |
|||
</head> |
|||
<body class="agamaMode"> |
|||
<div class="text-center"> |
|||
<div id="agamaMode"> |
|||
<img src="EasyDEX-GUI/assets/mainWindow/img/agama-icon.svg" class="agama-logo" alt="Agama Wallet" width="80" height="100" /> |
|||
<div id="agamaModeStatus">Another Agama instance is already running!</div> |
|||
<div>Please close all other instaces and restart the app.</div> |
|||
<br /> |
|||
<button onClick="quitApp()" class="btn btn-primary btn-close-app">Quit</button> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript" src="EasyDEX-GUI/assets/mainWindow/js/init.js"></script> |
|||
</body> |
|||
</html> |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 41 KiB |
File diff suppressed because one or more lines are too long
@ -1,48 +0,0 @@ |
|||
$(document).ready(function() { |
|||
const remote = require('electron').remote; |
|||
var window = remote.getCurrentWindow(); |
|||
|
|||
$('#pulse').jRoll({ |
|||
radius: 100, |
|||
animation: 'pulse' |
|||
}); |
|||
|
|||
$('#loading_status_text').text('Starting Iguana daemon...'); |
|||
|
|||
GetAppConf(inititalWalletLoading); |
|||
|
|||
function inititalWalletLoading(appConf) { |
|||
if (appConf && !appConf.manualIguanaStart) { |
|||
StartIguana(); |
|||
} |
|||
|
|||
var portcheck; |
|||
|
|||
function startcheck() { |
|||
portcheck = setInterval(function(){ |
|||
Iguana_activehandle(appConf).then(function(result){ |
|||
console.log(result); |
|||
|
|||
if (result !== 'error') { |
|||
stopcheck(); |
|||
|
|||
if (appConf && appConf.useBasiliskInstance) { |
|||
StartIguana_Cache(); |
|||
} |
|||
|
|||
$('#loading_status_text').text('Connecting to Basilisk Network...'); |
|||
EDEX_DEXgetinfoAll(appConf.skipBasiliskNetworkCheck, appConf.minNotaries, appConf); |
|||
} |
|||
}) |
|||
//var check = Iguana_activehandle();
|
|||
//console.log(check[0])
|
|||
}, 2000); |
|||
} |
|||
|
|||
function stopcheck() { |
|||
clearInterval(portcheck); |
|||
} |
|||
|
|||
startcheck(); |
|||
} |
|||
}); |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,28 +0,0 @@ |
|||
body { |
|||
overflow: hidden !important; |
|||
border: solid 1px #ccc; |
|||
height: 300px; |
|||
} |
|||
|
|||
.text-center { |
|||
text-align: center; |
|||
} |
|||
|
|||
.loader-block { |
|||
height: 240px; |
|||
width: 100%; |
|||
position: absolute; |
|||
top: -30px; |
|||
bottom: 0; |
|||
left: 0; |
|||
right: 0; |
|||
margin: auto; |
|||
} |
|||
|
|||
.pulse-loader { |
|||
position: absolute; |
|||
top: 10px; |
|||
left: -100px; |
|||
margin: 80px 50px; |
|||
width: 400px !important; |
|||
} |
@ -1,189 +0,0 @@ |
|||
function IguanaAJAX(url, ajax_data, timeout) { |
|||
return $.ajax({ |
|||
data: JSON.stringify(ajax_data), |
|||
url: url, |
|||
type: 'POST', |
|||
dataType: 'json', |
|||
timeout: timeout ? timeout : 120000 |
|||
//beforeSend: showLoadingImgFn
|
|||
}) |
|||
.fail(function(xhr, textStatus, error) { |
|||
// handle request failures
|
|||
}); |
|||
} |
|||
|
|||
function Iguana_activehandle(appConf) { |
|||
return new Promise((resolve) => { |
|||
var ajax_data = { |
|||
'agent': 'SuperNET', |
|||
'method': 'activehandle' |
|||
}, |
|||
AjaxOutputData = IguanaAJAX('http://127.0.0.1:' + appConf.iguanaCorePort, ajax_data).done(function(data) { |
|||
//$('#loading_status_text').text('Retrieving active handle...');
|
|||
//console.log(AjaxOutputData.responseText);
|
|||
AjaxOutputData = JSON.parse(AjaxOutputData.responseText) |
|||
//console.log(AjaxOutputData);
|
|||
resolve(AjaxOutputData); |
|||
}) |
|||
.fail(function(xhr, textStatus, error) { |
|||
// $('#loading_status_text').text('Retrieving active handle error!');
|
|||
// handle request failures
|
|||
console.log(xhr.statusText); |
|||
if ( xhr.readyState == 0 ) { |
|||
} |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
}); |
|||
}); |
|||
} |
|||
//Iguana_activehandle().then(function(result){
|
|||
//console.log(result)
|
|||
//})
|
|||
|
|||
function StartIguana() { |
|||
var ajax_data = { 'herd': 'iguana'}; |
|||
|
|||
console.log(ajax_data); |
|||
$.ajax({ |
|||
type: 'POST', |
|||
data: JSON.stringify(ajax_data), |
|||
url: 'http://127.0.0.1:17777/shepherd/herd', |
|||
dataType: 'xml/html/script/json', // expected format for response
|
|||
contentType: 'application/json', // send as JSON
|
|||
success: function(data, textStatus, jqXHR) { |
|||
var AjaxOutputData = JSON.parse(data); |
|||
console.log('== ActiveHandle Data OutPut =='); |
|||
console.log(AjaxOutputData); |
|||
}, |
|||
error: function(xhr, textStatus, error) { |
|||
console.log(xhr.statusText); |
|||
if ( xhr.readyState == 0 ) { |
|||
} |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
function StartIguana_Cache() { |
|||
var ajax_data = { |
|||
'mode': 'basilisk', |
|||
'coin': 'all' |
|||
}; |
|||
var start_iguana_cache= $.ajax({ |
|||
type: 'POST', |
|||
data: JSON.stringify(ajax_data), |
|||
url: 'http://127.0.0.1:17777/shepherd/forks', |
|||
contentType: 'application/json', // send as JSON
|
|||
}) |
|||
start_iguana_cache.done(function(data) { |
|||
_data = JSON.parse(data); |
|||
console.log(_data.result); |
|||
sessionStorage.setItem('IguanaCachePort', _data.result); |
|||
}); |
|||
} |
|||
|
|||
function GetAppConf(cb) { // get iguana app conf
|
|||
var ajax_data = { 'herd': 'iguana' }, |
|||
data = false; |
|||
|
|||
console.log(ajax_data); |
|||
$.ajax({ |
|||
type: 'GET', |
|||
url: 'http://127.0.0.1:17777/shepherd/appconf' |
|||
}) |
|||
.done(function(_data) { |
|||
console.log('== App Conf Data OutPut =='); |
|||
console.log(_data); |
|||
data = _data; |
|||
cb.call(this, data); |
|||
}) |
|||
.fail(function(xhr, textStatus, error) { |
|||
// handle request failures
|
|||
console.log(xhr.statusText); |
|||
if ( xhr.readyState == 0 ) { |
|||
} |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
cb.call(this, data); |
|||
}); |
|||
|
|||
return data; |
|||
} |
|||
|
|||
function EDEX_DEXgetinfoAll(skip, minNotaries, appConf) { |
|||
const remote = require('electron').remote; |
|||
var window = remote.getCurrentWindow(); |
|||
|
|||
if (!skip) { |
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dpow', |
|||
'method': 'notarychains' |
|||
}, |
|||
tmp_index = 0, |
|||
tmp_index_failed = 0, |
|||
get_dex_notarychains = IguanaAJAX('http://127.0.0.1:' + appConf.iguanaCorePort, ajax_data, 10000).done(function(data) { |
|||
get_dex_notarychains = JSON.parse(get_dex_notarychains.responseText); |
|||
if (minNotaries > get_dex_notarychains.length) { // if config value exceeds total num of notaries
|
|||
minNotaries = get_dex_notarychains.length; |
|||
} |
|||
get_dex_notarychains = get_dex_notarychains.splice(0, minNotaries); |
|||
|
|||
$.each(get_dex_notarychains, function( coin_index, coin_value ) { |
|||
console.log(coin_index + ': ' + coin_value); |
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'getinfo', |
|||
'symbol': coin_value |
|||
}; |
|||
|
|||
console.log(ajax_data); |
|||
|
|||
if (coin_value !== 'MESH' || coin_value !== 'CEAL') { |
|||
var getinfo_each_chain = IguanaAJAX('http://127.0.0.1:' + appConf.iguanaCorePort, ajax_data, 10000).done(function(data) { |
|||
getinfo_each_chain = JSON.parse(getinfo_each_chain.responseText); |
|||
console.log(getinfo_each_chain); |
|||
|
|||
tmp_index++; |
|||
$('#loading_sub_status_text').text('Connection status... ' + tmp_index + '/' + get_dex_notarychains.length + ': ' + coin_value); |
|||
|
|||
if (getinfo_each_chain.error === 'less than required responses') { |
|||
$('#loading_sub_status_output_text').text('Output: ' + getinfo_each_chain.error); |
|||
} else { |
|||
$('#loading_sub_status_output_text').text('Output: Connected'); |
|||
} |
|||
|
|||
if ( tmp_index + tmp_index_failed === minNotaries ) { |
|||
console.log('min notaries connected'); |
|||
window.createWindow('open'); |
|||
window.hide(); |
|||
} |
|||
}) |
|||
.fail(function(xhr, textStatus, error) { |
|||
tmp_index_failed++; |
|||
|
|||
if ( tmp_index + tmp_index_failed === minNotaries ) { |
|||
console.log('min notaries connected'); |
|||
window.createWindow('open'); |
|||
window.hide(); |
|||
} |
|||
|
|||
// handle request failures
|
|||
console.log(xhr.statusText); |
|||
if ( xhr.readyState == 0 ) { |
|||
} |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
}); |
|||
} |
|||
}); |
|||
}); |
|||
} else { |
|||
window.createWindow('open'); |
|||
window.hide(); |
|||
} |
|||
} |
@ -1,4 +0,0 @@ |
|||
if (typeof module === 'object') { |
|||
window.module = module; |
|||
module = undefined; |
|||
} |
@ -0,0 +1,30 @@ |
|||
cd gui/EasyDEX-GUI/react |
|||
echo "building gui..." |
|||
rm -rf ./build |
|||
mkdir build |
|||
mkdir build/assets |
|||
cp -R src/assets build/ |
|||
NODE_ENV="production" webpack |
|||
cd ../../../ |
|||
echo "copy patch files" |
|||
rm -rf ./patch.zip |
|||
rm -rf ./patch |
|||
mkdir patch |
|||
mkdir patch/gui |
|||
mkdir patch/gui/EasyDEX-GUI |
|||
mkdir patch/gui/EasyDEX-GUI/react |
|||
mkdir patch/gui/EasyDEX-GUI/react |
|||
cp -R gui/EasyDEX-GUI/react/build patch/gui/EasyDEX-GUI/react/build |
|||
cp -R gui/EasyDEX-GUI/assets patch/gui/EasyDEX-GUI |
|||
cp gui/index.html patch/gui/index.html |
|||
cp ./main.js patch |
|||
cp ./version patch |
|||
cp -R routes patch/routes |
|||
cp -R private patch/private |
|||
echo "package patch.zip" |
|||
cd patch |
|||
zip -r patch.zip gui routes private main.js version |
|||
cd ../ |
|||
cp patch/patch.zip ./ |
|||
rm -rf patch |
|||
echo "patch.zip is ready" |
@ -1,2 +1,3 @@ |
|||
version=0.2.0.1 |
|||
version=0.2.0.21a |
|||
type=e-beta |
|||
minversion=0.2.0.2 |
Loading…
Reference in new issue