diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js index af58301..e721fdb 100644 --- a/react/src/actions/actionCreators.js +++ b/react/src/actions/actionCreators.js @@ -53,6 +53,7 @@ export const LOAD_APP_CONFIG = 'LOAD_APP_CONFIG'; export const SAVE_APP_CONFIG = 'SAVE_APP_CONFIG'; export const SERVICE_ERROR = 'SERVICE_ERROR'; export const DASHBOARD_ACTIVE_ADDRESS = 'DASHBOARD_ACTIVE_ADDRESS'; +export const LOAD_APP_INFO = 'LOAD_APP_INFO'; var iguanaForks = {}; // forks in mem array @@ -2493,28 +2494,23 @@ export function edexGetTransaction(data) { }); } -/*export function saveAppConfig() { - const payload = { - 'herdname': target, - 'lastLines': linesCount - }; - +export function saveAppConfig(_payload) { return dispatch => { - return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/debuglog', { + return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/appconf', { method: 'POST', headers: { 'Content-Type': 'application/json', }, - body: JSON.stringify(payload), + body: JSON.stringify(_payload), }) .catch(function(error) { console.log(error); - dispatch(triggerToaster(true, 'getDebugLog', 'Error', 'error')); + dispatch(triggerToaster(true, 'saveAppConfig', 'Error', 'error')); }) .then(response => response.json()) - .then(json => dispatch(getDebugLogState(json))) + .then(json => dispatch(getAppConfigState(json))) } -}*/ +} function getAppConfigState(json) { return { @@ -2622,16 +2618,26 @@ export function shepherdPostCoinList(data) { }); } -/*function Shepherd_SendPendValue() { - Shepherd_SysInfo().then(function(result){ - var ram_data = formatBytes(result.totalmem_bytes) - var pend_val = null; - if (ram_data.size === 'GB') { - if (ram_data.ramsize >= '63' ) { pend_val = 16; } - if (ram_data.ramsize >= '31' ) { pend_val = 8; } - if (ram_data.ramsize >= '15' ) { pend_val = 4; } - if (ram_data.ramsize <= '15' ) { pend_val = 1; } - } else { pend_val = 1; } - sessionStorage.setItem('IguanaPendValue', pend_val); - }) -}*/ \ No newline at end of file +function getAppInfoState(json) { + return { + type: LOAD_APP_INFO, + info: json, + } +} + +export function getAppInfo() { + return dispatch => { + return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/appinfo', { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }) + .catch(function(error) { + console.log(error); + dispatch(triggerToaster(true, 'getAppInfo', 'Error', 'error')); + }) + .then(response => response.json()) + .then(json => dispatch(getAppInfoState(json))) + } +} \ No newline at end of file diff --git a/react/src/components/addcoin/addcoin.js b/react/src/components/addcoin/addcoin.js index a8b4077..1761764 100644 --- a/react/src/components/addcoin/addcoin.js +++ b/react/src/components/addcoin/addcoin.js @@ -48,7 +48,6 @@ class AddCoin extends React.Component { saveCoinSelection() { shepherdPostCoinList(this.state.coins) .then(function(json) { - console.log(json); this.toggleActionsMenu(); }.bind(this)); } @@ -56,7 +55,6 @@ class AddCoin extends React.Component { loadCoinSelection() { shepherdGetCoinList() .then(function(json) { - console.log(json); this.setState(Object.assign({}, this.state, { coins: json.result, actionsMenu: false, @@ -156,7 +154,11 @@ class AddCoin extends React.Component { } activateCoin() { - Store.dispatch(addCoin(this.state.coins[0].selectedCoin.split('|')[0], this.state.coins[0].mode, this.state.coins[0].syncOnly)); + Store.dispatch(addCoin( + this.state.coins[0].selectedCoin.split('|')[0], + this.state.coins[0].mode, + this.state.coins[0].syncOnly + )); } dismiss() { @@ -182,13 +184,21 @@ class AddCoin extends React.Component { } activateAllCoins() { - Store.dispatch(addCoin(this.state.coins[0].selectedCoin.split('|')[0], this.state.coins[0].mode, this.state.coins[0].syncOnly)); + Store.dispatch(addCoin( + this.state.coins[0].selectedCoin.split('|')[0], + this.state.coins[0].mode, + this.state.coins[0].syncOnly + )); for (let i = 1; i < this.state.coins.length; i++) { const _item = this.state.coins[i]; setTimeout(function() { - Store.dispatch(addCoin(_item.selectedCoin.split('|')[0], _item.mode, _item.syncOnly)); + Store.dispatch(addCoin( + _item.selectedCoin.split('|')[0], + _item.mode, + _item.syncOnly + )); }, 2000 * i); } } @@ -204,7 +214,12 @@ class AddCoin extends React.Component {
1 ? 'multi' : 'single'} key={'add-coin-' + i}>
- this.updateSelectedCoin(event, i)}> @@ -213,7 +228,12 @@ class AddCoin extends React.Component {
1 ? 'hide' : 'col-sm-4'}> - +
@@ -253,7 +273,7 @@ class AddCoin extends React.Component {
- +
); @@ -265,7 +285,13 @@ class AddCoin extends React.Component { render() { return (
-