Browse Source

Merge branch 'redux' of https://github.com/SuperNETorg/EasyDEX-GUI into decouple-jsx-out-of-js

all-modes
pbca26 8 years ago
parent
commit
fc504f65d7
  1. 20
      react/src/components/dashboard/walletsData.js
  2. 2
      react/src/components/dashboard/walletsNativeBalance.js
  3. 25
      react/src/components/dashboard/walletsNativeSyncProgress.js

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

@ -583,7 +583,7 @@ class WalletsData extends React.Component {
<div className="panel">
<header className="panel-heading z-index-10">
<div className={ this.props.ActiveCoin.mode === 'basilisk' ? 'panel-actions' : 'panel-actions hide' }>
<div className={'full-width margin-bottom-3 ' + (this.state.currentStackLength === 1 || (this.state.currentStackLength === 0 && this.state.totalStackLength === 0) ? 'hide' : 'progress progress-sm') }>
<div className={ 'margin-bottom-3 ' + (this.state.currentStackLength === 1 || (this.state.currentStackLength === 0 && this.state.totalStackLength === 0) ? 'hide' : 'progress progress-sm') }>
<div
className="progress-bar progress-bar-striped active progress-bar-indicating progress-bar-success font-size-80-percent"
style={{ width: 100 - (this.state.currentStackLength * 100 / this.state.totalStackLength) + '%'}}>
@ -598,23 +598,17 @@ class WalletsData extends React.Component {
</a>
<ul className="dropdown-menu dropdown-menu-right">
<li>
<a
className="btn_edexcoin_dashboard_getnotaries"
onClick={ this.getDexNotariesAction }>
<a onClick={ this.getDexNotariesAction }>
<i className="icon fa-sitemap"></i> { translate('INDEX.GET_NOTARY_NODES_LIST') }
</a>
</li>
<li>
<a
className="btn_edexcoin_dashboard_refresh_basilisk_conn"
onClick={ this.basiliskConnectionAction }>
<a onClick={ this.basiliskConnectionAction }>
<i className="icon wb-refresh"></i> { translate('INDEX.REFRESH_BASILISK_CONNECTIONS') }
</a>
</li>
<li className={ !this.state.useCache ? 'hide' : '' }>
<a
className="btn_edexcoin_dashboard_fetchdata"
onClick={ this.basiliskRefreshActionOne }>
<a onClick={ this.basiliskRefreshActionOne }>
<i className="icon fa-cloud-download"></i> { translate('INDEX.FETCH_WALLET_DATA') } ({ translate('INDEX.ACTIVE_ADDRESS') })
</a>
</li>
@ -624,9 +618,7 @@ class WalletsData extends React.Component {
</a>
</li>
<li className={ !this.state.useCache ? 'hide' : '' }>
<a
className="btn_edexcoin_dashboard_refetchdata"
onClick={ this.removeAndFetchNewCache }>
<a onClick={ this.removeAndFetchNewCache }>
<i className="icon fa-history"></i> { translate('INDEX.REFETCH_WALLET_DATA') }
</a>
</li>
@ -636,7 +628,7 @@ class WalletsData extends React.Component {
</a>
</li>
<li className={ !this.state.useCache ? 'hide' : '' }>
<a className="btn_edexcoin_dashboard_fetchdata" onClick={ this._toggleViewCacheModal }>
<a onClick={ this._toggleViewCacheModal }>
<i className="icon fa-list-alt"></i> { translate('INDEX.VIEW_CACHE_DATA') }
</a>
</li>

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

@ -45,7 +45,7 @@ class WalletsNativeBalance extends React.Component {
<div className="pull-left padding-vertical-10">
<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">{ this.props.ActiveCoin.balance.interest ? this.props.ActiveCoin.balance.interest : '-' }</span>
<span className="pull-right padding-top-10 font-size-22">{ this.props.Dashboard.progress.interest ? this.props.Dashboard.progress.interest : '-' }</span>
</div>
</div>
</div>

25
react/src/components/dashboard/walletsNativeSyncProgress.js

@ -31,19 +31,32 @@ class WalletsNativeSyncProgress extends React.Component {
renderActivatingBestChainProgress() {
if (this.props.Settings &&
this.props.Settings.debugLog &&
this.props.Dashboard.progress.remoteKMDNode) {
this.props.Settings.debugLog) {
if (this.props.Settings.debugLog.indexOf('UpdateTip') > -1) {
let temp = this.props.Settings.debugLog.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=', '')) * 100;
}
}
return(`: ${Math.floor(currentBestChain * 100 / this.props.Dashboard.progress.remoteKMDNode.blocks)}% (blocks ${currentBestChain} / ${this.props.Dashboard.progress.remoteKMDNode.blocks})`);
// fallback to local data if remote node is inaccessible
if (this.props.Dashboard.progress.remoteKMDNode &&
!this.props.Dashboard.progress.remoteKMDNode.blocks) {
return (
`: ${currentProgress}%`
);
} else {
return(
`: ${Math.floor(currentBestChain * 100 / this.props.Dashboard.progress.remoteKMDNode.blocks)}% (blocks ${currentBestChain} / ${this.props.Dashboard.progress.remoteKMDNode.blocks})`
);
}
} else {
return (
<span>...</span>
@ -57,15 +70,15 @@ class WalletsNativeSyncProgress extends React.Component {
return _translationComponents.map((_translation) =>
<span>
{_translation}
{ _translation }
<br />
</span>
);
}
renderChainActivationNotification() {
if ((this.props.Dashboard.progress.blocks < this.props.Dashboard.progress.longestchain) ||
this.props.Dashboard.progress.remoteKMDNode) {
if ((!this.props.Dashboard.progress.blocks && !this.props.Dashboard.progress.longestchain) ||
(this.props.Dashboard.progress.blocks < this.props.Dashboard.progress.longestchain)) {
return (
<div className="alert alert-info alert-dismissible margin-bottom-40">
<button className="close" type="button">

Loading…
Cancel
Save