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) { if (this.state.seedInputVisibility) {
document.querySelector('#wifkeysPassphraseTextarea').style.height = '1px'; document.querySelector('#wifkeysPassphraseTextarea').style.height = '1px';
document.querySelector('#wifkeysPassphraseTextarea').style.height = `${(15 + document.querySelector('#wifkeysPassphraseTextarea').scrollHeight)}px`; document.querySelector('#wifkeysPassphraseTextarea').style.height = `${(15 + document.querySelector('#wifkeysPassphraseTextarea').scrollHeight)}px`;
} }
}, 100); }, 100);
} }
@ -416,11 +416,10 @@ class Settings extends React.Component {
} }
updateInput(e) { updateInput(e) {
console.log(e.target.name);
if (e.target.name === 'wifkeysPassphrase') { if (e.target.name === 'wifkeysPassphrase') {
// remove any empty chars from the start/end of the string // remove any empty chars from the start/end of the string
const newValue = e.target.value; const newValue = e.target.value;
clearTimeout(this.state.trimPassphraseTimer); clearTimeout(this.state.trimPassphraseTimer);
const _trimPassphraseTimer = setTimeout(() => { const _trimPassphraseTimer = setTimeout(() => {
@ -430,7 +429,7 @@ class Settings extends React.Component {
}, 2000); }, 2000);
this.resizeLoginTextarea(); this.resizeLoginTextarea();
this.setState({ this.setState({
trimPassphraseTimer: _trimPassphraseTimer, trimPassphraseTimer: _trimPassphraseTimer,
[e.target.name]: newValue, [e.target.name]: newValue,
@ -486,12 +485,26 @@ class Settings extends React.Component {
_cliResponseParsed = _cliResponse.result; _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 = []; 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( _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" name="cliCoin"
id="settingsCliOptions" id="settingsCliOptions"
onChange={ this.updateInput }> onChange={ this.updateInput }>
<option value="">{ translate('INDEX.CLI_SELECT_A_COIN') }</option> <option value="">{ translate('INDEX.CLI_NATIVE_COIN') }</option>
{ this.renderActiveCoinsList('native') } { this.renderActiveCoinsList('native') }
</select> </select>
<label <label

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

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

2
react/src/translate/en.js

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

Loading…
Cancel
Save