Browse Source

cli render fix

all-modes
pbca26 8 years ago
parent
commit
6631f12e10
  1. 27
      react/src/components/dashboard/settings/settings.js
  2. 2
      react/src/components/dashboard/settings/settings.render.js
  3. 3
      react/src/components/dashboard/walletsProgress/walletsProgress.js
  4. 2
      react/src/translate/en.js

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

@ -103,7 +103,7 @@ class Settings extends React.Component {
if (this.state.seedInputVisibility) {
document.querySelector('#wifkeysPassphraseTextarea').style.height = '1px';
document.querySelector('#wifkeysPassphraseTextarea').style.height = `${(15 + document.querySelector('#wifkeysPassphraseTextarea').scrollHeight)}px`;
}
}
}, 100);
}
@ -416,11 +416,10 @@ class Settings extends React.Component {
}
updateInput(e) {
console.log(e.target.name);
if (e.target.name === 'wifkeysPassphrase') {
// remove any empty chars from the start/end of the string
const newValue = e.target.value;
clearTimeout(this.state.trimPassphraseTimer);
const _trimPassphraseTimer = setTimeout(() => {
@ -430,7 +429,7 @@ class Settings extends React.Component {
}, 2000);
this.resizeLoginTextarea();
this.setState({
trimPassphraseTimer: _trimPassphraseTimer,
[e.target.name]: newValue,
@ -486,12 +485,26 @@ class Settings extends React.Component {
_cliResponseParsed = _cliResponse.result;
}
const __cliResponseParsed = _cliResponseParsed.split('\r\n');
let __cliResponseParsed;
if (_cliResponseParsed.indexOf('\r\n') > -1) {
_cliResponseParsed = _cliResponseParsed.split('\r\n') ;
} else if (_cliResponseParsed.indexOf('\n') > -1) {
__cliResponseParsed = _cliResponseParsed.split('\n') ;
} else {
__cliResponseParsed = _cliResponseParsed;
}
let _items = [];
for (let i = 0; i < __cliResponseParsed.length; i++) {
if (__cliResponseParsed.length) {
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>
);
}
} else {
_items.push(
<div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ __cliResponseParsed[i] }</div>
translate('INDEX.NO_DATA_AVAILABLE')
);
}

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

@ -570,7 +570,7 @@ export const SettingsRender = function() {
name="cliCoin"
id="settingsCliOptions"
onChange={ this.updateInput }>
<option value="">{ translate('INDEX.CLI_SELECT_A_COIN') }</option>
<option value="">{ translate('INDEX.CLI_NATIVE_COIN') }</option>
{ this.renderActiveCoinsList('native') }
</select>
<label

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

@ -1,4 +1,5 @@
import React from 'react';
import { translate } from '../../../translate/translate';
import {
SyncErrorLongestChainRender,
SyncErrorBlocksRender,
@ -124,7 +125,7 @@ class WalletsProgress extends React.Component {
);
} else if (
this.props.Settings.debugLog.indexOf('LoadExternalBlockFile:') > -1 ||
this.props.Settings.debugLog.indexOf('Reindexing block file') > -1
this.props.Settings.debugLog.indexOf('Reindexing block file') > -1
) {
return (
`: ({ translate('INDEX.REINDEX') })`

2
react/src/translate/en.js

@ -17,6 +17,7 @@ export const _lang = {
'NO_ACTIVE_COIN': 'No active coin',
},
'INDEX': {
'NO_DATA_AVAILABLE': 'No data available',
'LOADING': 'Loading',
'ACTIVATING_SM': 'activating',
'DL_BLOCKS': 'downloading blocks',
@ -40,6 +41,7 @@ export const _lang = {
'BINS_UPDATE': 'Binaries update',
'UPDATE_BINS_NOW': 'Update binaries now',
'CLI_SELECT_A_COIN': 'Select a coin and type in CLI compatible command',
'CLI_NATIVE_COIN': 'Select native coin',
'IMPORT': 'Import',
'CHECK': 'Check',
'VALIDATE': 'Validate',

Loading…
Cancel
Save