Browse Source

cli render fix

all-modes
pbca26 8 years ago
parent
commit
6631f12e10
  1. 19
      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

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

@ -416,7 +416,6 @@ 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;
@ -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 = [];
if (__cliResponseParsed.length) {
for (let i = 0; i < __cliResponseParsed.length; i++) { for (let i = 0; i < __cliResponseParsed.length; i++) {
_items.push( _items.push(
<div key={ `cli-response-${Math.random(0, 9) * 10}` }>{ __cliResponseParsed[i] }</div> <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(
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

1
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,

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