Browse Source

Merge branch 'redux' into tx-history-improvements

# Conflicts:
#	react/src/components/dashboard/walletsBalance/walletsBalance.js
#	react/src/components/dashboard/walletsData/walletsData.js
#	react/src/components/dashboard/walletsData/walletsData.render.js
all-modes
petitPapillon 8 years ago
parent
commit
3e4e948dff
  1. 4
      assets/mainWindow/css/loading.css
  2. 7
      assets/mainWindow/js/loading.js
  3. 13
      react/change.log
  4. 17
      react/src/actions/actionCreators.js
  5. 2
      react/src/actions/actions/addCoin.js
  6. 6
      react/src/actions/actions/addressBalance.js
  7. 6
      react/src/actions/actions/atomic.js
  8. 7
      react/src/actions/actions/basiliskCache.js
  9. 6
      react/src/actions/actions/basiliskProcessAddress.js
  10. 2
      react/src/actions/actions/basiliskTxHistory.js
  11. 6
      react/src/actions/actions/cli.js
  12. 6
      react/src/actions/actions/coinList.js
  13. 6
      react/src/actions/actions/createWallet.js
  14. 2
      react/src/actions/actions/dexCoins.js
  15. 6
      react/src/actions/actions/edexBalance.js
  16. 6
      react/src/actions/actions/edexGetTx.js
  17. 2
      react/src/actions/actions/fullTxHistory.js
  18. 5
      react/src/actions/actions/getAddrByAccount.js
  19. 5
      react/src/actions/actions/iguanaHelpers.js
  20. 6
      react/src/actions/actions/iguanaInstance.js
  21. 6
      react/src/actions/actions/log.js
  22. 18
      react/src/actions/actions/logout.js
  23. 2
      react/src/actions/actions/nativeBalance.js
  24. 2
      react/src/actions/actions/nativeNewAddress.js
  25. 2
      react/src/actions/actions/nativeSend.js
  26. 21
      react/src/actions/actions/nativeSyncInfo.js
  27. 2
      react/src/actions/actions/nativeTxHistory.js
  28. 6
      react/src/actions/actions/notary.js
  29. 2
      react/src/actions/actions/sendFullBasilisk.js
  30. 49
      react/src/actions/actions/settings.js
  31. 6
      react/src/actions/actions/syncInfo.js
  32. 6
      react/src/actions/actions/syncOnly.js
  33. 6
      react/src/actions/actions/sysInfo.js
  34. 6
      react/src/actions/actions/update.js
  35. 2
      react/src/actions/actions/walletAuth.js
  36. 2
      react/src/actions/storeType.js
  37. 2
      react/src/components/addcoin/addcoin.js
  38. 4
      react/src/components/addcoin/addcoin.render.js
  39. 2
      react/src/components/addcoin/addcoin.scss
  40. 2
      react/src/components/addcoin/addcoinOptionsCrypto.js
  41. 24
      react/src/components/addcoin/coin-selectors.render.js
  42. 18
      react/src/components/dashboard/about/about.js
  43. 2
      react/src/components/dashboard/atomic/atomic.render.js
  44. 8
      react/src/components/dashboard/coinTile/coinTileItem.js
  45. 47
      react/src/components/dashboard/coindDownModal/coindDownModal.js
  46. 46
      react/src/components/dashboard/coindDownModal/coindDownModal.render.js
  47. 4
      react/src/components/dashboard/main/dashboard.render.js
  48. 3
      react/src/components/dashboard/navbar/navbar.js
  49. 2
      react/src/components/dashboard/notifications/notifications.js
  50. 13
      react/src/components/dashboard/sendCoin/sendCoin.js
  51. 71
      react/src/components/dashboard/settings/settings.js
  52. 10
      react/src/components/dashboard/settings/settings.render.js
  53. 2
      react/src/components/dashboard/walletsBalance/walletsBalance.js
  54. 26
      react/src/components/dashboard/walletsBalance/walletsBalance.render.js
  55. 20
      react/src/components/dashboard/walletsData/walletsData.js
  56. 14
      react/src/components/dashboard/walletsData/walletsData.render.js
  57. 7
      react/src/components/dashboard/walletsNative/walletsNative.js
  58. 2
      react/src/components/dashboard/walletsNav/walletsNav.js
  59. 72
      react/src/components/dashboard/walletsProgress/walletsProgress.js
  60. 4
      react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js
  61. 2
      react/src/components/login/login.js
  62. 15
      react/src/components/login/login.render.js
  63. 25
      react/src/components/login/login.scss
  64. 65
      react/src/components/overrides.scss
  65. 12
      react/src/config.js
  66. 9
      react/src/reducers/dashboard.js
  67. 12
      react/src/reducers/index.js
  68. 6
      react/src/translate/translate.js

4
assets/mainWindow/css/loading.css

@ -106,3 +106,7 @@ body.agamaMode {
.btn:last-child {
margin-left: 20px;
}
.btn.btn-primary.btn-close-app {
margin: 0;
}

7
assets/mainWindow/js/loading.js

@ -6,6 +6,13 @@
window.hide();
}
function quitApp() {
const remote = require('electron').remote;
const window = remote.getCurrentWindow();
window.forseCloseApp();
}
function normalStart() {
const remote = require('electron').remote;
let appConf = remote.getCurrentWindow().appConfig;

13
react/change.log

@ -1,3 +1,16 @@
v0.2.0.22a-beta
--------------
UI:
- fixed activating best chain progress update
- prevent running two agama instances
- cli passphru fix
- fixed logout bug
- minor placeholders fixes
- hide address dropdown if wallet has only one address
- komodod crash report modal
- values rounding (up to 6 decimals)
- add coin multi ui reflow fix
v0.2.0.21a-beta
--------------
UI:

17
react/src/actions/actionCreators.js

@ -1,7 +1,6 @@
import 'whatwg-fetch';
import 'bluebird';
import _config from '../config';
import { translate } from '../translate/translate';
import {
GET_ACTIVE_COINS,
@ -26,6 +25,7 @@ import {
DASHBOARD_ACTIVE_COIN_CHANGE,
ACTIVE_COIN_GET_ADDRESSES,
DASHBOARD_ACTIVE_COIN_NATIVE_TXHISTORY,
DISPLAY_COIND_DOWN_MODAL,
START_INTERVAL,
STOP_INTERVAL
} from './storeType';
@ -68,14 +68,6 @@ export * from './actions/iguanaHelpers';
export * from './actions/cli';
export * from './actions/update';
export let Config;
try {
Config = window.require('electron').remote.getCurrentWindow().appConfig;
} catch (e) {
Config = _config;
}
export function changeActiveAddress(address) {
return {
type: DASHBOARD_ACTIVE_ADDRESS,
@ -360,3 +352,10 @@ export function stopInterval(name, intervals) {
name,
}
}
export function toggleCoindDownModal(display) {
return {
type: DISPLAY_COIND_DOWN_MODAL,
displayCoindDownModal: display,
}
}

2
react/src/actions/actions/addCoin.js

@ -1,7 +1,7 @@
import { translate } from '../../translate/translate';
import Config from '../../config';
import {
triggerToaster,
Config,
toggleAddcoinModal,
getDexCoins,
startIguanaInstance,

6
react/src/actions/actions/addressBalance.js

@ -1,9 +1,6 @@
import {
ACTIVE_COIN_GET_ADDRESSES
} from '../storeType';
import { ACTIVE_COIN_GET_ADDRESSES } from '../storeType';
import {
triggerToaster,
Config,
shepherdGroomPost,
getPassthruAgent,
iguanaHashHex
@ -12,6 +9,7 @@ import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
function getKMDAddressesNativeState(json) {
return {

6
react/src/actions/actions/atomic.js

@ -1,12 +1,10 @@
import { ATOMIC } from '../storeType';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function atomic(payload) {
return dispatch => {

7
react/src/actions/actions/basiliskCache.js

@ -1,15 +1,12 @@
import { DASHBOARD_ACTIVE_COIN_GET_CACHE } from '../storeType';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
// TODO: rewrite cache API to use POST
export function deleteCacheFile(_payload) {
return dispatch => {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/groom`, {

6
react/src/actions/actions/basiliskProcessAddress.js

@ -1,12 +1,10 @@
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function checkAddressBasilisk(coin, address) {
const payload = {

2
react/src/actions/actions/basiliskTxHistory.js

@ -1,12 +1,12 @@
import {
triggerToaster,
Config,
getNativeTxHistoryState
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function getBasiliskTransactionsList(coin, address) {
const pubkey = JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey;

6
react/src/actions/actions/cli.js

@ -1,12 +1,10 @@
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import { CLI } from '../storeType';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function shepherdCliPromise(mode, chain, cmd) {
const _payload = {

6
react/src/actions/actions/coinList.js

@ -1,11 +1,9 @@
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function shepherdGetCoinList() {
return new Promise((resolve, reject) => {

6
react/src/actions/actions/createWallet.js

@ -1,12 +1,10 @@
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
function createNewWalletState(json) {
if (json &&

2
react/src/actions/actions/dexCoins.js

@ -1,12 +1,12 @@
import {
triggerToaster,
Config,
dashboardCoinsState
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function getDexCoins() {
const _payload = {

6
react/src/actions/actions/edexBalance.js

@ -1,12 +1,10 @@
import { DASHBOARD_ACTIVE_COIN_BALANCE } from '../storeType';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function iguanaEdexBalance(coin) {
const _payload = {

6
react/src/actions/actions/edexGetTx.js

@ -1,11 +1,9 @@
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function edexGetTransaction(data, dispatch) {
const payload = {

2
react/src/actions/actions/fullTxHistory.js

@ -1,12 +1,12 @@
import {
triggerToaster,
Config,
getNativeTxHistoryState
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function getFullTransactionsList(coin) {
const payload = {

5
react/src/actions/actions/getAddrByAccount.js

@ -1,12 +1,9 @@
import { ACTIVE_COIN_GET_ADDRESSES } from '../storeType';
import {
triggerToaster,
Config
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function getAddressesByAccountState(json, coin, mode) {
if (mode === 'full' ||

5
react/src/actions/actions/iguanaHelpers.js

@ -1,11 +1,8 @@
import {
triggerToaster,
Config
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
import { checkAC } from '../../components/addcoin/payload';
export function getPassthruAgent(coin) {

6
react/src/actions/actions/iguanaInstance.js

@ -1,11 +1,9 @@
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function restartIguanaInstance(pmid) {
return new Promise((resolve, reject) => {

6
react/src/actions/actions/log.js

@ -1,8 +1,6 @@
import { LOG_GUI_HTTP } from '../storeType';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
export function logGuiHttp(payload) {
return dispatch => {

18
react/src/actions/actions/logout.js

@ -1,14 +1,15 @@
import { LOGIN } from '../storeType';
import {
triggerToaster,
Config
} from '../actionCreators';
LOGIN,
LOGOUT
} from '../storeType';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState
} from './log';
function logoutState(json, dispatch) {
function logoutState(json) {
sessionStorage.removeItem('IguanaActiveAccount');
return {
@ -17,6 +18,12 @@ function logoutState(json, dispatch) {
}
}
function logoutResetAppState() {
return {
type: LOGOUT,
}
}
export function logout() {
return dispatch => {
dispatch(walletLock());
@ -68,6 +75,7 @@ function walletLock() {
'response': json,
}));
dispatch(logoutState(json));
dispatch(logoutResetAppState());
})
}
}

2
react/src/actions/actions/nativeBalance.js

@ -1,9 +1,9 @@
import { DASHBOARD_ACTIVE_COIN_NATIVE_BALANCE } from '../storeType';
import {
triggerToaster,
Config,
getPassthruAgent
} from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

2
react/src/actions/actions/nativeNewAddress.js

@ -1,10 +1,10 @@
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config,
getPassthruAgent,
getKMDAddressesNative
} from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

2
react/src/actions/actions/nativeSend.js

@ -2,7 +2,6 @@ import { DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS } from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config,
getPassthruAgent,
iguanaHashHex
} from '../actionCreators';
@ -10,6 +9,7 @@ import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function sendNativeTx(coin, _payload) {
let ajaxDataToHex;

21
react/src/actions/actions/nativeSyncInfo.js

@ -1,14 +1,15 @@
import { SYNCING_NATIVE_MODE } from '../storeType';
import {
triggerToaster,
Config,
getPassthruAgent,
getDebugLog
getDebugLog,
toggleCoindDownModal
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function getSyncInfoNativeKMD(skipDebug) {
const coin = 'KMD';
@ -63,7 +64,8 @@ export function getSyncInfoNativeKMD(skipDebug) {
function getSyncInfoNativeState(json, coin, skipDebug) {
if (coin === 'KMD' &&
json &&
json.error) {
json.error &&
json.error.message.indexOf('Activating best') === -1) {
return getSyncInfoNativeKMD(skipDebug);
} else {
if (json &&
@ -71,12 +73,12 @@ function getSyncInfoNativeState(json, coin, skipDebug) {
Config.cli.default) {
return {
type: SYNCING_NATIVE_MODE,
progress: Config.cli.default ? json.error : json,
progress: json.error,
}
} else {
return {
type: SYNCING_NATIVE_MODE,
progress: Config.cli.default ? json.result : json,
progress: json.result ? json.result : json,
}
}
}
@ -156,13 +158,20 @@ export function getSyncInfoNative(coin, skipDebug) {
'Komodod is down',
'Critical Error',
'error',
false
true
)
);
dispatch(getDebugLog('komodo', 50));
dispatch(toggleCoindDownModal(true));
} else {
json = JSON.parse(json);
}
if (json.error &&
json.error.message.indexOf('Activating best') === -1) {
dispatch(getDebugLog('komodo', 1));
}
dispatch(logGuiHttp({
'timestamp': _timestamp,
'status': 'success',

2
react/src/actions/actions/nativeTxHistory.js

@ -1,9 +1,9 @@
import {
triggerToaster,
Config,
getPassthruAgent,
getNativeTxHistoryState
} from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

6
react/src/actions/actions/notary.js

@ -3,10 +3,8 @@ import {
DASHBOARD_GET_NOTARIES_LIST
} from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

2
react/src/actions/actions/sendFullBasilisk.js

@ -2,9 +2,9 @@ import { DASHBOARD_ACTIVE_COIN_SENDTO } from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config,
getDispatch
} from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

49
react/src/actions/actions/settings.js

@ -6,10 +6,8 @@ import {
LOAD_APP_CONFIG
} from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState
@ -378,7 +376,16 @@ export function saveAppConfig(_payload) {
);
})
.then(response => response.json())
.then(json => dispatch(getAppConfig()))
.then(json => {
dispatch(getAppConfig());
dispatch(
triggerToaster(
'Settings are saved',
translate('TOASTR.SETTINGS_NOTIFICATION'),
'success'
)
);
})
}
}
@ -411,3 +418,35 @@ export function getAppConfig() {
.then(json => dispatch(getAppConfigState(json)))
}
}
export function resetAppConfig() {
return dispatch => {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/appconf/reset`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
})
.catch(function(error) {
console.log(error);
dispatch(
triggerToaster(
'resetAppConfig',
'Error',
'error'
)
);
})
.then(response => response.json())
.then(json => {
dispatch(getAppConfig());
dispatch(
triggerToaster(
'Settings are reset to default',
translate('TOASTR.SETTINGS_NOTIFICATION'),
'success'
)
);
})
}
}

6
react/src/actions/actions/syncInfo.js

@ -1,8 +1,6 @@
import { SYNCING_FULL_MODE } from '../storeType';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

6
react/src/actions/actions/syncOnly.js

@ -3,10 +3,8 @@ import {
SYNC_ONLY_DATA
} from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from '../actionCreators';
import Config from '../../config';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState

6
react/src/actions/actions/sysInfo.js

@ -1,7 +1,5 @@
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

6
react/src/actions/actions/update.js

@ -1,7 +1,5 @@
import {
Config,
triggerToaster
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

2
react/src/actions/actions/walletAuth.js

@ -3,9 +3,9 @@ import {
ACTIVE_HANDLE
} from '../storeType';
import { translate } from '../../translate/translate';
import Config from '../../config';
import {
triggerToaster,
Config,
getMainAddressState,
updateErrosStack
} from '../actionCreators';

2
react/src/actions/storeType.js

@ -43,3 +43,5 @@ export const DASHBOARD_ACTIVE_ADDRESS = 'DASHBOARD_ACTIVE_ADDRESS';
export const LOAD_APP_INFO = 'LOAD_APP_INFO';
export const LOG_GUI_HTTP = 'LOG_GUI_HTTP';
export const CLI = 'CLI';
export const LOGOUT = 'LOGOUT';
export const DISPLAY_COIND_DOWN_MODAL = 'DISPLAY_COIND_DOWN_MODAL';

2
react/src/components/addcoin/addcoin.js

@ -1,7 +1,7 @@
import React from 'react';
import { translate } from '../../translate/translate';
import Config from '../../config';
import {
Config,
addCoin,
toggleAddcoinModal,
triggerToaster,

4
react/src/components/addcoin/addcoin.render.js

@ -42,7 +42,7 @@ const AddCoinRender = function() {
</button>
</span>
{ this.renderCoinSelectors() }
<div className={ 'text-align-center vertical-margin-20 horizontal-margin-0 ' + (this.hasMoreThanOneCoin() ? 'col-sm-12' : 'hide') }>
<div className={ 'text-align-center vertical-margin-20 horizontal-margin-0 padding-bottom-20 ' + (this.hasMoreThanOneCoin() ? 'col-sm-12' : 'hide') }>
<button
type="button"
className="btn btn-primary col-sm-4 float-none"
@ -62,7 +62,7 @@ const AddCoinRender = function() {
<strong>Komodo Daemon</strong> { translate('INDEX.NATIVE_MODE_DESC2') }&nbsp;
<i>Iguana Daemon</i> { translate('INDEX.NATIVE_MODE_DESC3') }.
</p>
<div className="alert alert-icon alert-primary">
<div className="alert alert-icon alert-primary margin-top-20">
<i className="icon md-info-outline"></i>
<strong>{ translate('INDEX.NATIVE_MODE') }</strong> { translate('INDEX.NATIVE_MODE_DESC4') }&nbsp;
<strong>{ translate('INDEX.NATIVE_MODE_DESC5') }</strong>,&nbsp;

2
react/src/components/addcoin/addcoin.scss

@ -3,7 +3,7 @@
}
.vertical-margin-20 {
margin-top: 20px;
margin-top: 10px;
margin-bottom: 20px;
}

2
react/src/components/addcoin/addcoinOptionsCrypto.js

@ -1,6 +1,6 @@
import React from 'react';
import { translate } from '../../translate/translate';
import { Config } from '../../actions/actionCreators';
import Config from '../../config';
class AddCoinOptionsCrypto extends React.Component {
constructor(props) {

24
react/src/components/addcoin/coin-selectors.render.js

@ -11,8 +11,12 @@ const CoinSelectorsRender = function(item, coin, i) {
<div
className={ this.hasMoreThanOneCoin() ? 'multi' : 'single' }
key={ `add-coin-${i}` }>
<div className="col-sm-8">
<div className="form-group">
<div
className={ this.hasMoreThanOneCoin() ? 'col-sm-10' : 'col-sm-8' }
style={{ paddingLeft: !this.hasMoreThanOneCoin() ? '0' : '15px' }}>
<div
className={ this.hasMoreThanOneCoin() && (item.mode === '-1' || item.mode === -1) ? 'col-sm-6 form-group' : 'form-group' }
style={{ paddingLeft: this.hasMoreThanOneCoin() ? '0' : '15px' }}>
<select
className="form-control form-material"
name="selectedCoin"
@ -25,6 +29,20 @@ const CoinSelectorsRender = function(item, coin, i) {
<AddCoinOptionsACFiat appSettings={ this.props.Settings } />
</select>
</div>
<div className={ this.hasMoreThanOneCoin() && (item.mode === '-1' || item.mode === -1) ? 'col-sm-6' : 'hide' }>
<div className="toggle-box padding-bottom-10">
<select
className="form-control form-material"
name="daemonParam"
onChange={ (event) => this.updateDaemonParam(event, i) }
autoFocus>
<option>Daemon param: none</option>
<option value="silent">Daemon param: background process</option>
<option value="reindex">Daemon param: reindex</option>
<option value="rescan">Daemon param: rescan</option>
</select>
</div>
</div>
</div>
<div className={ this.hasMoreThanOneCoin() ? 'hide' : 'col-sm-4' }>
<button
@ -137,7 +155,7 @@ const CoinSelectorsRender = function(item, coin, i) {
<i className="fa fa-trash-o"></i>
</button>
</div>
<div className={ item.mode === '-1' || item.mode === -1 ? 'col-sm-5' : 'hide' }>
<div className={ !this.hasMoreThanOneCoin() && (item.mode === '-1' || item.mode === -1) ? 'col-sm-5 padding-bottom-30' : 'hide' }>
<div className="toggle-box padding-top-3 padding-bottom-10">
<select
className="form-control form-material"

18
react/src/components/dashboard/about/about.js

@ -6,9 +6,10 @@ class About extends React.Component {
<div className="page margin-left-0">
<div className="page-content">
<h2>About Agama</h2>
<p>Agama Wallet is a desktop app that you can use to manage multiple cryptocurrency wallets. When you set up a
<p>
Agama Wallet is a desktop app that you can use to manage multiple cryptocurrency wallets. When you set up a
wallet, you can configure it to operate in one of the following modes:
</p>
<ul>
<li>
<span className="font-weight-600">Basilisk Mode</span>:&nbsp;
@ -32,7 +33,7 @@ class About extends React.Component {
<li>
<span className="font-weight-600">BarterDEX</span>:&nbsp;
Easily exchange cryptocurrencies via a
shapeshift-like service.
shapeshift-like service.&nbsp;
<a href="https://supernet.org/en/technology/whitepapers/easydex-a-practical-native-dex" target="_blank">
(BarterDEX A Practical Native DEX)
</a>
@ -50,13 +51,13 @@ class About extends React.Component {
but you should make proper backups. We do not recommend using it as the primarily wallet for your cryptocurrencies.
</span>
<br/>
<br/><br/>
<span className="font-weight-600">Testers</span>:&nbsp;
<div className="font-weight-600">Testers</div>
You can help us test Agama. Just <a target="_blank" href="https://supernet.org/en/products/agama-wallet">download and install the latest release</a>.
Then, report any bugs you encounter to our developers on the #testing-agama Slack channel.
Then, report any bugs you encounter to our developers on the <a target="_blank" href="https://sprnt.slack.com/messages/C0HT9MH96/">#testing-agama</a> Slack channel.
Your help is greatly appreciated!
<br /><br />
Agama also supports the following desktop apps:
<ul>
<li>
@ -64,10 +65,9 @@ class About extends React.Component {
and lower fees.
</li>
<li>
<span className="font-weight-600">BarterDEX</span>
<span className="font-weight-600">BarterDEX</span>: A decentralized coin exchange.
</li>
</ul>
</p>
</div>
</div>
);

2
react/src/components/dashboard/atomic/atomic.render.js

@ -7,7 +7,7 @@ import AddCoinOptionsACFiat from '../../addcoin/addcoinOptionsACFiat';
const AtomicRender = function () {
return (
<div className="page margin-left-0">
<div className="page margin-left-0 full-height">
<div className="page-content">
<div className="row">
<div className="col-xlg-12 col-md-12">

8
react/src/components/dashboard/coinTile/coinTileItem.js

@ -1,6 +1,5 @@
import React from 'react';
import {
Config,
dashboardChangeActiveCoin,
iguanaActiveHandle,
getAddressesByAccount,
@ -21,6 +20,7 @@ import {
getDebugLog
} from '../../../actions/actionCreators';
import Store from '../../../store';
import Config from '../../../config';
import CoinTileItemRender from './coinTileItem.render';
@ -46,10 +46,12 @@ class CoinTileItem extends React.Component {
const _propsDashboard = this.props.Dashboard;
const syncPercentage = _propsDashboard && _propsDashboard.progress && (parseFloat(parseInt(_propsDashboard.progress.blocks, 10) * 100 / parseInt(this.props.Dashboard.progress.longestchain, 10)).toFixed(2)).replace('NaN', 0);
if (syncPercentage < 100) {
if (syncPercentage < 100 &&
!this.props.Dashboard.displayCoindDownModal) {
Store.dispatch(getDebugLog('komodo', 10));
}
if (_propsDashboard.progress &&
if (!this.props.Dashboard.displayCoindDownModal &&
_propsDashboard.progress &&
_propsDashboard.progress.blocks &&
_propsDashboard.progress.longestchain &&
syncPercentage &&

47
react/src/components/dashboard/coindDownModal/coindDownModal.js

@ -0,0 +1,47 @@
import React from 'react';
import { toggleCoindDownModal } from '../../../actions/actionCreators';
import Store from '../../../store';
import CoindDownModalRender from './coindDownModal.render';
class CoindDownModal extends React.Component {
constructor(props) {
super(props);
this.state = {
display: false,
debugLogCrash: null,
};
this.dismiss = this.dismiss.bind(this);
}
dismiss() {
Store.dispatch(toggleCoindDownModal(false));
}
componentWillReceiveProps(props) {
const coindDownModalProps = props ? props.Dashboard : null;
if (coindDownModalProps &&
coindDownModalProps.displayCoindDownModal !== this.state.display) {
this.setState(Object.assign({}, this.state, {
display: coindDownModalProps.displayCoindDownModal,
}));
setTimeout(() => {
this.setState(Object.assign({}, this.state, {
display: coindDownModalProps.displayCoindDownModal,
}));
}, 100);
}
}
render() {
if (this.state.display) {
return CoindDownModalRender.call(this);
}
return null;
}
}
export default CoindDownModal;

46
react/src/components/dashboard/coindDownModal/coindDownModal.render.js

@ -0,0 +1,46 @@
import React from 'react';
import { translate } from '../../../translate/translate';
const CoindDownModalRender = function () {
return (
<div>
<div
className={ 'modal modal-3d-sign coind-down-modal ' + (this.state.display ? 'show in' : 'fade hide') }
id="AddCoinDilogModel-login">
<div className="modal-dialog modal-center modal-lg">
<div className="modal-content">
<div className="modal-header bg-orange-a400 wallet-send-header">
<button
type="button"
className="close white"
onClick={ this.dismiss }>
<span>×</span>
</button>
<h4 className="modal-title white">Komodod is down!</h4>
</div>
<div className="modal-body">
<div className="vertical-align text-center">
<div className="page-content vertical-align-middle">
<strong>Debug.log (last 50 lines)</strong>
<div className="form-group form-material floating">
<textarea
className="form-control"
value={ this.props.Settings.debugLog }></textarea>
</div>
<button
type="button"
className="btn btn-primary btn-block"
id="loginbtn"
onClick={ this.dismiss }>OK</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div className={ 'modal-backdrop ' + (this.state.display ? 'show in' : 'fade hide') }></div>
</div>
);
};
export default CoindDownModalRender;

4
react/src/components/dashboard/main/dashboard.render.js

@ -15,6 +15,7 @@ import ReceiveCoin from '../receiveCoin/receiveCoin';
import About from '../about/about';
import WalletsNative from '../walletsNative/walletsNative';
import WalletsTxInfo from '../walletsTxInfo/walletsTxInfo';
import CoindDownModal from '../coindDownModal/coindDownModal';
const DashboardRender = function() {
return (
@ -23,6 +24,7 @@ const DashboardRender = function() {
className={ this.isSectionActive('wallets') ? 'page-main' : '' }
id="section-dashboard">
<Navbar {...this.props} />
<CoindDownModal {...this.props} />
<div className={ this.isSectionActive('wallets') ? 'show' : 'hide' }>
<CoinTile {...this.props} />
<WalletsNav {...this.props} />
@ -37,7 +39,7 @@ const DashboardRender = function() {
<div className={ this.isSectionActive('edex') ? 'show' : 'hide' }>
<EDEX {...this.props} />
</div>
<div className={ this.isSectionActive('atomic') ? 'show' : 'hide' }>
<div className={ this.isSectionActive('atomic') ? 'show full-height' : 'hide' }>
<Atomic {...this.props} />
</div>
<div className={ this.isSectionActive('jumblr') ? 'show' : 'hide' }>

3
react/src/components/dashboard/navbar/navbar.js

@ -7,9 +7,9 @@ import {
toggleSyncOnlyModal,
getSyncOnlyForks,
logout,
Config
} from '../../../actions/actionCreators';
import Store from '../../../store';
import Config from '../../../config';
import NavbarRender from './navbar.render';
@ -81,6 +81,7 @@ class Navbar extends React.Component {
)
);
Store.dispatch(logout());
location.reload();
}
openSyncOnlyModal() {

2
react/src/components/dashboard/notifications/notifications.js

@ -1,6 +1,6 @@
import React from 'react';
import { sortByDate } from '../../../util/sort';
import { Config } from '../../../actions/actionCreators';
import Config from '../../../config';
import {
NotificationsByTypeRender,
NotificationsModalRender,

13
react/src/components/dashboard/sendCoin/sendCoin.js

@ -94,7 +94,8 @@ class SendCoin extends React.Component {
}
componentWillReceiveProps(props) {
if (!this.state.sendFrom &&
if (this.state &&
!this.state.sendFrom &&
this.props.ActiveCoin.activeAddress) {
this.setState(Object.assign({}, this.state, {
sendFrom: this.props.ActiveCoin.activeAddress,
@ -440,7 +441,7 @@ class SendCoin extends React.Component {
json.completed === true) {
Store.dispatch(
triggerToaster(
translate('TOASTR.SIGNED_TX_GENERATED') + '.',
translate('TOASTR.SIGNED_TX_GENERATED'),
translate('TOASTR.WALLET_NOTIFICATION'),
'success'
)
@ -482,7 +483,7 @@ class SendCoin extends React.Component {
return new Promise(function(resolve, reject) {
Store.dispatch(
triggerToaster(
translate('TOASTR.GETTING_TXID_INFO') + '.',
translate('TOASTR.GETTING_TXID_INFO'),
translate('TOASTR.WALLET_NOTIFICATION'),
'info'
)
@ -540,7 +541,7 @@ class SendCoin extends React.Component {
Store.dispatch(
triggerToaster(
translate('TOASTR.AWAITING_TX_RESP') + '...',
`${translate('TOASTR.AWAITING_TX_RESP')}...`,
translate('TOASTR.WALLET_NOTIFICATION'),
'info'
)
@ -549,7 +550,7 @@ class SendCoin extends React.Component {
function waterfallUTXOProcess() {
Store.dispatch(
triggerToaster(
translate('TOASTR.PROCESSING_UTXO') + '...',
`${translate('TOASTR.PROCESSING_UTXO')}...`,
translate('TOASTR.WALLET_NOTIFICATION'),
'info'
)
@ -590,7 +591,7 @@ class SendCoin extends React.Component {
Store.dispatch(sendToAddressStateAlt(json));
Store.dispatch(
triggerToaster(
`${translate('TOASTR.SIGNED_TX_GENERATED_FAIL')}.`,
`${translate('TOASTR.SIGNED_TX_GENERATED_FAIL')}`,
translate('TOASTR.WALLET_NOTIFICATION'),
'error'
)

71
react/src/components/dashboard/settings/settings.js

@ -1,7 +1,7 @@
import React from 'react';
import { translate } from '../../../translate/translate';
import Config from '../../../config';
import {
Config,
iguanaActiveHandle,
encryptWallet,
settingsWifkeyState,
@ -11,10 +11,11 @@ import {
addPeerNode,
getAppConfig,
saveAppConfig,
resetAppConfig,
getAppInfo,
shepherdCli,
checkForUpdateUIPromise,
updateUIPromise
updateUIPromise,
} from '../../../actions/actionCreators';
import Store from '../../../store';
@ -49,7 +50,7 @@ class Settings extends React.Component {
activeTabHeight: '0',
appSettings: {},
tabElId: null,
cliCmdString: null,
cliCmdString: '',
cliCoin: null,
cliResponse: null,
exportWifKeysRaw: false,
@ -72,6 +73,7 @@ class Settings extends React.Component {
this.renderPeersList = this.renderPeersList.bind(this);
this.renderSNPeersList = this.renderSNPeersList.bind(this);
this._saveAppConfig = this._saveAppConfig.bind(this);
this._resetAppConfig = this._resetAppConfig.bind(this);
this.exportWifKeysRaw = this.exportWifKeysRaw.bind(this);
this.toggleSeedInputVisibility = this.toggleSeedInputVisibility.bind(this);
this._checkForUpdateUIPromise = this._checkForUpdateUIPromise.bind(this);
@ -97,6 +99,10 @@ class Settings extends React.Component {
}
}
_resetAppConfig() {
Store.dispatch(resetAppConfig());
}
resizeLoginTextarea() {
// auto-size textarea
setTimeout(() => {
@ -473,11 +479,14 @@ class Settings extends React.Component {
);
}
// TODO: rerender only if prop is changed
renderCliResponse() {
const _cliResponse = this.props.Settings.cli;
let _items = [];
if (_cliResponse) {
let _cliResponseParsed;
let responseType;
try {
_cliResponseParsed = JSON.parse(_cliResponse.result);
@ -485,44 +494,42 @@ class Settings extends React.Component {
_cliResponseParsed = _cliResponse.result;
}
let __cliResponseParsed;
if (typeof _cliResponseParsed !== 'object' &&
typeof _cliResponseParsed !== 'number' &&
_cliResponseParsed !== 'wrong cli string format' &&
_cliResponseParsed.indexOf('\r\n') > -1) {
_cliResponseParsed = _cliResponseParsed.split('\r\n') ;
} else if (
typeof _cliResponseParsed !== 'object' &&
typeof _cliResponseParsed !== 'number' &&
_cliResponseParsed !== 'wrong cli string format' &&
_cliResponseParsed.indexOf('\n') > -1
) {
__cliResponseParsed = _cliResponseParsed.split('\n') ;
} else {
__cliResponseParsed = _cliResponseParsed;
}
let _items = [];
if (Object.prototype.toString.call(_cliResponseParsed) === '[object Array]') {
responseType = 'array';
if (__cliResponseParsed.length &&
__cliResponseParsed !== 'wrong cli string format') {
for (let i = 0; i < __cliResponseParsed.length; i++) {
for (let i = 0; i < _cliResponseParsed.length; i++) {
_items.push(
<div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ typeof __cliResponseParsed[i] === 'object' ? JSON.stringify(__cliResponseParsed[i], null, '\t') : __cliResponseParsed[i] }</div>
<div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ JSON.stringify(_cliResponseParsed[i], null, '\t') }</div>
);
}
} else {
if (typeof _cliResponseParsed === 'object') {
}
if (Object.prototype.toString.call(_cliResponseParsed) === '[object]' ||
typeof _cliResponseParsed === 'object') {
responseType = 'object';
_items.push(
<div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ JSON.stringify(__cliResponseParsed, null, '\t') }</div>
<div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ JSON.stringify(_cliResponseParsed, null, '\t') }</div>
);
} else if (typeof _cliResponseParsed === 'string' || typeof _cliResponseParsed === 'number' || _cliResponseParsed === 'wrong cli string format') {
}
if (Object.prototype.toString.call(_cliResponseParsed) === 'number' ||
typeof _cliResponseParsed === 'boolean' ||
_cliResponseParsed === 'wrong cli string format') {
responseType = 'number';
_items.push(
<div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ __cliResponseParsed }</div>
<div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ _cliResponseParsed.toString() }</div>
);
} else {
}
if (responseType !== 'number' &&
responseType !== 'array' &&
responseType !== 'object' &&
_cliResponseParsed.indexOf('\n') > -1) {
_cliResponseParsed = _cliResponseParsed.split('\n');
for (let i = 0; i < _cliResponseParsed.length; i++) {
_items.push(
<div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ translate('INDEX.NO_DATA_AVAILABLE') }</div>
<div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ _cliResponseParsed[i] }</div>
);
}
}

10
react/src/components/dashboard/settings/settings.render.js

@ -338,7 +338,7 @@ export const SettingsRender = function() {
className={ 'panel-collapse collapse' + (this.state.activeTab === 4 ? ' in' : '') }
style={{ height: this.state.activeTab === 4 ? `${this.state.activeTabHeight}px` : '0' }}>
<div className="panel-body">
<p>
<div>
<div className="padding-bottom-20">{ this.renderLB('INDEX.ONLY_ACTIVE_WIF_KEYS') }</div>
<div className="padding-bottom-20">
<i>{ this.renderLB('SETTINGS.EXPORT_KEYS_NOTE') }</i>
@ -346,7 +346,7 @@ export const SettingsRender = function() {
<strong>
<i>{ translate('INDEX.PLEASE_KEEP_KEYS_SAFE') }</i>
</strong>
</p>
</div>
<div className="col-sm-12"></div>
<form
className="wifkeys-form"
@ -538,6 +538,10 @@ export const SettingsRender = function() {
type="button"
className="btn btn-primary waves-effect waves-light"
onClick={ this._saveAppConfig }>{ translate('SETTINGS.SAVE_APP_CONFIG') }</button>
<button
type="button"
className="btn btn-primary waves-effect waves-light margin-left-30"
onClick={ this._resetAppConfig }>Reset to default</button>
</div>
</div>
</div>
@ -570,7 +574,7 @@ export const SettingsRender = function() {
name="cliCoin"
id="settingsCliOptions"
onChange={ this.updateInput }>
<option value="">{ translate('INDEX.CLI_NATIVE_COIN') }</option>
<option>{ translate('INDEX.CLI_NATIVE_COIN') }</option>
{ this.renderActiveCoinsList('native') }
</select>
<label

2
react/src/components/dashboard/walletsBalance/walletsBalance.js

@ -95,7 +95,7 @@ class WalletsBalance extends React.Component {
const _translationComponents = translate(_translationID).split('<br>');
return _translationComponents.map((_translation) =>
<span key={_translation}>
<span key={ `translate-${Math.random(0, 9) * 10}` }>
{_translation}
<br />
</span>

26
react/src/components/dashboard/walletsBalance/walletsBalance.render.js

@ -1,5 +1,7 @@
import React from 'react';
import { translate } from '../../../translate/translate';
import { formatValue } from '../../../util/formatValue';
import Config from '../../../config';
const WalletsBalanceRender = function() {
return (
@ -30,12 +32,14 @@ const WalletsBalanceRender = function() {
<i className="icon fa-eye font-size-24 vertical-align-bottom margin-right-5"></i>
{ this.isNativeMode() ? translate('INDEX.TRANSPARENT_BALANCE') : translate('INDEX.BALANCE') }
</div>
<span className="pull-right padding-top-10 font-size-22">
<span
className="pull-right padding-top-10 font-size-22"
title={ Config.roundValues ? this.renderBalance('main') : null }>
{ this.isNativeMode() ?
this.props.ActiveCoin.balance.transparent ? this.props.ActiveCoin.balance.transparent : '-'
:
<span>
{ this.renderBalance('main') } { this.props.ActiveCoin.coin }
{ Config.roundValues ? formatValue('round', this.renderBalance('main'), -6) : this.renderBalance('main') } { this.props.ActiveCoin.coin }
</span>
}
</span>
@ -54,8 +58,10 @@ const WalletsBalanceRender = function() {
<i className="icon fa-eye-slash font-size-24 vertical-align-bottom margin-right-5"></i>
{ translate('INDEX.Z_BALANCE') }
</div>
<span className="pull-right padding-top-10 font-size-22">
{ this.props.ActiveCoin.balance.private ? this.props.ActiveCoin.balance.private : '-' }
<span
className="pull-right padding-top-10 font-size-22"
title={ Config.roundValues ? this.props.ActiveCoin.balance.private : null }>
{ this.props.ActiveCoin.balance.private ? (Config.roundValues ? formatValue('round', this.props.ActiveCoin.balance.private, -6) : this.props.ActiveCoin.balance.private) : '-' }
</span>
</div>
</div>
@ -73,13 +79,15 @@ const WalletsBalanceRender = function() {
<i className="icon fa-money font-size-24 vertical-align-bottom margin-right-5"></i>
{ translate('INDEX.INTEREST_EARNED') }
</div>
<span className="pull-right padding-top-10 font-size-22">
<span
className="pull-right padding-top-10 font-size-22"
title={ Config.roundValues ? this.renderBalance('interest') : null }>
{ this.isNativeMode() ?
this.props.Dashboard.progress
&& this.props.Dashboard.progress.interest ? this.props.Dashboard.progress.interest : '-'
:
<span>
{this.renderBalance('interest')} {this.props.ActiveCoin.coin}
{ Config.roundValues ? formatValue('round', this.renderBalance('interest'), -6) : this.renderBalance('interest') } { this.props.ActiveCoin.coin }
</span>
}
</span>
@ -99,12 +107,14 @@ const WalletsBalanceRender = function() {
<i className="icon fa-bullseye font-size-24 vertical-align-bottom margin-right-5"></i>
{ translate('INDEX.TOTAL_BALANCE') }
</div>
<span className="pull-right padding-top-10 font-size-22">
<span
className="pull-right padding-top-10 font-size-22"
title={ Config.roundValues ? this.renderBalance('total') : null }>
{ this.isNativeMode() ?
this.props.ActiveCoin.balance.total ? this.props.ActiveCoin.balance.total : '-'
:
<span>
{ this.renderBalance('total') } { this.props.ActiveCoin.coin }
{ Config.roundValues ? formatValue('round', this.renderBalance('total'), -6) : this.renderBalance('total') } { this.props.ActiveCoin.coin }
</span>
}
</span>

20
react/src/components/dashboard/walletsData/walletsData.js

@ -1,8 +1,9 @@
import React from 'react';
import { translate } from '../../../translate/translate';
import { sortByDate } from '../../../util/sort';
import { formatValue } from '../../../util/formatValue';
import Config from '../../../config';
import {
Config,
basiliskRefresh,
basiliskConnection,
toggleDashboardTxInfoModal,
@ -321,16 +322,21 @@ class WalletsData extends React.Component {
}
}
// TODO: add basilisk first run check, display no data if second run
renderTxHistoryList() {
if (this.state.itemsList === 'loading') {
if (!this.isNativeMode() || this.isFullySynced()) {
return (
<div>{ translate('INDEX.LOADING_HISTORY') }...</div>
<tr>
<td colSpan="6">{ translate('INDEX.LOADING_HISTORY') }...</td>
</tr>
);
}
} else if (this.state.itemsList === 'no data') {
return (
<div>{ translate('INDEX.NO_DATA') }</div>
<tr>
<td colSpan="6">{ translate('INDEX.NO_DATA') }</td>
</tr>
);
} else if (this.state.itemsList && this.state.itemsList.length) {
return TxHistoryListRender.call(this);
@ -392,6 +398,8 @@ class WalletsData extends React.Component {
_amount = _cache && _cache[_coin] && _cache[_coin][address] && _cache[_coin][address].getbalance.data && _cache[_coin][address].getbalance.data.balance ? _cache[_coin][address].getbalance.data.balance : 'N/A';
}
_amount = formatValue('round', _amount, -6);
items.push(
AddressItemRender.call(this, address, type, _amount, _coin)
);
@ -425,7 +433,11 @@ class WalletsData extends React.Component {
return _addresses.public[i].amount;
} else {
const address = _addresses.public[i].address;
return _cache && _cache[_coin] && _cache[_coin][address] && _cache[_coin][address].getbalance.data && _cache[_coin][address].getbalance.data.balance ? _cache[_coin][address].getbalance.data.balance : 'N/A';
let _amount = _cache && _cache[_coin] && _cache[_coin][address] && _cache[_coin][address].getbalance.data && _cache[_coin][address].getbalance.data.balance ? _cache[_coin][address].getbalance.data.balance : 'N/A';
_amount = formatValue('round', _amount, -6);
return _amount;
}
}
}

14
react/src/components/dashboard/walletsData/walletsData.render.js

@ -6,6 +6,8 @@ import WalletsNotariesList from '../walletsNotariesList/walletsNotariesList';
import WalletsCacheData from '../walletsCacheData/walletsCacheData';
import ReactTable from 'react-table';
import TablePaginationRenderer from './pagination';
import { formatValue } from '../../../util/formatValue';
import Config from '../../../config';
// TODO: clean basilisk dropdown menu
@ -58,6 +60,11 @@ export const AddressItemRender = function(address, type, amount, coin) {
};
export const AddressListRender = function() {
const isMultiPublicAddress = this.props.ActiveCoin.addresses && this.props.ActiveCoin.addresses.public && this.props.ActiveCoin.addresses.public.length > 1;
const isMultiPrivateAddress = this.props.ActiveCoin.addresses && this.props.ActiveCoin.addresses.private && this.props.ActiveCoin.addresses.private.length > 1;
if (isMultiPublicAddress ||
isMultiPrivateAddress) {
return (
<div className={ `btn-group bootstrap-select form-control form-material showkmdwalletaddrs show-tick ${(this.state.addressSelectorOpen ? 'open' : '')}` }>
<button
@ -80,6 +87,9 @@ export const AddressListRender = function() {
</div>
</div>
);
} else {
return null;
}
};
export const TxTypeRender = function(category) {
@ -146,7 +156,7 @@ export const WalletsDataRender = function() {
<WalletsNotariesList {...this.props} />
<WalletsCacheData {...this.props} />
<div id="edexcoin_dashboardinfo">
<div className="col-xs-12 margin-top-20">
<div className="col-xs-12 margin-top-20 backround-gray">
<div className="panel nav-tabs-horizontal">
<div>
<div className="col-xlg-12 col-lg-12 col-sm-12 col-xs-12">
@ -162,7 +172,7 @@ export const WalletsDataRender = function() {
</div>
{ !this.isNativeMode() ?
<div
className={ 'dropdown' + (this.state.basiliskActionsMenu ? ' open' : '') }
className={ 'dropdown basilisk-actions' + (this.state.basiliskActionsMenu ? ' open' : '') }
onClick={ this.toggleBasiliskActionsMenu }>
<a className="dropdown-toggle btn-xs btn-default">
<i className="icon fa-magic margin-right-10"></i> { translate('INDEX.BASILISK_ACTIONS') }

7
react/src/components/dashboard/walletsNative/walletsNative.js

@ -1,11 +1,8 @@
import React from 'react';
import WalletsNativeRender from './walletsNative.render';
import { translate } from '../../../translate/translate';
import {
Config,
triggerToaster
} from '../../../actions/actionCreators';
import { triggerToaster } from '../../../actions/actionCreators';
import Config from '../../../config';
import Store from '../../../store';
import { SocketProvider } from 'socket.io-react';

2
react/src/components/dashboard/walletsNav/walletsNav.js

@ -1,6 +1,5 @@
import React from 'react';
import {
Config,
copyCoinAddress,
iguanaEdexBalance,
toggleSendCoinForm,
@ -9,6 +8,7 @@ import {
toggleDashboardActiveSection
} from '../../../actions/actionCreators';
import Store from '../../../store';
import Config from '../../../config';
import {
WalletsNavNoWalletRender,
WalletsNavWithWalletRender

72
react/src/components/dashboard/walletsProgress/walletsProgress.js

@ -47,7 +47,58 @@ class WalletsProgress extends React.Component {
}
}
parseActivatingBestChainProgress() {
let _debugLogLine;
if (this.props.Settings.debugLog.indexOf('\n') > -1) {
const _debugLogMulti = this.props.Settings.debugLog.split('\n');
for (let i = 0; i < _debugLogMulti.length; i++) {
if (_debugLogMulti[i].indexOf('progress=') > -1) {
_debugLogLine = _debugLogMulti[i];
}
}
} else {
_debugLogLine = this.props.Settings.debugLog;
}
if (_debugLogLine) {
const temp = _debugLogLine.split(' ');
let currentBestChain;
let currentProgress;
for (let i = 0; i < temp.length; i++) {
if (temp[i].indexOf('height=') > -1) {
currentBestChain = temp[i].replace('height=', '');
}
if (temp[i].indexOf('progress=') > -1) {
currentProgress = Number(temp[i].replace('progress=', '')) * 1000;
}
}
return [
currentBestChain,
currentProgress
];
}
}
renderSyncPercentagePlaceholder() {
// activating best chain
if (this.props.Dashboard.progress &&
this.props.Dashboard.progress.code &&
this.props.Dashboard.progress.code === -28 &&
this.props.Settings.debugLog) {
const _progress = this.parseActivatingBestChainProgress();
if (_progress &&
_progress[1]) {
return SyncPercentageRender.call(this, _progress[1].toFixed(2));
} else {
return LoadingBlocksRender.call(this);
}
}
if (this.props.Dashboard.progress &&
this.props.Dashboard.progress.blocks > 0 &&
this.props.Dashboard.progress.longestchain === 0) {
@ -120,9 +171,30 @@ class WalletsProgress extends React.Component {
}
}
// activating best chain
if (this.props.Dashboard.progress &&
this.props.Dashboard.progress.code &&
this.props.Dashboard.progress.code === -28 &&
this.props.Settings.debugLog) {
const _blocks = this.parseActivatingBestChainProgress();
if (_blocks &&
_blocks[0]) {
return (
`: ${_blocks[0]} (current block)`
);
} else {
return null;
}
} else {
if (currentProgress) {
return (
`: ${currentProgress}% (${ translate('INDEX.RESCAN_SM') })`
);
} else {
return null;
}
}
} else if (
this.props.Settings.debugLog.indexOf('LoadExternalBlockFile:') > -1 ||
this.props.Settings.debugLog.indexOf('Reindexing block file') > -1

4
react/src/components/dashboard/walletsTxInfo/walletsTxInfo.render.js

@ -1,6 +1,8 @@
import React from 'react';
import { translate } from '../../../translate/translate';
import { secondsToString } from '../../../util/time';
import { formatValue } from '../../../util/formatValue';
import Config from '../../../config';
const WalletsTxInfoRender = function(txInfo) {
return (
@ -55,7 +57,7 @@ const WalletsTxInfoRender = function(txInfo) {
<tr>
<td>{ translate('TX_INFO.AMOUNT') }</td>
<td>
{ txInfo.amount }
{ Config.roundValues ? formatValue('round', txInfo.amount, -10) : txInfo.amount }
</td>
</tr>
<tr>

2
react/src/components/login/login.js

@ -1,6 +1,5 @@
import React from 'react';
import {
Config,
toggleAddcoinModal,
iguanaWalletPassphrase,
iguanaActiveHandle,
@ -11,6 +10,7 @@ import {
createNewWallet,
triggerToaster
} from '../../actions/actionCreators';
import Config from '../../config';
import Store from '../../store';
import { PassPhraseGenerator } from '../../util/crypto/passphrasegenerator';
import SwallModalRender from './swall-modal.render';

15
react/src/components/login/login.render.js

@ -159,33 +159,36 @@ const LoginRender = function () {
<div className="form-group form-material floating">
<div
className="radio-custom radio-default radio-inline"
onClick={ () => this.generateNewSeed(256) }>
onClick={ () =>this.state.bitsOption !== 256 && this.generateNewSeed(256) }>
<input
type="radio"
name="PassPhraseOptions"
checked={ this.state.bitsOption === 256 }/>
checked={ this.state.bitsOption === 256 }
readOnly />
<label htmlFor="PassPhraseOptionsIguana">
{ translate('LOGIN.IGUANA_SEED') }
</label>
</div>
<div
className="radio-custom radio-default radio-inline"
onClick={ () => this.generateNewSeed(160) }>
onClick={ () => this.state.bitsOption !== 160 && this.generateNewSeed(160) }>
<input
type="radio"
name="PassPhraseOptions"
checked={ this.state.bitsOption === 160 }/>
checked={ this.state.bitsOption === 160 }
readOnly />
<label htmlFor="PassPhraseOptionsWaves">
{ translate('LOGIN.WAVES_SEED') }
</label>
</div>
<div
className="radio-custom radio-default radio-inline"
onClick={ () => this.generateNewSeed(128) }>
onClick={ () => this.state.bitsOption !== 128 && this.generateNewSeed(128) }>
<input
type="radio"
name="PassPhraseOptions"
checked={ this.state.bitsOption === 128 }/>
checked={ this.state.bitsOption === 128 }
readOnly />
<label htmlFor="PassPhraseOptionsNXT">
{ translate('LOGIN.NXT_SEED') }
</label>

25
react/src/components/login/login.scss

@ -16,6 +16,17 @@
}
button {
&.copy-floating-label {
position: absolute;
font-weight: 500;
font-size: 14px;
top: -22px;
right: 0;
background-color: #757575;
border: 0;
cursor: pointer;
z-index: 1000;
}
&.swal2-confirm-container {
background-color: rgb(48, 133, 214);
border-left-color: rgb(48, 133, 214);
@ -111,14 +122,8 @@ input[type="password"] {
margin-right: auto;
}
button.copy-floating-label {
position: absolute;
font-weight: 500;
font-size: 11.2px;
top: -11px;
right: 0;
background-color: #757575;
border: 0;
cursor: pointer;
z-index: 1000;
.register-form {
.floating-label {
font-size: 13px;
}
}

65
react/src/components/overrides.scss

@ -40,14 +40,17 @@ body {
.panel-title {
cursor: pointer;
cursor: hand;
}
.panel-title:before {
&:before {
content: '\F273';
}
.panel-title.collapsed:before {
&.collapsed {
&:before {
content: '\F278';
}
}
}
}
#section-dashboard {
height: 100%;
@ -145,10 +148,11 @@ body {
.display-sync-only-coins-toggle {
cursor: pointer;
}
.display-sync-only-coins-toggle:hover {
&:hover {
color: #ffa726;
}
}
.btn-add-coin-item,
.btn-add-coin-item-options,
@ -197,13 +201,17 @@ body {
margin-right: 8%;
padding: 0;
.input.to-labelauty+label {
.input{
&.to-labelauty+label {
max-width: 136px;
}
}
.col-lg-4:last-child {
}
.col-lg-4 {
&:last-child {
margin-right: 0;
}
}
.col-sm-1 {
width: 44px;
padding: 0;
@ -244,10 +252,12 @@ body {
width: 80%;
margin: 0 auto;
}
.padding-bottom-60:last-child {
.padding-bottom-60 {
&:last-child {
padding-bottom: 0 !important;
}
}
}
#SettingsAccordion {
.panel {
@ -593,3 +603,42 @@ select{
.navbar-brand {
padding: 22px 15px;
}
.panel-actions {
.progress {
width: inherit;
}
}
.basilisk-actions {
.caret {
margin-left: 10px;
margin-top: -2px;
}
}
.clipboard-edexaddr {
margin-left: 10px;
}
.coind-down-modal {
.modal-body {
height: 60vh;
> div {
height: 100%;
}
.page-content {
width: 90%;
height: 100%;
textarea {
min-height: 200px;
}
}
}
}
.backround-gray {
background: #f3f4f5;
}

12
react/src/config.js

@ -1,4 +1,5 @@
module.exports = {
let Config;
let _config = {
iguanaCorePort: 7778,
agamaPort: 17777,
enableCacheApi: true,
@ -11,4 +12,13 @@ module.exports = {
default: true
},
iguanaLessMode: true,
roundValues: true,
};
try {
Config = window.require('electron').remote.getCurrentWindow().appConfig;
} catch (e) {
Config = _config;
}
export default Config;

9
react/src/reducers/dashboard.js

@ -8,7 +8,8 @@ import {
DASHBOARD_CONNECT_NOTARIES,
VIEW_CACHE_DATA,
LOG_GUI_HTTP,
TOGGLE_NOTIFICATIONS_MODAL
TOGGLE_NOTIFICATIONS_MODAL,
DISPLAY_COIND_DOWN_MODAL
} from '../actions/storeType';
const HTTP_STACK_MAX_ENTRIES = 150; // limit stack mem length to N records per type
@ -36,6 +37,7 @@ export function Dashboard(state = {
failedToConnectNodes: null,
},
guiLog: {},
displayCoindDownModal: false,
}, action) {
switch (action.type) {
case DASHBOARD_SECTION_CHANGE:
@ -97,6 +99,11 @@ export function Dashboard(state = {
return Object.assign({}, state, {
guiLog: newLogState,
});
case DISPLAY_COIND_DOWN_MODAL:
return Object.assign({}, state, {
displayCoindDownModal: action.displayCoindDownModal,
});
break;
default:
return state;
}

12
react/src/reducers/index.js

@ -12,7 +12,7 @@ import { Interval } from './interval';
import { SyncOnly } from './syncOnly';
import { Errors } from './errors';
const rootReducer = combineReducers({
const appReducer = combineReducers({
AddCoin,
toaster,
Main,
@ -26,4 +26,14 @@ const rootReducer = combineReducers({
routing: routerReducer,
});
// reset app state on logout
const initialState = appReducer({}, {});
const rootReducer = (state, action) => {
if (action.type === 'LOGOUT') {
state = initialState;
}
return appReducer(state, action);
}
export default rootReducer;

6
react/src/translate/translate.js

@ -2,7 +2,7 @@ import { _lang } from './en';
import Config from '../config';
export function translate(langID) {
let defaultLang = Config.defaultLang;
let defaultLang = Config.defaultLang || 'EN';
if (langID &&
langID.indexOf('.') > -1) {
@ -13,12 +13,12 @@ export function translate(langID) {
_lang[defaultLang][langIDComponents[0]][langIDComponents[1]]) {
return _lang[defaultLang][langIDComponents[0]][langIDComponents[1]];
} else {
console.log('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID);
console.warn('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID);
return '--> ' + langID + ' <--';
}
} else {
if (langID.length) {
console.log('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID);
console.warn('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID);
return '--> ' + langID + ' <--';
}
}

Loading…
Cancel
Save