Browse Source

cli render fix

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

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

@ -416,7 +416,6 @@ 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;
@ -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

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

@ -1,4 +1,5 @@
import React from 'react';
import { translate } from '../../../translate/translate';
import {
SyncErrorLongestChainRender,
SyncErrorBlocksRender,

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