|
|
@ -5,22 +5,22 @@ class WalletsNativeSyncProgress extends React.Component { |
|
|
|
renderSyncPercentagePlaceholder() { |
|
|
|
if (this.props.Dashboard.progress.blocks > 0 && this.props.Dashboard.progress.longestchain === 0) { |
|
|
|
return ( |
|
|
|
<div className="progress-bar progress-bar-info progress-bar-striped active" style={{width: '100%', fontSize: '80%'}} role="progressbar" data-extcoin="COIN" id="extcoin-sync"> |
|
|
|
<span data-extcoin="COIN" id="extcoin-sync-percent" style={{width: '100%'}}>Unable to get current sync progress. Err: no longestchain param in response</span> |
|
|
|
<div className="progress-bar progress-bar-info progress-bar-striped active" style={{width: '100%', fontSize: '80%'}} role="progressbar" id="extcoin-sync"> |
|
|
|
<span id="extcoin-sync-percent" style={{width: '100%'}}>{translate('INDEX.SYNC_ERR_LONGESTCHAIN')}</span> |
|
|
|
</div> |
|
|
|
); |
|
|
|
} else if (this.props.Dashboard.progress.blocks === 0) { |
|
|
|
return ( |
|
|
|
<div className="progress-bar progress-bar-info progress-bar-striped active" style={{width: '100%', fontSize: '80%'}} role="progressbar" data-extcoin="COIN" id="extcoin-sync"> |
|
|
|
<span data-extcoin="COIN" id="extcoin-sync-percent" style={{width: '100%'}}>Unable to get current sync progress. Err: no blocks param in response</span> |
|
|
|
<div className="progress-bar progress-bar-info progress-bar-striped active" style={{width: '100%', fontSize: '80%'}} role="progressbar" id="extcoin-sync"> |
|
|
|
<span id="extcoin-sync-percent" style={{width: '100%'}}>{translate('INDEX.SYNC_ERR_BLOCKS')}</span> |
|
|
|
</div> |
|
|
|
); |
|
|
|
} else { |
|
|
|
var syncPercentage = (parseFloat(parseInt(this.props.Dashboard.progress.blocks, 10) * 100 / parseInt(this.props.Dashboard.progress.longestchain, 10)).toFixed(2) + '%').replace('NaN', 0); |
|
|
|
|
|
|
|
return ( |
|
|
|
<div className="progress-bar progress-bar-info progress-bar-striped active" style={{width: syncPercentage, fontSize: '80%'}} role="progressbar" data-extcoin="COIN" id="extcoin-sync"> |
|
|
|
<span data-extcoin="COIN" id="extcoin-sync-percent" style={{width: syncPercentage}}>{syncPercentage}</span> | <span data-extcoin="COIN" id="extcoin-synced-blocks">{this.props.Dashboard.progress.blocks}</span> / <span data-extcoin="COIN" id="extcoin-longestchain">{this.props.Dashboard.progress.longestchain}</span> | {translate('INDEX.CONNECTIONS')}: <span data-extcoin="COIN" id="extcoin-connections">{this.props.Dashboard.progress.connections}</span> |
|
|
|
<div className="progress-bar progress-bar-info progress-bar-striped active" style={{width: syncPercentage, fontSize: '80%'}} role="progressbar" id="extcoin-sync"> |
|
|
|
<span id="extcoin-sync-percent" style={{width: syncPercentage}}>{syncPercentage}</span> | <span id="extcoin-synced-blocks">{this.props.Dashboard.progress.blocks}</span> / <span id="extcoin-longestchain">{this.props.Dashboard.progress.longestchain}</span> | {translate('INDEX.CONNECTIONS')}: <span id="extcoin-connections">{this.props.Dashboard.progress.connections}</span> |
|
|
|
</div> |
|
|
|
); |
|
|
|
} |
|
|
@ -29,10 +29,10 @@ class WalletsNativeSyncProgress extends React.Component { |
|
|
|
renderActivatingBestChainProgress() { |
|
|
|
if (this.props.Settings && this.props.Settings.debugLog && this.props.Dashboard.progress.remoteKMDNode) { |
|
|
|
if (this.props.Settings.debugLog.indexOf('UpdateTip') > -1) { |
|
|
|
var temp = this.props.Settings.debugLog.split(' '); |
|
|
|
var currentBestChain; |
|
|
|
let temp = this.props.Settings.debugLog.split(' '); |
|
|
|
let currentBestChain; |
|
|
|
|
|
|
|
for (var i = 0; i < temp.length; i++) { |
|
|
|
for (let i = 0; i < temp.length; i++) { |
|
|
|
if (temp[i].indexOf('height=') > -1) { |
|
|
|
currentBestChain = temp[i].replace('height=', ''); |
|
|
|
} |
|
|
@ -48,7 +48,7 @@ class WalletsNativeSyncProgress extends React.Component { |
|
|
|
renderChainActivationNotification() { |
|
|
|
if ((this.props.Dashboard.progress.blocks < this.props.Dashboard.progress.longestchain) || this.props.Dashboard.progress.remoteKMDNode) { |
|
|
|
return ( |
|
|
|
<div role="alert" className="alert alert-info alert-dismissible" data-extcoin="COIN" id="extcoin-wallet-activating-alert" style={{marginBottom: '40px'}}> |
|
|
|
<div role="alert" className="alert alert-info alert-dismissible" id="extcoin-wallet-activating-alert" style={{marginBottom: '40px'}}> |
|
|
|
<button aria-label="Close" data-dismiss="alert" className="close" type="button"> |
|
|
|
<span aria-hidden="true">×</span> |
|
|
|
</button> |
|
|
@ -68,7 +68,7 @@ class WalletsNativeSyncProgress extends React.Component { |
|
|
|
return ( |
|
|
|
<div> |
|
|
|
{this.renderChainActivationNotification()} |
|
|
|
<div className="row" data-extcoin="COIN" style={{margin: '-20px 0px 10px 0px'}}> |
|
|
|
<div className="row" style={{margin: '-20px 0px 10px 0px'}}> |
|
|
|
<div className="col-xs-12" data-extcoin="COIN" id="extcoin-progressbars"> |
|
|
|
<div className="progress"> |
|
|
|
{this.renderSyncPercentagePlaceholder()} |
|
|
|