Browse Source

Merge pull request #91 from pbca26/redux

Redux
all-modes
pbca26 8 years ago
committed by GitHub
parent
commit
6458cb3df4
  1. 1
      react/package.json
  2. 437
      react/src/actions/actionCreators.js
  3. 1
      react/src/components/app/app.js
  4. 28
      react/src/components/dashboard/coinTileItem.js
  5. 8
      react/src/components/dashboard/dashboard.js
  6. 575
      react/src/components/dashboard/receiveCoin.js
  7. 115
      react/src/components/dashboard/settings.js
  8. 76
      react/src/components/dashboard/walletsBasiliskConnection.js
  9. 54
      react/src/components/dashboard/walletsBasiliskRefresh.js
  10. 35
      react/src/components/dashboard/walletsData.js
  11. 556
      react/src/components/dashboard/walletsNative.js
  12. 50
      react/src/components/dashboard/walletsProgress.js
  13. 2
      react/src/config.js
  14. 7
      react/src/reducers/activeCoin.js
  15. 31
      react/src/reducers/dashboard.js
  16. 2
      react/src/reducers/index.js
  17. 26
      react/src/reducers/interval.js
  18. 12
      react/src/reducers/settings.js
  19. 13
      react/src/styles/index.scss

1
react/package.json

@ -33,6 +33,7 @@
"babel-loader": "^6.2.5",
"babel-preset-es2015": "^6.14.0",
"babel-preset-react": "^6.11.1",
"bluebird": "^3.5.0",
"express": "^4.14.0",
"file-loader": "^0.10.0",
"react": "^15.3.1",

437
react/src/actions/actionCreators.js

@ -1,4 +1,7 @@
import 'whatwg-fetch';
import 'bluebird';
import Config from '../config';
import { startCurrencyAssetChain, startAssetChain, startCrypto, checkCoinType } from '../components/addcoin/payload';
import { copyToClipboard } from '../util/copyToClipboard';
import { translate } from '../translate/translate';
@ -17,6 +20,59 @@ export const DASHBOARD_ACTIVE_COIN_RECEIVE_FORM = 'DASHBOARD_ACTIVE_COIN_RECEIVE
export const DASHBOARD_ACTIVE_COIN_RESET_FORMS = 'DASHBOARD_ACTIVE_COIN_RESET_FORMS';
export const ATOMIC = 'ATOMIC';
export const GET_WIF_KEY = 'GET_WIF_KEY';
export const GET_PEERS_LIST = 'GET_PEERS_LIST';
export const GET_DEBUG_LOG = 'GET_DEBUG_LOG';
export const BASILISK_REFRESH = 'BASILISK_REFRESH';
export const BASILISK_CONNECTION = 'BASILISK_CONNECTION';
export const SYNCING_FULL_MODE = 'SYNCING_FULL_MODE';
export const SYNCING_NATIVE_MODE = 'SYNCING_NATIVE_MODE';
export const ACTIVE_COIN_GET_ADDRESSES = 'ACTIVE_COIN_GET_ADDRESSES';
export const START_INTERVAL= 'START_INTERVAL';
export const STOP_INTERVAL= 'STOP_INTERVAL';
function basiliskConnectionState(display, json) {
return {
type: BASILISK_CONNECTION,
basiliskConnection: display,
progress: json,
}
}
function basiliskRefreshState(display, json) {
return {
type: BASILISK_REFRESH,
basiliskRefresh: display,
progress: json,
}
}
export function basiliskRefresh(display) {
return dispatch => {
dispatch(basiliskRefreshState(display));
}
}
export function basiliskConnection(display) {
return dispatch => {
dispatch(basiliskConnectionState(display));
}
}
export function syncingNativeModeState(display, json) {
return {
type: SYNCING_FULL_MODE,
syncingNativeMode: display,
progress: json,
}
}
export function syncingFullModeState(display, json) {
return {
type: SYNCING_NATIVE_MODE,
syncingFullMode: display,
progress: json,
}
}
function atomicState(json) {
return {
@ -178,11 +234,11 @@ export function copyCoinAddress(address) {
if (_result) {
return dispatch => {
dispatch(triggerToaster(true, translate('DASHBOARD.ADDR_COPIED'), translate('TOASTR.COIN_NOTIFICATION'), 'success'))
dispatch(triggerToaster(true, translate('DASHBOARD.ADDR_COPIED'), translate('TOASTR.COIN_NOTIFICATION'), 'success'));
}
} else {
return dispatch => {
dispatch(triggerToaster(true, 'Couldn\'t copy address to clipboard', translate('TOASTR.COIN_NOTIFICATION'), 'error'))
dispatch(triggerToaster(true, 'Couldn\'t copy address to clipboard', translate('TOASTR.COIN_NOTIFICATION'), 'error'));
}
}
}
@ -223,13 +279,13 @@ export function addCoin(coin, mode) {
export function iguanaAddCoin(coin, mode, acData) {
return dispatch => {
return fetch('http://127.0.0.1:7778', {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
body: JSON.stringify(acData),
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, translate('TOASTR.FAILED_TO_ADDCOIN'), translate('TOASTR.ACCOUNT_NOTIFICATION'), 'error'))
dispatch(triggerToaster(true, translate('TOASTR.FAILED_TO_ADDCOIN'), translate('TOASTR.ACCOUNT_NOTIFICATION'), 'error'));
})
.then(response => response.json())
.then(json => dispatch(addCoinResult(coin, mode, acData)));
@ -272,7 +328,7 @@ export function shepherdHerd(coin, mode, path) {
console.log('herdData', herdData);
return dispatch => {
return fetch('http://127.0.0.1:17777/shepherd/herd', {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/herd', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -284,7 +340,7 @@ export function shepherdHerd(coin, mode, path) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, translate('FAILED_SHEPHERD_HERD'), translate('TOASTR.SERVICE_NOTIFICATION'), 'error'))
dispatch(triggerToaster(true, translate('FAILED_SHEPHERD_HERD'), translate('TOASTR.SERVICE_NOTIFICATION'), 'error'));
})
.then(response => response.json())
.then(json => dispatch(iguanaAddCoin(coin, mode, acData)));
@ -307,7 +363,7 @@ export function addCoinResult(coin, mode) {
export function shepherdGetConfig(coin, mode) {
return dispatch => {
return fetch('http://127.0.0.1:17777/shepherd/getconf', {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/getconf', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -316,7 +372,7 @@ export function shepherdGetConfig(coin, mode) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'Failed to get mode config', 'Error', 'error'))
dispatch(triggerToaster(true, 'Failed to get mode config', 'Error', 'error'));
})
.then(response => response.json())
.then(json => dispatch(shepherdHerd(coin, mode, json)));
@ -325,7 +381,7 @@ export function shepherdGetConfig(coin, mode) {
export function getDexCoins() {
return dispatch => {
return fetch('http://127.0.0.1:7778', {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
//mode: 'no-cors'
body: JSON.stringify({
@ -336,7 +392,7 @@ export function getDexCoins() {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'Error getDexCoins', 'Error', 'error'))
dispatch(triggerToaster(true, 'Error getDexCoins', 'Error', 'error'));
})
.then(response => response.json())
@ -355,7 +411,7 @@ function rpcErrorHandler(json, dispatch) {
export function iguanaWalletPassphrase(_passphrase) {
return dispatch => {
return fetch('http://127.0.0.1:7778', {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
body: JSON.stringify({
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
@ -368,7 +424,7 @@ export function iguanaWalletPassphrase(_passphrase) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'Error iguanaWalletPassphrase', 'Error', 'error'))
dispatch(triggerToaster(true, 'Error iguanaWalletPassphrase', 'Error', 'error'));
})
.then(response => response.json())
.then(json => dispatch(iguanaWalletPassphraseState(json, dispatch)));
@ -377,7 +433,7 @@ export function iguanaWalletPassphrase(_passphrase) {
export function iguanaActiveHandle(getMainAddress) {
return dispatch => {
return fetch('http://127.0.0.1:7778', {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
body: JSON.stringify({
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
@ -387,7 +443,7 @@ export function iguanaActiveHandle(getMainAddress) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'Error iguanaActiveHandle', 'Error', 'error'))
dispatch(triggerToaster(true, translate('TOASTR.IGUANA_ARE_YOU_SURE'), translate('TOASTR.SERVICE_NOTIFICATION'), 'error'));
})
.then(response => response.json())
.then(json => dispatch(getMainAddress ? getMainAddressState(json) : iguanaActiveHandleState(json)));
@ -396,7 +452,7 @@ export function iguanaActiveHandle(getMainAddress) {
export function iguanaEdexBalance(coin) {
return dispatch => {
return fetch('http://127.0.0.1:7778', {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
body: JSON.stringify({
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
@ -407,7 +463,7 @@ export function iguanaEdexBalance(coin) {
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'Error iguanaEdexBalance', 'Error', 'error'))
dispatch(triggerToaster(true, 'Error iguanaEdexBalance', 'Error', 'error'));
})
.then(response => response.json())
.then(json => dispatch(iguanaEdexBalanceState(json)));
@ -416,13 +472,13 @@ export function iguanaEdexBalance(coin) {
export function atomic(payload) {
return dispatch => {
return fetch('http://127.0.0.1:7778', {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, payload.method, 'Atomic explore error', 'error'))
dispatch(triggerToaster(true, payload.method, 'Atomic explore error', 'error'));
})
.then(response => response.json())
.then(json => dispatch(atomicState(json)));
@ -435,25 +491,24 @@ export function settingsWifkeyState(json, coin) {
wifkey: json[coin + 'wif'],
address: json[coin],
}
console.log('test', json);
}
export function encryptWallet(_passphrase, cb, coin) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': 'bitcoinrpc',
'method': 'encryptwallet',
'passphrase': _passphrase
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': 'bitcoinrpc',
'method': 'encryptwallet',
'passphrase': _passphrase
};
return dispatch => {
return fetch('http://127.0.0.1:7778', {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'encryptWallet', 'Error', 'error'))
dispatch(triggerToaster(true, 'encryptWallet', 'Error', 'error'));
})
.then(dispatch(walletPassphrase(_passphrase)))
.then(response => response.json())
@ -463,39 +518,339 @@ export function encryptWallet(_passphrase, cb, coin) {
export function walletPassphrase(_passphrase) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': 'bitcoinrpc',
'method': 'walletpassphrase',
'password': _passphrase,
'timeout': '2592000'
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': 'bitcoinrpc',
'method': 'walletpassphrase',
'password': _passphrase,
'timeout': '2592000'
};
return dispatch => {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'walletPassphrase', 'Error', 'error'));
})
}
}
export function getPeersListState(json) {
var peersList = {};
if (json && json.rawpeers && json.rawpeers.length) {
for (var i=0; i < json.rawpeers.length; i++) {
peersList[json.rawpeers[i].coin] = json.rawpeers[i].peers;
}
}
return {
type: GET_PEERS_LIST,
supernetPeers: json && json.supernet[0] ? json.supernet : null,
rawPeers: peersList,
}
}
export function getPeersList(coin) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': 'SuperNET',
'method': 'getpeers',
'activecoin': coin,
};
return dispatch => {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'getPeersList', 'Error', 'error'));
})
.then(response => response.json())
.then(json => dispatch(getPeersListState(json, dispatch)))
}
}
function addPeerNodeState(json, dispatch) {
if (json.error === 'addnode needs active coin, do an addcoin first') {
return dispatch => {
dispatch(triggerToaster(true, 'Addnode needs active coin', translate('TOASTR.SETTINGS_NOTIFICATION'), 'error'));
}
}
if (json.result === 'peer was already connected') {
return dispatch => {
dispatch(triggerToaster(true, 'Peer was already connected', translate('TOASTR.SETTINGS_NOTIFICATION'), 'warning'));
}
}
if (json.result === 'addnode connection was already pending') {
return dispatch => {
dispatch(triggerToaster(true, 'Addnode connection was already pending', translate('TOASTR.SETTINGS_NOTIFICATION'), 'warning'));
}
}
if (json.result === 'addnode submitted') {
return dispatch => {
dispatch(triggerToaster(true, 'Peer is added', translate('TOASTR.SETTINGS_NOTIFICATION'), 'success'));
}
}
}
export function addPeerNode(coin, ip) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': 'iguana',
'method': 'addnode',
'activecoin': coin,
'ipaddr': ip
};
return dispatch => {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'addPeerNode', 'Error', 'error'));
})
.then(response => response.json())
.then(json => dispatch(addPeerNodeState(json, dispatch)))
}
}
export function getAddressesByAccountState(json, coin) {
test(['123', '456']);
return {
type: ACTIVE_COIN_GET_ADDRESSES,
addresses: json.result,
}
}
export function getAddressesByAccount(coin) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'coin': coin,
'agent': 'bitcoinrpc',
'method': 'getaddressesbyaccount',
'account': '*'
};
return dispatch => {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'getAddressesByAccount', 'Error', 'error'));
})
.then(response => response.json())
.then(json => dispatch(getAddressesByAccountState(json, dispatch)))
}
}
function getDexNotariesState(json, dispatch) {
return dispatch => {
dispatch(triggerToaster(true, 'Notaries list received', translate('TOASTR.BASILISK_NOTIFICATION'), 'success'));
}
}
export function getDexNotaries(coin) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': 'dex',
'method': 'getnotaries',
'symbol': coin
};
return dispatch => {
return fetch('http://127.0.0.1:7778', {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'walletPassphrase', 'Error', 'error'))
dispatch(triggerToaster(true, 'getDexNotaries', 'Error', 'error'));
})
.then(response => response.json())
.then(json => dispatch(getDexNotariesState(json, dispatch)))
}
}
export function startInterval(name, handle) {
return {
type: START_INTERVAL,
name,
handle,
}
}
/*function Shepherd_SysInfo() {
return new Promise((resolve) => {
$.ajax({
type: 'GET',
url: 'http://127.0.0.1:17777/shepherd/sysinfo',
contentType: 'application/json' // send as JSON
export function stopInterval(name, intervals) {
clearInterval(intervals[name]);
return {
type: STOP_INTERVAL,
name,
}
}
function getSyncInfoState(json) {
return {
type: SYNCING_FULL_MODE,
progress: json,
}
}
export function getSyncInfo(coin) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'coin': coin,
'agent': 'bitcoinrpc',
'method': 'getinfo',
'immediate': 100,
'timeout': 4000
};
return dispatch => {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
body: JSON.stringify(payload),
})
.done(function(data) {
resolve(data);
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'getSyncInfo', 'Error', 'error'));
})
.then(response => response.json())
.then(json => dispatch(getSyncInfoState(json, dispatch)))
}
}
function getDebugLogState(json) {
const _data = json.result.replace('\n', '\r\n');
return {
type: GET_DEBUG_LOG,
data: _data,
}
}
export function getDebugLog(target, linesCount) {
const payload = {
'herdname': target,
'lastLines': linesCount
};
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/debuglog', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'getDebugLog', 'Error', 'error'));
})
.then(response => response.json())
.then(json => dispatch(getDebugLogState(json)))
}
}
function parseImportPrivKeyResponse(json, dispatch) {
if (json.error === 'illegal privkey') {
return dispatch => {
dispatch(triggerToaster(true, 'Illegal privkey', translate('TOASTR.SETTINGS_NOTIFICATION'), 'error'));
}
}
if (json.error === 'privkey already in wallet') {
return dispatch => {
dispatch(triggerToaster(true, 'Privkey already in wallet', translate('TOASTR.SETTINGS_NOTIFICATION'), 'warning'));
}
}
if (json && json.result !== undefined && json.result == 'success') {
return dispatch => {
dispatch(triggerToaster(true, translate('TOASTR.PRIV_KEY_IMPORTED'), translate('TOASTR.SETTINGS_NOTIFICATION'), 'success'));
}
}
}
export function importPrivKey(wifKey) {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'method': 'importprivkey',
'params': [
wifKey,
'imported'
]
};
return dispatch => {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'importPrivKey', 'Error', 'error'));
})
.then(response => response.json())
.then(json => dispatch(parseImportPrivKeyResponse(json, dispatch)))
.catch(function(ex) {
dispatch(parseImportPrivKeyResponse({ 'error': 'privkey already in wallet' }, dispatch));
console.log('parsing failed', ex);
})
}
}
export function shepherdGetSysInfo() {
return dispatch => {
return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/sysinfo', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
}
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'Failed to get sys info', 'Error', 'error'))
})
.then(response => response.json())
.then(json => dispatch(shepherdHerd(coin, mode, json)));
}
}
/*export function test(coin, addr) {
Promise.all(addr.map((_addr, index) => {
const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': 'dex',
'method': 'listunspent',
'address': _addr,
'symbol': coin
}
console.log('addr', _addr);
return new Promise((resolve, reject) => {
fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST',
body: JSON.stringify(payload),
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'getSyncInfo', 'Error', 'error'));
})
.then(response => response.json())
.then(json => dispatch(getSyncInfoState(json, dispatch)))
resolve(index);
});
}))
.then(result => {
console.log(result);
});
}
function Shepherd_SendPendValue() {
/*function Shepherd_SendPendValue() {
Shepherd_SysInfo().then(function(result){
var ram_data = formatBytes(result.totalmem_bytes)
var pend_val = null;

1
react/src/components/app/app.js

@ -12,6 +12,7 @@ function mapStateToProps(state) {
ActiveCoin: state.ActiveCoin,
Atomic: state.Atomic,
Settings: state.Settings,
Interval: state.Interval,
};
}

28
react/src/components/dashboard/coinTileItem.js

@ -1,6 +1,14 @@
import React from 'react';
import { translate } from '../../translate/translate';
import { dashboardChangeActiveCoin, iguanaActiveHandle } from '../../actions/actionCreators';
import {
dashboardChangeActiveCoin,
iguanaActiveHandle,
getAddressesByAccount,
getSyncInfo,
startInterval,
stopInterval,
iguanaEdexBalance
} from '../../actions/actionCreators';
import Store from '../../store';
class CoinTileItem extends React.Component {
@ -11,13 +19,29 @@ class CoinTileItem extends React.Component {
}
dashboardChangeActiveCoin(coin, mode) {
if (mode === 'full' && coin !== this.props.ActiveCoin.coin) {
Store.dispatch(stopInterval('sync', this.props.Interval.interval));
var _iguanaActiveHandle = setInterval(function() {
Store.dispatch(getSyncInfo(coin));
}, 3000);
Store.dispatch(startInterval('sync', _iguanaActiveHandle));
} else {
Store.dispatch(stopInterval('sync', this.props.Interval.interval));
}
Store.dispatch(dashboardChangeActiveCoin(coin, mode));
Store.dispatch(iguanaActiveHandle(true));
Store.dispatch(getAddressesByAccount(coin));
Store.dispatch(iguanaEdexBalance(coin));
/*this.setState(Object.assign({}, this.state, {
activeHandleInterval: _iguanaActiveHandle,
}));*/
}
render() {
const { item } = this.props;
return (
<div className="list-group-item col-xlg-6 col-lg-12 wallet-widgets-info" data-edexcoincode="{item.coin}">
<div className={this.props.ActiveCoin.coin === item.coin ? 'widget widget-shadow active' : 'widget widget-shadow'}>

8
react/src/components/dashboard/dashboard.js

@ -13,6 +13,9 @@ import Jumblr from './jumblr';
import Settings from './settings';
import ReceiveCoin from './receiveCoin';
import About from './about';
import WalletsBasiliskRefresh from './walletsBasiliskRefresh';
import WalletsBasiliskConnection from './walletsBasiliskConnection';
import WalletsNative from './walletsNative';
class Dashboard extends React.Component {
constructor(props) {
@ -36,7 +39,10 @@ class Dashboard extends React.Component {
<WalletsBalance {...this.props.ActiveCoin} />
<SendCoin {...this.props.ActiveCoin} />
<ReceiveCoin {...this.props.ActiveCoin} />
<WalletsData {...this.props.ActiveCoin} />
<WalletsData {...this.props} />
<WalletsBasiliskRefresh {...this.props} />
<WalletsBasiliskConnection {...this.props} />
<WalletsNative {...this.props} />
</div>
<div className={this.props.Dashboard.activeSection === 'edex' ? 'show' : 'hide'}>
<EDEX {...this.props} />

575
react/src/components/dashboard/receiveCoin.js

@ -2,549 +2,66 @@ import React from 'react';
import { translate } from '../../translate/translate';
class ReceiveCoin extends React.Component {
renderAddressList() {
if (this.props.addresses && this.props.addresses.length) {
return this.props.addresses.map((address) =>
<tr key={address}>
<td>
<span className="label label-default">
<i className="icon fa-eye"></i> {translate('IAPI.PUBLIC_SM')}
</span>
</td>
<td>{address}</td>
<td></td>
<td></td>
</tr>
);
} else {
return null;
}
}
render() {
console.log('receiveprops', this.props);
if (this.props && this.props.receive) {
return (
<div className="page" data-animsition-in="fade-in" data-animsition-out="fade-out" style={{marginLeft: '0'}}>
<div className="page-content" data-extcoin="COIN" id="section-extcoin">
<div role="alert" className="alert alert-danger alert-dismissible" data-extcoin="COIN" id="extcoin-wallet-connection-alert">
<button aria-label="Close" data-dismiss="alert" className="close" type="button">
<span aria-hidden="true">×</span>
</button>
<h4>{translate('INDEX.OOPS_ERROR')}</h4>
<p data-extcoin="COIN" id="extcoin-wallet-connection-alert-text">
<span data-lang="INDEX.OOPS_ERROR_DESC"></span>
<code>server=1</code><br/>
<code>rpcport=</code><br/>
<code>rpcuser=</code><br/>
<code>rpcpassword=</code>
</p>
</div>
<div role="alert" className="alert alert-info alert-dismissible" data-extcoin="COIN" id="extcoin-wallet-activating-alert">
<button aria-label="Close" data-dismiss="alert" className="close" type="button">
<span aria-hidden="true">×</span>
</button>
<h4>
{translate('INDEX.ACTIVATING_CHAIN')}<span id="activating-komodod-tridot">...</span><span id="activating-komodod-progress"></span>
</h4>
<p data-extcoin="COIN" id="extcoin-wallet-connection-alert-text">{translate('INDEX.KMD_STARTED')}</p>
</div>
<div className="row" data-extcoin="COIN" style={{margin: '-20px 0px 10px 0px'}}>
<div className="col-xs-12" data-extcoin="COIN" id="extcoin-progressbars">
<div className="progress">
<div className="progress-bar progress-bar-info progress-bar-striped active" style={{width: '0%', fontSize: '80%'}} role="progressbar" data-extcoin="COIN" id="extcoin-sync">
<span data-extcoin="COIN" id="extcoin-sync-percent">-</span> | <span data-extcoin="COIN" id="extcoin-synced-blocks">-</span> / <span data-extcoin="COIN" id="extcoin-longestchain">-</span> | <span data-lang="INDEX.CONNECTIONS"></span>: <span data-extcoin="COIN" id="extcoin-connections">-</span>
</div>
</div>
</div>
</div>
<div className="row" data-extcoin="COIN" id="extcoin-wallet" data-plugin="masonry">
<div className="col-xs-12">
<div className="col-lg-3 col-xs-12" data-extcoin="COIN" id="kmd_widget_get_total_balance_t">
<div className="widget widget-shadow" id="widgetLineareaOne">
<div className="widget-content white bg-yellow-800">
<div className="padding-20 padding-top-10">
<div className="clearfix">
<div className="pull-left padding-vertical-10">
<i className="icon fa-eye font-size-24 vertical-align-bottom margin-right-5"></i>{translate('INDEX.TRANSPARENT_BALANCE')}
</div>
<span className="pull-right padding-top-10" data-extcoin="COIN" id="kmd_transparent_balance" style={{fontSize: '22px'}}>-</span>
</div>
</div>
</div>
</div>
</div>
<div className="col-lg-3 col-xs-12" data-extcoin="COIN" id="kmd_widget_get_total_balance_z">
<div className="widget widget-shadow" id="widgetLineareaOne">
<div className="widget-content white bg-blue-grey-800">
<div className="padding-20 padding-top-10">
<div className="clearfix">
<div className="pull-left padding-vertical-10">
<i className="icon fa-eye-slash font-size-24 vertical-align-bottom margin-right-5"></i>{translate('INDEX.Z_BALANCE')}
</div>
<span className="pull-right padding-top-10" data-extcoin="COIN" id="kmd_private_balance" style={{fontSize: '22px'}}>-</span>
</div>
</div>
</div>
</div>
</div>
<div className="col-lg-3 col-xs-12" data-extcoin="COIN" id="kmd_widget_get_total_balance_i">
<div className="widget widget-shadow" id="widgetLineareaOne">
<div className="widget-content white bg-cyan-700">
<div className="padding-20 padding-top-10">
<div className="clearfix">
<div className="pull-left padding-vertical-10">
<i className="icon fa-money font-size-24 vertical-align-bottom margin-right-5"></i>{translate('INDEX.INTEREST_EARNED')}
</div>
<span className="pull-right padding-top-10" data-extcoin="COIN" id="kmd_total_interest_balance" style={{fontSize: '22px'}}>-</span>
</div>
</div>
</div>
</div>
</div>
<div className="col-lg-3 col-xs-12" data-extcoin="COIN" id="kmd_widget_get_total_balance_tzi">
<div className="widget widget-shadow" id="widgetLineareaOne">
<div className="widget-content white bg-green-600">
<div className="padding-20 padding-top-10">
<div className="clearfix">
<div className="pull-left padding-vertical-10">
<i className="icon fa-bullseye font-size-24 vertical-align-bottom margin-right-5"></i>{translate('INDEX.ZT_BALANCE')}
</div>
<span className="pull-right padding-top-10" data-extcoin="COIN" id="kmd_total_tz_balance" style={{fontSize: '22px'}}>-</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div data-extcoin="COIN" id="kmd_wallet_dashboardinfo">
<div className="col-xs-12 margin-top-20">
<div className="panel nav-tabs-horizontal">
<div data-extcoin="COIN" id="kmd_wallet_dashoard_section">
<div className="col-xlg-12 col-lg-12 col-sm-12 col-xs-12">
<div className="panel">
<header className="panel-heading">
<h3 className="panel-title">{translate('INDEX.TRANSACTION_HISTORY')}</h3>
</header>
<div className="panel-body">
<table className="table table-hover dataTable table-striped" data-extcoin="COIN" id="kmd-tx-history-tbl" width="100%">
<thead>
<tr>
<th>{translate('INDEX.TYPE')}</th>
<th>{translate('INDEX.DIRECTION')}</th>
<th>{translate('INDEX.CONFIRMATIONS')}</th>
<th>{translate('INDEX.AMOUNT')}</th>
<th>{translate('INDEX.TIME')}</th>
<th>{translate('INDEX.DEST_ADDRESS')}</th>
<th>{translate('INDEX.TX_DETAIL')}</th>
</tr>
</thead>
<tfoot>
<tr>
<th>{translate('INDEX.TYPE')}</th>
<th>{translate('INDEX.DIRECTION')}</th>
<th>{translate('INDEX.CONFIRMATIONS')}</th>
<th>{translate('INDEX.AMOUNT')}</th>
<th>{translate('INDEX.TIME')}</th>
<th>{translate('INDEX.DEST_ADDRESS')}</th>
<th>{translate('INDEX.TX_DETAIL')}</th>
</tr>
</tfoot>
</table>
</div>
</div>
<div data-edexcoin="COIN" id="edexcoin_recieve">
<div className="col-xs-12 margin-top-20">
<div className="panel nav-tabs-horizontal">
<div data-edexcoin="COIN" id="edexcoin_recieve_section">
<div className="col-xlg-12 col-lg-12 col-sm-12 col-xs-12">
<div className="panel">
<header className="panel-heading">
<div className="panel-actions">
</div>
</div>
</div>
</div>
</div>
<div data-extcoin="COIN" id="kmd_wallet_recieve">
<div className="col-xs-12 margin-top-20">
<div className="panel nav-tabs-horizontal">
<div data-extcoin="COIN" id="kmd_wallet_recieve_section">
<div className="col-xlg-12 col-lg-12 col-sm-12 col-xs-12">
<div className="panel">
<header className="panel-heading">
<div className="panel-actions">
<div className="dropdown">
<a className="dropdown-toggle white btn btn-warning" data-extcoin="COIN" id="GetNewRecievingAddress" data-toggle="dropdown" href="javascript:void(0)" aria-expanded="false" role="button">
<i className="icon md-arrows margin-right-10" aria-hidden="true"></i> {translate('INDEX.GET_NEW_ADDRESS')} <span className="caret"></span>
</a>
<ul className="dropdown-menu dropdown-menu-right" aria-labelledby="GetNewRecievingAddress" role="menu">
<li role="presentation">
<a href="javascript:void(0)" data-extcoin="COIN" id="kmd_get_new_taddr" role="menuitem">
<i className="icon fa-eye" aria-hidden="true"></i> {translate('INDEX.TRANSPARENT_ADDRESS')}
</a>
</li>
<li data-extcoin="COIN" role="presentation">
<a href="javascript:void(0)" data-extcoin="COIN" id="kmd_get_new_zaddr" role="menuitem">
<i className="icon fa-eye-slash" aria-hidden="true"></i> {translate('INDEX.PRIVATE_Z_ADDRESS')}
</a>
</li>
</ul>
</div>
</div>
<h3 className="panel-title">{translate('INDEX.RECEIVING_ADDRESS')}</h3>
</header>
<div className="panel-body">
<table className="table table-hover dataTable table-striped" data-extcoin="COIN" id="kmd-recieve-addr-tbl">
<thead>
<tr>
<th data-lang="INDEX.TYPE">{translate('INDEX.TYPE')}</th>
<th data-lang="INDEX.ADDRESS">{translate('INDEX.ADDRESS')}</th>
</tr>
</thead>
<tfoot>
<tr>
<th data-lang="INDEX.TYPE">{translate('INDEX.TYPE')}</th>
<th data-lang="INDEX.ADDRESS">{translate('INDEX.ADDRESS')}</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div data-extcoin="COIN" id="kmd_wallet_send">
<div className="col-xlg-12 col-md-12 col-sm-12 col-xs-12">
<div className="panel" id="projects">
<div className="panel-heading">
<h3 data-extcoin="COIN" className="panel-title">
{translate('INDEX.SEND')} <span data-extcoinname="COIN"></span>
</h3>
</div>
<div className="panel-body container-fluid">
<form className="extcoin-send-form" data-extcoin="COIN" method="post" role="form" autocomplete="off" onsubmit="return false">
<div className="row">
<div className="col-xlg-12 form-group form-material">
<label className="control-label" data-extcoin="COIN" for="kmd_wallet_send_from">{translate('INDEX.SEND_FROM')}</label>
<select className="form-control form-material showkmdwalletaddrs show-tick" data-extcoin="COIN" id="kmd_wallet_send_from" title="Select Transparent or Private Address" data-size="5"></select>
</div>
<div className="col-xlg-12 form-group form-material">
<label className="control-label" data-extcoin="COIN" for="kmd_wallet_sendto">{translate('INDEX.SEND_TO')}</label>
<input type="text" className="form-control" data-extcoin="COIN" id="kmd_wallet_sendto" name="kmd_wallet_sendto" placeholder="Enter Transparent or Private address" autocomplete="off" required />
</div>
<div className="col-lg-6 form-group form-material">
<label className="control-label" for="kmd_wallet_amount" data-extcoin="COIN" id="kmd_wallet_amount_label">
<span data-extcoinname="COIN"></span>
</label>
<input type="text" className="form-control" data-extcoin="COIN" id="kmd_wallet_amount" name="kmd_wallet_amount" placeholder="0.000" autocomplete="off" />
</div>
<div className="col-lg-6 form-group form-material">
<label className="control-label" data-extcoin="COIN" for="kmd_wallet_fee">{translate('INDEX.FEE')}</label>
<input type="text" className="form-control" data-extcoin="COIN" id="kmd_wallet_fee" name="kmd_wallet_fee" placeholder="0.000" value="0.0001" autocomplete="off" />
</div>
<div className="col-lg-12">
<span data-extcoin="KMD">
<b>{translate('INDEX.TOTAL')} (<span data-extcoinname="COIN"></span> - txfee):</b> <span data-extcoin="COIN" id="kmd_wallet_total_value">0.000</span> <span data-extcoin="COIN" id="kmd_wallet_total_coinname" data-extcoinname="COIN"></span>
</span>
</div>
<div className="col-lg-12">
<button type="submit" className="btn btn-primary waves-effect waves-light pull-right" data-toggle="modal" id="kmd_wallet_send_coins_btn">
{translate('INDEX.SEND')} <span data-extcoinname="COIN"></span>
</button>
</div>
</div>
</form>
</div>
</div>
</div>
<div className="col-xs-12">
<div className="row">
<div className="panel nav-tabs-horizontal">
<div data-extcoin="COIN" id="kmd_wallet_opids_status_section">
<div className="col-xlg-12 col-lg-12 col-sm-12 col-xs-12">
<div className="panel">
<header className="panel-heading">
<div className="panel-actions">
<button className="btn btn-info btn-block" id="kmd_opids_status_btn" type="button">
<i className="icon fa-repeat" aria-hidden="true"></i> {translate('INDEX.REFRESH')}
</button>
</div>
<h3 className="panel-title">{translate('INDEX.OPERATIONS_STATUSES')}</h3>
</header>
<div className="panel-body">
<table className="table table-hover dataTable table-striped" data-extcoin="COIN" id="kmd-opid-status-tbl" width="100%">
<thead>
<tr>
<th data-lang="INDEX.STATUS">{translate('INDEX.STATUS')}</th>
<th>ID</th>
<th data-lang="INDEX.TIME">{translate('INDEX.TIME')}</th>
<th data-lang="INDEX.RESULT">{translate('INDEX.RESULT')}</th>
</tr>
</thead>
<tfoot>
<tr>
<th data-lang="INDEX.STATUS">{translate('INDEX.STATUS')}</th>
<th>ID</th>
<th data-lang="INDEX.TIME">{translate('INDEX.TIME')}</th>
<th data-lang="INDEX.RESULT">{translate('INDEX.RESULT')}</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div data-extcoin="COIN" id="kmd_wallet_settings">
<div className="col-xlg-6 col-md-4">
<div className="panel" id="projects">
<div className="panel-heading">
<h3 className="panel-title">{translate('INDEX.WALLET_INFO')}</h3>
</div>
<div className="table-responsive">
<table className="table table-striped">
<h4 className="panel-title">{translate('INDEX.RECEIVING_ADDRESS')}</h4>
</header>
<div className="panel-body">
<table className="table table-hover dataTable table-striped" data-edexcoin="COIN" id="edexcoin-recieve-addr-tbl">
<thead>
<tr>
<th>{translate('INDEX.TYPE')}</th>
<th>{translate('INDEX.ADDRESS')}</th>
<th>{translate('INDEX.BALANCE')}</th>
<th>{translate('INDEX.INTEREST')}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{translate('INDEX.WALLET_VERSION')}</td>
<td>
<span data-extcoin="COIN" id="kmd_walletversion"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.BALANCE')}</td>
<td>
<span data-extcoin="COIN" id="kmd_balance"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.UNCONFIRMED_BALANCE')}</td>
<td>
<span data-extcoin="COIN" id="kmd_unconfirmed_balance"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.IMMATURE_BALANCE')}</td>
<td>
<span data-extcoin="COIN" id="kmd_immature_balance"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.TOTAL_TX_COUNT')}</td>
<td>
<span data-extcoin="COIN" id="KMDTotalTransactionsCount"></span>
</td>
</tr>
{this.renderAddressList()}
</tbody>
</table>
</div>
</div>
</div>
<div className="col-xlg-6 col-md-8">
<div className="panel" id="projects">
<div className="panel-heading">
<h3 className="panel-title">
<span data-extcointitle="COIN">Komodo</span> {translate('INDEX.INFO')}
</h3>
</div>
<div className="table-responsive">
<table className="table table-striped">
<tbody>
<tr>
<td>{translate('INDEX.VERSION')}</td>
<td>
<span data-extcoin="COIN" id="kmd_version"></span>
</td>
</tr>
<tfoot>
<tr>
<td>{translate('INDEX.PROTOCOL_VERSION')}</td>
<td>
<span data-extcoin="COIN" id="kmd_protocolversion"></span>
</td>
<th>{translate('INDEX.TYPE')}</th>
<th>{translate('INDEX.ADDRESS')}</th>
<th>{translate('INDEX.BALANCE')}</th>
<th>{translate('INDEX.INTEREST')}</th>
</tr>
<tr>
<td>{translate('INDEX.NOTARIZED')}</td>
<td>
<span data-extcoin="COIN" id="kmd_notarized"></span>
</td>
</tr>
<tr>
<td>
{translate('INDEX.NOTARIZED')} Hash
</td>
<td>
<span data-extcoin="COIN" id="kmd_notarizedhash"></span>
</td>
</tr>
<tr>
<td>
{translate('INDEX.NOTARIZED')} BTC
</td>
<td>
<span data-extcoin="COIN" id="kmd_notarizedbtc"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.BLOCKS')}</td>
<td>
<span data-extcoin="COIN" id="kmd_blocks"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.CONNECTIONS')}</td>
<td>
<span data-extcoin="COIN" id="kmd_connections"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.DIFFICULTY')}</td>
<td>
<span data-extcoin="COIN" id="kmd_difficulty"></span>
</td>
</tr>
<tr>
<td>Testnet</td>
<td>
<span data-extcoin="COIN" id="kmd_testnet"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.PAY_TX_FEE')}</td>
<td>
<span data-extcoin="COIN" id="kmd_paytxfee"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.RELAY_FEE')}</td>
<td>
<span data-extcoin="COIN" id="kmd_relayfee"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.ERRORS')}</td>
<td>
<span data-extcoin="COIN" id="kmd_errors"></span>
</td>
</tr>
</tbody>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
<div className="modal fade modal-3d-sign" data-extcoin="COIN" id="kmd_txid_info_mdl" aria-hidden="false" role="dialog" tabindex="-1">
<div className="modal-dialog modal-center modal-lg">
<div className="modal-content">
<div className="modal-body">
<div className="panel nav-tabs-horizontal">
<ul className="nav nav-tabs nav-tabs-line" data-plugin="nav-tabs" role="tablist">
<li className="active" role="presentation">
<a data-toggle="tab" href="#KmdTxIDInfotab1" data-extcoin="COIN" aria-controls="KmdTxIDInfotab1" role="tab">
<i className="icon md-balance-wallet" aria-hidden="true"></i>TxID Info
</a>
</li>
<li role="presentation">
<a data-toggle="tab" href="#KmdTxIDInfotab2" data-extcoin="COIN" aria-controls="KmdTxIDInfotab2" role="tab">
<i className="icon md-plus-square" aria-hidden="true"></i>vjointsplits, details
</a>
</li>
<li role="presentation">
<a data-toggle="tab" href="#KmdTxIDInfotab3" data-extcoin="COIN" aria-controls="KmdTxIDInfotab3" role="tab">
<i className="icon wb-briefcase" aria-hidden="true"></i>hex
</a>
</li>
</ul>
<div className="panel-body">
<div className="tab-content">
<div className="tab-pane active" id="KmdTxIDInfotab1" data-extcoin="COIN" role="tabpanel">
<table className="table table-striped">
<tbody>
<tr>
<td>amount</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_amount"></span>
</td>
</tr>
<tr>
<td>fee</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_fee"></span>
</td>
</tr>
<tr>
<td>confirmations</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_confirmations"></span>
</td>
</tr>
<tr>
<td>blockhash</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_blockhash"></span>
</td>
</tr>
<tr>
<td>blockindex</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_blockindex"></span>
</td>
</tr>
<tr>
<td>blocktime</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_blocktime"></span>
</td>
</tr>
<tr>
<td>txid</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_txid"></span>
</td>
</tr>
<tr>
<td>walletconflicts</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_walletconflicts"></span>
</td>
</tr>
<tr>
<td>time</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_time"></span>
</td>
</tr>
<tr>
<td>timereceived</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_timereceived"></span>
</td>
</tr>
</tbody>
</table>
</div>
<div className="tab-pane" id="KmdTxIDInfotab2" data-extcoin="COIN" role="tabpanel">
<table className="table table-striped">
<tbody>
<tr>
<td>vjoinsplit</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_vjoinsplit"></span>
</td>
</tr>
<tr>
<td>details</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_details"></span>
</td>
</tr>
</tbody>
</table>
</div>
<div className="tab-pane" id="KmdTxIDInfotab3" data-extcoin="COIN" role="tabpanel">
<textarea id="kmd_txid_info_hex" data-extcoin="COIN" style={{width: '100%', height: '170px'}} rows="10" cols="80" disabled></textarea>
</div>
</div>
</div>
</div>
</div>
<div className="modal-footer">
<button type="button" className="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
);

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

@ -1,19 +1,42 @@
import React from 'react';
import { translate } from '../../translate/translate';
import { iguanaActiveHandle, encryptWallet, settingsWifkeyState } from '../../actions/actionCreators';
import {
iguanaActiveHandle,
encryptWallet,
settingsWifkeyState,
importPrivKey,
getDebugLog,
getPeersList,
addPeerNode
} from '../../actions/actionCreators';
import Store from '../../store';
import AddCoinOptionsCrypto from '../addcoin/addcoinOptionsCrypto';
import AddCoinOptionsAC from '../addcoin/addcoinOptionsAC';
import AddCoinOptionsACFiat from '../addcoin/addcoinOptionsACFiat';
/*
TODO:
1) pre-select active coin in add node tab
2) add agama config section
3) add fiat section
4) kickstart section
*/
class Settings extends React.Component {
constructor(props) {
super(props);
this.state = {
activeTab: 0,
debugLinesCount: 10,
debugTarget: 'iguana',
};
this.exportWifKeys = this.exportWifKeys.bind(this);
this.updatePassphraseInput = this.updatePassphraseInput.bind(this);
this.updateInput = this.updateInput.bind(this);
this.importWifKey = this.importWifKey.bind(this);
this.readDebugLog = this.readDebugLog.bind(this);
this.checkNodes = this.checkNodes.bind(this);
this.addNode = this.addNode.bind(this);
this.renderPeersList = this.renderPeersList.bind(this);
this.renderSNPeersList = this.renderSNPeersList.bind(this);
}
componentDidMount() {
@ -30,7 +53,59 @@ class Settings extends React.Component {
Store.dispatch(encryptWallet(this.state.wifkeysPassphrase, settingsWifkeyState, this.props.ActiveCoin.coin));
}
updatePassphraseInput(e) {
importWifKey() {
Store.dispatch(importPrivKey(this.state.importWifKey));
}
readDebugLog() {
Store.dispatch(getDebugLog(this.state.debugTarget, this.state.debugLinesCount));
}
checkNodes() {
if (this.state.getPeersCoin) {
Store.dispatch(getPeersList(this.state.getPeersCoin.split('|')[0]));
}
}
addNode() {
if (this.state.addNodeCoin) {
Store.dispatch(addPeerNode(this.state.addNodeCoin.split('|')[0], this.state.addPeerIP));
}
}
renderPeersList() {
if (this.state.getPeersCoin) {
const coin = this.state.getPeersCoin.split('|')[0];
if (this.props.Settings.rawPeers &&
this.state.getPeersCoin &&
this.props.Settings.rawPeers[coin]) {
return this.props.Settings.rawPeers[coin].map((ip) => <div key={ip}>{ip}</div>);
} else {
return null;
}
} else {
return null;
}
}
renderSNPeersList() {
if (this.state.getPeersCoin) {
const coin = this.state.getPeersCoin.split('|')[0];
if (this.props.Settings.supernetPeers &&
this.state.getPeersCoin &&
this.props.Settings.supernetPeers[coin]) {
return this.props.Settings.supernetPeers[coin].map((ip) => <div key={ip}>{ip}</div>);
} else {
return null;
}
} else {
return null;
}
}
updateInput(e) {
this.setState({
[e.target.name]: e.target.value,
});
@ -119,7 +194,7 @@ class Settings extends React.Component {
</div>
<div className="col-sm-8 col-xs-12">
<div className="form-group">
<select className="form-control form-material" id="settings_select_coin_options">
<select className="form-control form-material" id="settings_select_coin_options" name="getPeersCoin" onChange={this.updateInput}>
<option>{translate('INDEX.SELECT_COIN')}</option>
<AddCoinOptionsCrypto />
<AddCoinOptionsAC />
@ -128,17 +203,17 @@ class Settings extends React.Component {
</div>
</div>
<div className="col-sm-4 col-xs-12" style={{textAlign: 'center'}}>
<button type="button" className="btn btn-primary waves-effect waves-light" data-toggle="modal" data-dismiss="modal" id="settings_getcoinpeers_btn">{translate('INDEX.CHECK_NODES')}</button>
<button type="button" className="btn btn-primary waves-effect waves-light" data-toggle="modal" data-dismiss="modal" id="settings_getcoinpeers_btn" onClick={this.checkNodes}>{translate('INDEX.CHECK_NODES')}</button>
</div>
<div className="col-sm-12">
<h5>
SuperNET Peers: <span id="coin_supernetpeers_h"></span>
</h5>
<p id="coin_supernetpeers"></p>
<p id="coin_supernetpeers">{this.renderSNPeersList()}</p>
<h5>
Raw Peers: <span id="coin_rawpeers_h"></span>
</h5>
<p id="coin_rawpeers"></p>
<p id="coin_rawpeers">{this.renderPeersList()}</p>
</div>
</div>
@ -148,7 +223,7 @@ class Settings extends React.Component {
</div>
<div className="col-sm-8 col-xs-12">
<div className="form-group">
<select className="form-control form-material" id="settings_select_coin_addpeer_options">
<select className="form-control form-material" id="settings_select_coin_addpeer_options" name="addNodeCoin" onChange={this.updateInput}>
<option>{translate('INDEX.SELECT_COIN')}</option>
<AddCoinOptionsCrypto />
<AddCoinOptionsAC />
@ -156,11 +231,11 @@ class Settings extends React.Component {
</select>
</div>
<div className="form-group">
<input type="text" className="form-control" id="settings_add_peer_ip" name="settings_add_peer_ip" placeholder="Add Peer IP" />
<input type="text" className="form-control" id="settings_add_peer_ip" name="addPeerIP" placeholder="Add Peer IP" onChange={this.updateInput} />
</div>
</div>
<div className="col-sm-4 col-xs-12" style={{textAlign: 'center'}}>
<button type="button" className="btn btn-primary waves-effect waves-light" data-toggle="modal" data-dismiss="modal" id="settings_addcoinpeers_btn">{translate('INDEX.ADD_NODE')}</button>
<button type="button" className="btn btn-primary waves-effect waves-light" data-toggle="modal" data-dismiss="modal" id="settings_addcoinpeers_btn" onClick={this.addNode}>{translate('INDEX.ADD_NODE')}</button>
</div>
</div>
</div>
@ -207,7 +282,7 @@ class Settings extends React.Component {
<div className="col-sm-12"></div>
<form className="wifkeys-form" method="post" action="javascript:" autoComplete="off">
<div className="form-group form-material floating">
<input type="password" className="form-control" name="wifkeysPassphrase" id="wifkeys_passphrase" onChange={this.updatePassphraseInput} />
<input type="password" className="form-control" name="wifkeysPassphrase" id="wifkeys_passphrase" onChange={this.updateInput} />
<label className="floating-label" htmlFor="wifkeys_passphrase">{translate('INDEX.PASSPHRASE')}</label>
</div>
<div className="col-sm-12 col-xs-12" style={{textAlign: 'center'}}>
@ -217,7 +292,7 @@ class Settings extends React.Component {
<div className="col-sm-12" style={{paddingTop: '15px'}}>
<div className="row" id="wif-priv-keys" data-plugin="masonry">
<table class="table">
<table className={this.props.Settings && this.props.Settings.address ? 'table show' : 'table hide'}>
<tr>
<td style={{width: '5%'}}>
<b>{this.props.ActiveCoin.coin}</b>
@ -256,11 +331,11 @@ class Settings extends React.Component {
<div className="col-sm-12"></div>
<form className="wifkeys-import-form" method="post" action="javascript:" autoComplete="off">
<div className="form-group form-material floating">
<input type="text" className="form-control" name="import_wifkey" id="import_wifkey" />
<input type="text" className="form-control" name="importWifKey" id="import_wifkey" onChange={this.updateInput} />
<label className="floating-label" htmlFor="import_wifkey">{translate('INDEX.INPUT_PRIV_KEY')}</label>
</div>
<div className="col-sm-12 col-xs-12" style={{textAlign: 'center'}}>
<button type="button" className="btn btn-primary waves-effect waves-light" data-toggle="modal" data-dismiss="modal" id="import_wifkey_btn">{translate('INDEX.IMPORT_PRIV_KEY')}</button>
<button type="button" className="btn btn-primary waves-effect waves-light" data-toggle="modal" data-dismiss="modal" id="import_wifkey_btn" onClick={this.importWifKey}>{translate('INDEX.IMPORT_PRIV_KEY')}</button>
</div>
</form>
<div className="col-sm-12" style={{paddingTop: '15px'}}>
@ -284,26 +359,26 @@ class Settings extends React.Component {
<div className="col-sm-12"></div>
<form className="read-debug-log-import-form" method="post" action="javascript:" autoComplete="off">
<div className="form-group form-material floating">
<input type="text" className="form-control" name="read_debug_log_lines" id="read_debug_log_lines" value="10" />
<input type="text" className="form-control" name="debugLinesCount" id="read_debug_log_lines" value={this.state.debugLinesCount} onChange={this.updateInput} />
<label className="floating-label" htmlFor="read_debug_log_lines">{translate('INDEX.DEBUG_LOG_LINES')}</label>
</div>
<div className="form-group form-material floating">
<select className="form-control form-material" id="settings_select_debuglog_options">
<select className="form-control form-material" name="debugTarget" id="settings_select_debuglog_options" onChange={this.updateInput}>
<option value="iguana">Iguana</option>
<option value="komodo">Komodo</option>
</select>
<label className="floating-label" htmlFor="settings_select_debuglog_options">{translate('INDEX.TARGET')}</label>
</div>
<div className="col-sm-12 col-xs-12" style={{textAlign: 'center'}}>
<button type="submit" className="btn btn-primary waves-effect waves-light" data-toggle="modal" data-dismiss="modal" id="read_debug_log_btn">{translate('INDEX.LOAD_DEBUG_LOG')}</button>
<button type="button" className="btn btn-primary waves-effect waves-light" data-toggle="modal" data-dismiss="modal" id="read_debug_log_btn" onClick={this.readDebugLog}>{translate('INDEX.LOAD_DEBUG_LOG')}</button>
</div>
<div className="col-sm-12 col-xs-12" style={{textAlign: 'center'}}>
<div className="col-sm-12 col-xs-12" style={{textAlign: 'left'}}>
<br />
<textarea id="read_debug_log_textarea" style={{width: '100%', height: '200px'}}></textarea>
<div style={{padding: '20px 0'}}>{this.props.Settings.debugLog}</div>
</div>
</form>
<div className="col-sm-12" style={{paddingTop: '15px'}}>
<div className="row" id="wif-priv-keys" data-plugin="masonry"></div>
<div className="row" data-plugin="masonry"></div>
</div>
</div>
</div>

76
react/src/components/dashboard/walletsBasiliskConnection.js

@ -0,0 +1,76 @@
import React from 'react';
import { translate } from '../../translate/translate';
class WalletsBasiliskConnection extends React.Component {
render() {
if (this.props && this.props.Dashboard.basiliskConnection) {
return (
<div>
<div className="modal show" id="RefreshBasiliskConnectionsMdl" aria-hidden="false" role="dialog">
<div className="modal-dialog modal-center modal-md">
<div className="modal-content">
<div className="modal-header bg-orange-a400 wallet-send-header" style={{borderRadius: '3px 3px 0 0'}}>
<h4 className="modal-title white">
<span className="icon fa-refresh" style={{margin: '0'}}></span> {translate('INDEX.REFRESHING_BASILISK_NET')}... <span id="mdl_receive_coin_name"></span>
</h4>
</div>
<div className="modal-body" style={{textAlign: 'center'}}>
<div className="loader-wrapper active">
<div className="loader-layer loader-blue">
<div className="loader-circle-left">
<div className="circle"></div>
</div>
<div className="loader-circle-gap"></div>
<div className="loader-circle-right">
<div className="circle"></div>
</div>
</div>
<div className="loader-layer loader-red">
<div className="loader-circle-left">
<div className="circle"></div>
</div>
<div className="loader-circle-gap"></div>
<div className="loader-circle-right">
<div className="circle"></div>
</div>
</div>
<div className="loader-layer loader-green">
<div className="loader-circle-left">
<div className="circle"></div>
</div>
<div className="loader-circle-gap"></div>
<div className="loader-circle-right">
<div className="circle"></div>
</div>
</div>
<div className="loader-layer loader-yellow">
<div className="loader-circle-left">
<div className="circle"></div>
</div>
<div className="loader-circle-gap"></div>
<div className="loader-circle-right">
<div className="circle"></div>
</div>
</div>
</div>
<h5 className="text-left">
<span id="basilisk-connections-refresh-title">-</span> <span className="pull-right" id="basilisk-connections-refresh-percent">-</span>
</h5>
<div className="progress progress-sm">
<div className="progress-bar progress-bar-info progress-bar-striped active" style={{width: '10%', fontSize: '80%'}} role="progressbar" data-edexcoin="COIN" id="basilisk-connections-refresh-progress-bar"></div>
</div>
<pre data-edexcoin="COIN" id="basilisk-connections-refresh-status-output"></pre>
</div>
</div>
</div>
</div>
<div className="modal-backdrop show in"></div>
</div>
);
} else {
return null;
}
}
}
export default WalletsBasiliskConnection;

54
react/src/components/dashboard/walletsBasiliskRefresh.js

@ -3,36 +3,40 @@ import { translate } from '../../translate/translate';
class WalletsBasiliskRefresh extends React.Component {
render() {
return (
<div data-edexcoin="COIN" id="edexcoin_dashboard_basilisk_refresh_status">
<div className="col-xs-12 margin-top-20">
<div className="col-xs-12">
<div className="panel">
<div className="panel-heading">
<h3 className="panel-title">{translate('INDEX.FETCHING_BASILISK_DATA')}</h3>
<div className="panel-actions">
<a className="panel-action icon md-refresh-alt" data-toggle="panel-refresh" data-load-type="blue-only" aria-hidden="true"></a>
if (this.props && this.props.Dashboard.basiliskRefresh) {
return (
<div data-edexcoin="COIN" id="edexcoin_dashboard_basilisk_refresh_status">
<div className="col-xs-12 margin-top-20">
<div className="col-xs-12">
<div className="panel">
<div className="panel-heading">
<h3 className="panel-title">{translate('INDEX.FETCHING_BASILISK_DATA')}</h3>
<div className="panel-actions">
<a className="panel-action icon md-refresh-alt" data-toggle="panel-refresh" data-load-type="blue-only" aria-hidden="true"></a>
</div>
</div>
<div className="table-responsive">
<table className="table table-hover table-striped tbl_edexcoin_dashboard_basilisk_refresh_status">
<thead>
<tr>
<th>{translate('INDEX.ADDRESS')}</th>
<th>{translate('INDEX.LIST_UNSPENT')}</th>
<th>{translate('INDEX.LIST_TRANSACTIONS')}</th>
<th>{translate('INDEX.GET_BALANCE')}</th>
<th>{translate('INDEX.REFRESH')}</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div className="table-responsive">
<table className="table table-hover table-striped tbl_edexcoin_dashboard_basilisk_refresh_status">
<thead>
<tr>
<th>{translate('INDEX.ADDRESS')}</th>
<th>{translate('INDEX.LIST_UNSPENT')}</th>
<th>{translate('INDEX.LIST_TRANSACTIONS')}</th>
<th>{translate('INDEX.GET_BALANCE')}</th>
<th>{translate('INDEX.REFRESH')}</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
);
);
} else {
return null;
}
}
}

35
react/src/components/dashboard/walletsData.js

@ -1,7 +1,7 @@
import React from 'react';
import { translate } from '../../translate/translate';
/*import { } from '../../actions/actionCreators';
import Store from '../../store';*/
import { basiliskRefresh, basiliskConnection, getDexNotaries } from '../../actions/actionCreators';
import Store from '../../store';
class WalletsData extends React.Component {
constructor(props) {
@ -10,6 +10,9 @@ class WalletsData extends React.Component {
basiliskActionsMenu: false,
};
this.toggleBasiliskActionsMenu = this.toggleBasiliskActionsMenu.bind(this);
this.basiliskRefreshAction = this.basiliskRefreshAction.bind(this);
this.basiliskConnectionAction = this.basiliskConnectionAction.bind(this);
this.getDexNotariesAction = this.getDexNotariesAction.bind(this);
}
toggleBasiliskActionsMenu() {
@ -18,8 +21,24 @@ class WalletsData extends React.Component {
}));
}
basiliskRefreshAction() {
if (this.props.Dashboard) {
Store.dispatch(basiliskRefresh(!this.props.Dashboard.basiliskRefresh));
}
}
basiliskConnectionAction() {
if (this.props.Dashboard) {
Store.dispatch(basiliskConnection(!this.props.Dashboard.basiliskConnection));
}
}
getDexNotariesAction() {
Store.dispatch(getDexNotaries(this.props.ActiveCoin.coin));
}
render() {
if (this.props && this.props.coin) {
if (this.props && this.props.ActiveCoin && this.props.ActiveCoin.coin) {
return (
<div data-edexcoin="COIN" id="edexcoin_dashboardinfo">
<div className="col-xs-12 margin-top-20">
@ -28,7 +47,7 @@ class WalletsData extends React.Component {
<div className="col-xlg-12 col-lg-12 col-sm-12 col-xs-12 edexcoin_dashoard_section_main_div">
<div id="edexcoin_txhistory" className="panel">
<header className="panel-heading" style={{zIndex: '10'}}>
<div className="panel-actions">
<div className={this.props.ActiveCoin.mode === 'basilisk' ? 'panel-actions' : 'panel-actions hide'}>
<a href="javascript:void(0)" className="dropdown-toggle white btn-xs btn-info btn_refresh_edexcoin_dashboard" data-edexcoin="COIN" aria-expanded="false" role="button">
<i className="icon fa-refresh margin-right-10" aria-hidden="true"></i> {translate('INDEX.REFRESH')}
</a>
@ -40,22 +59,22 @@ class WalletsData extends React.Component {
<ul className="dropdown-menu dropdown-menu-right" aria-labelledby="btn_edexcoin_basilisk"
role="menu">
<li role="presentation">
<a href="javascript:void(0)" className="btn_edexcoin_dashboard_getnotaries" data-edexcoin="COIN" id="btn_edexcoin_dashboard_getnotaries" role="menuitem">
<a className="btn_edexcoin_dashboard_getnotaries" data-edexcoin="COIN" id="btn_edexcoin_dashboard_getnotaries" role="menuitem" onClick={this.getDexNotariesAction}>
<i className="icon fa-sitemap" aria-hidden="true"></i> {translate('INDEX.GET_NOTARY_NODES_LIST')}
</a>
</li>
<li role="presentation">
<a href="javascript:void(0)" className="btn_edexcoin_dashboard_refresh_basilisk_conn" data-edexcoin="COIN" id="btn_edexcoin_dashboard_refresh_basilisk_conn" role="menuitem">
<a className="btn_edexcoin_dashboard_refresh_basilisk_conn" data-edexcoin="COIN" id="btn_edexcoin_dashboard_refresh_basilisk_conn" role="menuitem" onClick={this.basiliskConnectionAction}>
<i className="icon wb-refresh" aria-hidden="true"></i> {translate('INDEX.REFRESH_BASILISK_CONNECTIONS')}
</a>
</li>
<li data-edexcoin="COIN" role="presentation">
<a href="javascript:void(0)" className="btn_edexcoin_dashboard_fetchdata" data-edexcoin="COIN" id="btn_edexcoin_dashboard_fetchdata" role="menuitem">
<a className="btn_edexcoin_dashboard_fetchdata" data-edexcoin="COIN" id="btn_edexcoin_dashboard_fetchdata" role="menuitem" onClick={this.basiliskRefreshAction}>
<i className="icon fa-cloud-download" aria-hidden="true"></i> {translate('INDEX.FETCH_WALLET_DATA')}
</a>
</li>
<li data-edexcoin="COIN" role="presentation">
<a href="javascript:void(0)" className="btn_edexcoin_dashboard_refetchdata" data-edexcoin="COIN" id="btn_edexcoin_dashboard_refetchdata" role="menuitem">
<a className="btn_edexcoin_dashboard_refetchdata" data-edexcoin="COIN" id="btn_edexcoin_dashboard_refetchdata" role="menuitem">
<i className="icon fa-cloud-download" aria-hidden="true"></i> {translate('INDEX.REFETCH_WALLET_DATA')}
</a>
</li>

556
react/src/components/dashboard/walletsNative.js

@ -0,0 +1,556 @@
import React from 'react';
import { translate } from '../../translate/translate';
class WalletsNative extends React.Component {
render() {
if (this.props && this.props.ActiveCoin && this.props.ActiveCoin.mode === 'native') {
return (
<div className="page" data-animsition-in="fade-in" data-animsition-out="fade-out" style={{marginLeft: '0'}}>
<div className="page-content" data-extcoin="COIN" id="section-extcoin">
<div role="alert" className="alert alert-danger alert-dismissible" data-extcoin="COIN" id="extcoin-wallet-connection-alert">
<button aria-label="Close" data-dismiss="alert" className="close" type="button">
<span aria-hidden="true">×</span>
</button>
<h4>{translate('INDEX.OOPS_ERROR')}</h4>
<p data-extcoin="COIN" id="extcoin-wallet-connection-alert-text">
<span>{translate('INDEX.OOPS_ERROR_DESC')}</span>
<code>server=1</code><br/>
<code>rpcport=</code><br/>
<code>rpcuser=</code><br/>
<code>rpcpassword=</code>
</p>
</div>
<div role="alert" className="alert alert-info alert-dismissible" data-extcoin="COIN" id="extcoin-wallet-activating-alert">
<button aria-label="Close" data-dismiss="alert" className="close" type="button">
<span aria-hidden="true">×</span>
</button>
<h4>
{translate('INDEX.ACTIVATING_CHAIN')}<span id="activating-komodod-tridot">...</span><span id="activating-komodod-progress"></span>
</h4>
<p data-extcoin="COIN" id="extcoin-wallet-connection-alert-text">{translate('INDEX.KMD_STARTED')}</p>
</div>
<div className="row" data-extcoin="COIN" style={{margin: '-20px 0px 10px 0px'}}>
<div className="col-xs-12" data-extcoin="COIN" id="extcoin-progressbars">
<div className="progress">
<div className="progress-bar progress-bar-info progress-bar-striped active" style={{width: '0%', fontSize: '80%'}} role="progressbar" data-extcoin="COIN" id="extcoin-sync">
<span data-extcoin="COIN" id="extcoin-sync-percent">-</span> | <span data-extcoin="COIN" id="extcoin-synced-blocks">-</span> / <span data-extcoin="COIN" id="extcoin-longestchain">-</span> | {translate('INDEX.CONNECTIONS')}: <span data-extcoin="COIN" id="extcoin-connections">-</span>
</div>
</div>
</div>
</div>
<div className="row" data-extcoin="COIN" id="extcoin-wallet" data-plugin="masonry">
<div className="col-xs-12">
<div className="col-lg-3 col-xs-12" data-extcoin="COIN" id="kmd_widget_get_total_balance_t">
<div className="widget widget-shadow" id="widgetLineareaOne">
<div className="widget-content white bg-yellow-800">
<div className="padding-20 padding-top-10">
<div className="clearfix">
<div className="pull-left padding-vertical-10">
<i className="icon fa-eye font-size-24 vertical-align-bottom margin-right-5"></i>{translate('INDEX.TRANSPARENT_BALANCE')}
</div>
<span className="pull-right padding-top-10" data-extcoin="COIN" id="kmd_transparent_balance" style={{fontSize: '22px'}}>-</span>
</div>
</div>
</div>
</div>
</div>
<div className="col-lg-3 col-xs-12" data-extcoin="COIN" id="kmd_widget_get_total_balance_z">
<div className="widget widget-shadow" id="widgetLineareaOne">
<div className="widget-content white bg-blue-grey-800">
<div className="padding-20 padding-top-10">
<div className="clearfix">
<div className="pull-left padding-vertical-10">
<i className="icon fa-eye-slash font-size-24 vertical-align-bottom margin-right-5"></i>{translate('INDEX.Z_BALANCE')}
</div>
<span className="pull-right padding-top-10" data-extcoin="COIN" id="kmd_private_balance" style={{fontSize: '22px'}}>-</span>
</div>
</div>
</div>
</div>
</div>
<div className="col-lg-3 col-xs-12" data-extcoin="COIN" id="kmd_widget_get_total_balance_i">
<div className="widget widget-shadow" id="widgetLineareaOne">
<div className="widget-content white bg-cyan-700">
<div className="padding-20 padding-top-10">
<div className="clearfix">
<div className="pull-left padding-vertical-10">
<i className="icon fa-money font-size-24 vertical-align-bottom margin-right-5"></i>{translate('INDEX.INTEREST_EARNED')}
</div>
<span className="pull-right padding-top-10" data-extcoin="COIN" id="kmd_total_interest_balance" style={{fontSize: '22px'}}>-</span>
</div>
</div>
</div>
</div>
</div>
<div className="col-lg-3 col-xs-12" data-extcoin="COIN" id="kmd_widget_get_total_balance_tzi">
<div className="widget widget-shadow" id="widgetLineareaOne">
<div className="widget-content white bg-green-600">
<div className="padding-20 padding-top-10">
<div className="clearfix">
<div className="pull-left padding-vertical-10">
<i className="icon fa-bullseye font-size-24 vertical-align-bottom margin-right-5"></i>{translate('INDEX.ZT_BALANCE')}
</div>
<span className="pull-right padding-top-10" data-extcoin="COIN" id="kmd_total_tz_balance" style={{fontSize: '22px'}}>-</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div data-extcoin="COIN" id="kmd_wallet_dashboardinfo">
<div className="col-xs-12 margin-top-20">
<div className="panel nav-tabs-horizontal">
<div data-extcoin="COIN" id="kmd_wallet_dashoard_section">
<div className="col-xlg-12 col-lg-12 col-sm-12 col-xs-12">
<div className="panel">
<header className="panel-heading">
<h3 className="panel-title">{translate('INDEX.TRANSACTION_HISTORY')}</h3>
</header>
<div className="panel-body">
<table className="table table-hover dataTable table-striped" data-extcoin="COIN" id="kmd-tx-history-tbl" width="100%">
<thead>
<tr>
<th>{translate('INDEX.TYPE')}</th>
<th>{translate('INDEX.DIRECTION')}</th>
<th>{translate('INDEX.CONFIRMATIONS')}</th>
<th>{translate('INDEX.AMOUNT')}</th>
<th>{translate('INDEX.TIME')}</th>
<th>{translate('INDEX.DEST_ADDRESS')}</th>
<th>{translate('INDEX.TX_DETAIL')}</th>
</tr>
</thead>
<tfoot>
<tr>
<th>{translate('INDEX.TYPE')}</th>
<th>{translate('INDEX.DIRECTION')}</th>
<th>{translate('INDEX.CONFIRMATIONS')}</th>
<th>{translate('INDEX.AMOUNT')}</th>
<th>{translate('INDEX.TIME')}</th>
<th>{translate('INDEX.DEST_ADDRESS')}</th>
<th>{translate('INDEX.TX_DETAIL')}</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div data-extcoin="COIN" id="kmd_wallet_recieve">
<div className="col-xs-12 margin-top-20">
<div className="panel nav-tabs-horizontal">
<div data-extcoin="COIN" id="kmd_wallet_recieve_section">
<div className="col-xlg-12 col-lg-12 col-sm-12 col-xs-12">
<div className="panel">
<header className="panel-heading">
<div className="panel-actions">
<div className="dropdown">
<a className="dropdown-toggle white btn btn-warning" data-extcoin="COIN" id="GetNewRecievingAddress" data-toggle="dropdown" href="javascript:void(0)" aria-expanded="false" role="button">
<i className="icon md-arrows margin-right-10" aria-hidden="true"></i> {translate('INDEX.GET_NEW_ADDRESS')} <span className="caret"></span>
</a>
<ul className="dropdown-menu dropdown-menu-right" aria-labelledby="GetNewRecievingAddress" role="menu">
<li role="presentation">
<a href="javascript:void(0)" data-extcoin="COIN" id="kmd_get_new_taddr" role="menuitem">
<i className="icon fa-eye" aria-hidden="true"></i> {translate('INDEX.TRANSPARENT_ADDRESS')}
</a>
</li>
<li data-extcoin="COIN" role="presentation">
<a href="javascript:void(0)" data-extcoin="COIN" id="kmd_get_new_zaddr" role="menuitem">
<i className="icon fa-eye-slash" aria-hidden="true"></i> {translate('INDEX.PRIVATE_Z_ADDRESS')}
</a>
</li>
</ul>
</div>
</div>
<h3 className="panel-title">{translate('INDEX.RECEIVING_ADDRESS')}</h3>
</header>
<div className="panel-body">
<table className="table table-hover dataTable table-striped" data-extcoin="COIN" id="kmd-recieve-addr-tbl">
<thead>
<tr>
<th>{translate('INDEX.TYPE')}</th>
<th data-lang="INDEX.ADDRESS">{translate('INDEX.ADDRESS')}</th>
</tr>
</thead>
<tfoot>
<tr>
<th data-lang="INDEX.TYPE">{translate('INDEX.TYPE')}</th>
<th data-lang="INDEX.ADDRESS">{translate('INDEX.ADDRESS')}</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div data-extcoin="COIN" id="kmd_wallet_send">
<div className="col-xlg-12 col-md-12 col-sm-12 col-xs-12">
<div className="panel" id="projects">
<div className="panel-heading">
<h3 data-extcoin="COIN" className="panel-title">
{translate('INDEX.SEND')} <span data-extcoinname="COIN"></span>
</h3>
</div>
<div className="panel-body container-fluid">
<form className="extcoin-send-form" data-extcoin="COIN" method="post" role="form" autocomplete="off" onsubmit="return false">
<div className="row">
<div className="col-xlg-12 form-group form-material">
<label className="control-label" data-extcoin="COIN" for="kmd_wallet_send_from">{translate('INDEX.SEND_FROM')}</label>
<select className="form-control form-material showkmdwalletaddrs show-tick" data-extcoin="COIN" id="kmd_wallet_send_from" title="Select Transparent or Private Address" data-size="5"></select>
</div>
<div className="col-xlg-12 form-group form-material">
<label className="control-label" data-extcoin="COIN" for="kmd_wallet_sendto">{translate('INDEX.SEND_TO')}</label>
<input type="text" className="form-control" data-extcoin="COIN" id="kmd_wallet_sendto" name="kmd_wallet_sendto" placeholder="Enter Transparent or Private address" autocomplete="off" required />
</div>
<div className="col-lg-6 form-group form-material">
<label className="control-label" for="kmd_wallet_amount" data-extcoin="COIN" id="kmd_wallet_amount_label">
<span data-extcoinname="COIN"></span>
</label>
<input type="text" className="form-control" data-extcoin="COIN" id="kmd_wallet_amount" name="kmd_wallet_amount" placeholder="0.000" autocomplete="off" />
</div>
<div className="col-lg-6 form-group form-material">
<label className="control-label" data-extcoin="COIN" for="kmd_wallet_fee">{translate('INDEX.FEE')}</label>
<input type="text" className="form-control" data-extcoin="COIN" id="kmd_wallet_fee" name="kmd_wallet_fee" placeholder="0.000" value="0.0001" autocomplete="off" />
</div>
<div className="col-lg-12">
<span data-extcoin="KMD">
<b>{translate('INDEX.TOTAL')} (<span data-extcoinname="COIN"></span> - txfee):</b> <span data-extcoin="COIN" id="kmd_wallet_total_value">0.000</span> <span data-extcoin="COIN" id="kmd_wallet_total_coinname" data-extcoinname="COIN"></span>
</span>
</div>
<div className="col-lg-12">
<button type="submit" className="btn btn-primary waves-effect waves-light pull-right" data-toggle="modal" id="kmd_wallet_send_coins_btn">
{translate('INDEX.SEND')} <span data-extcoinname="COIN"></span>
</button>
</div>
</div>
</form>
</div>
</div>
</div>
<div className="col-xs-12">
<div className="row">
<div className="panel nav-tabs-horizontal">
<div data-extcoin="COIN" id="kmd_wallet_opids_status_section">
<div className="col-xlg-12 col-lg-12 col-sm-12 col-xs-12">
<div className="panel">
<header className="panel-heading">
<div className="panel-actions">
<button className="btn btn-info btn-block" id="kmd_opids_status_btn" type="button">
<i className="icon fa-repeat" aria-hidden="true"></i> {translate('INDEX.REFRESH')}
</button>
</div>
<h3 className="panel-title">{translate('INDEX.OPERATIONS_STATUSES')}</h3>
</header>
<div className="panel-body">
<table className="table table-hover dataTable table-striped" data-extcoin="COIN" id="kmd-opid-status-tbl" width="100%">
<thead>
<tr>
<th>{translate('INDEX.STATUS')}</th>
<th>ID</th>
<th>{translate('INDEX.TIME')}</th>
<th>{translate('INDEX.RESULT')}</th>
</tr>
</thead>
<tfoot>
<tr>
<th>{translate('INDEX.STATUS')}</th>
<th>ID</th>
<th>{translate('INDEX.TIME')}</th>
<th>{translate('INDEX.RESULT')}</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div data-extcoin="COIN" id="kmd_wallet_settings">
<div className="col-xlg-6 col-md-4">
<div className="panel" id="projects">
<div className="panel-heading">
<h3 className="panel-title">{translate('INDEX.WALLET_INFO')}</h3>
</div>
<div className="table-responsive">
<table className="table table-striped">
<tbody>
<tr>
<td>{translate('INDEX.WALLET_VERSION')}</td>
<td>
<span data-extcoin="COIN" id="kmd_walletversion"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.BALANCE')}</td>
<td>
<span data-extcoin="COIN" id="kmd_balance"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.UNCONFIRMED_BALANCE')}</td>
<td>
<span data-extcoin="COIN" id="kmd_unconfirmed_balance"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.IMMATURE_BALANCE')}</td>
<td>
<span data-extcoin="COIN" id="kmd_immature_balance"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.TOTAL_TX_COUNT')}</td>
<td>
<span data-extcoin="COIN" id="KMDTotalTransactionsCount"></span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div className="col-xlg-6 col-md-8">
<div className="panel" id="projects">
<div className="panel-heading">
<h3 className="panel-title">
<span data-extcointitle="COIN">Komodo</span> {translate('INDEX.INFO')}
</h3>
</div>
<div className="table-responsive">
<table className="table table-striped">
<tbody>
<tr>
<td>{translate('INDEX.VERSION')}</td>
<td>
<span data-extcoin="COIN" id="kmd_version"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.PROTOCOL_VERSION')}</td>
<td>
<span data-extcoin="COIN" id="kmd_protocolversion"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.NOTARIZED')}</td>
<td>
<span data-extcoin="COIN" id="kmd_notarized"></span>
</td>
</tr>
<tr>
<td>
{translate('INDEX.NOTARIZED')} Hash
</td>
<td>
<span data-extcoin="COIN" id="kmd_notarizedhash"></span>
</td>
</tr>
<tr>
<td>
{translate('INDEX.NOTARIZED')} BTC
</td>
<td>
<span data-extcoin="COIN" id="kmd_notarizedbtc"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.BLOCKS')}</td>
<td>
<span data-extcoin="COIN" id="kmd_blocks"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.CONNECTIONS')}</td>
<td>
<span data-extcoin="COIN" id="kmd_connections"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.DIFFICULTY')}</td>
<td>
<span data-extcoin="COIN" id="kmd_difficulty"></span>
</td>
</tr>
<tr>
<td>Testnet</td>
<td>
<span data-extcoin="COIN" id="kmd_testnet"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.PAY_TX_FEE')}</td>
<td>
<span data-extcoin="COIN" id="kmd_paytxfee"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.RELAY_FEE')}</td>
<td>
<span data-extcoin="COIN" id="kmd_relayfee"></span>
</td>
</tr>
<tr>
<td>{translate('INDEX.ERRORS')}</td>
<td>
<span data-extcoin="COIN" id="kmd_errors"></span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div className="modal fade modal-3d-sign" data-extcoin="COIN" id="kmd_txid_info_mdl" aria-hidden="false" role="dialog">
<div className="modal-dialog modal-center modal-lg">
<div className="modal-content">
<div className="modal-body">
<div className="panel nav-tabs-horizontal">
<ul className="nav nav-tabs nav-tabs-line" data-plugin="nav-tabs" role="tablist">
<li className="active" role="presentation">
<a data-toggle="tab" href="#KmdTxIDInfotab1" data-extcoin="COIN" aria-controls="KmdTxIDInfotab1" role="tab">
<i className="icon md-balance-wallet" aria-hidden="true"></i>TxID Info
</a>
</li>
<li role="presentation">
<a data-toggle="tab" href="#KmdTxIDInfotab2" data-extcoin="COIN" aria-controls="KmdTxIDInfotab2" role="tab">
<i className="icon md-plus-square" aria-hidden="true"></i>vjointsplits, details
</a>
</li>
<li role="presentation">
<a data-toggle="tab" href="#KmdTxIDInfotab3" data-extcoin="COIN" aria-controls="KmdTxIDInfotab3" role="tab">
<i className="icon wb-briefcase" aria-hidden="true"></i>hex
</a>
</li>
</ul>
<div className="panel-body">
<div className="tab-content">
<div className="tab-pane active" id="KmdTxIDInfotab1" data-extcoin="COIN" role="tabpanel">
<table className="table table-striped">
<tbody>
<tr>
<td>amount</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_amount"></span>
</td>
</tr>
<tr>
<td>fee</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_fee"></span>
</td>
</tr>
<tr>
<td>confirmations</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_confirmations"></span>
</td>
</tr>
<tr>
<td>blockhash</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_blockhash"></span>
</td>
</tr>
<tr>
<td>blockindex</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_blockindex"></span>
</td>
</tr>
<tr>
<td>blocktime</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_blocktime"></span>
</td>
</tr>
<tr>
<td>txid</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_txid"></span>
</td>
</tr>
<tr>
<td>walletconflicts</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_walletconflicts"></span>
</td>
</tr>
<tr>
<td>time</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_time"></span>
</td>
</tr>
<tr>
<td>timereceived</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_timereceived"></span>
</td>
</tr>
</tbody>
</table>
</div>
<div className="tab-pane" id="KmdTxIDInfotab2" data-extcoin="COIN" role="tabpanel">
<table className="table table-striped">
<tbody>
<tr>
<td>vjoinsplit</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_vjoinsplit"></span>
</td>
</tr>
<tr>
<td>details</td>
<td>
<span data-extcoin="COIN" id="kmd_txid_info_details"></span>
</td>
</tr>
</tbody>
</table>
</div>
<div className="tab-pane" id="KmdTxIDInfotab3" data-extcoin="COIN" role="tabpanel">
<textarea id="kmd_txid_info_hex" data-extcoin="COIN" style={{width: '100%', height: '170px'}} rows="10" cols="80" disabled></textarea>
</div>
</div>
</div>
</div>
</div>
<div className="modal-footer">
<button type="button" className="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
);
} else {
return null;
}
}
}
export default WalletsNative;

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

@ -3,37 +3,41 @@ import { translate } from '../../translate/translate';
class WalletsProgress extends React.Component {
render() {
if (this.props && this.props.ActiveCoin && this.props.ActiveCoin.mode === 'full') {
return (
<div id="edex-footer" data-edexcoin="COIN">
<div className="row no-space" data-edexcoin="COIN">
<div data-edexcoin="COIN" id="currency-progressbars">
<div className="progress progress-sm">
<div className="progress-bar progress-bar-info progress-bar-striped active" style={{width: '10%', fontSize: '80%'}} role="progressbar" data-edexcoin="COIN" id="currency-bundles">
<span data-lang="INDEX.BUNDLES"></span> <span data-edexcoin="COIN" id="currency-bundles-percent">0%</span>
if (this.props && this.props.ActiveCoin && this.props.ActiveCoin.mode === 'full' && this.props.Dashboard.progress) {
if (this.props.Dashboard.progress && this.props.Dashboard.progress.error) {
return (<div style={{textAlign: 'center', padding: '10px'}}>Coin is busy processing</div>);
} else {
return (
<div id="edex-footer" data-edexcoin="COIN">
<div className="row no-space" data-edexcoin="COIN">
<div data-edexcoin="COIN" id="currency-progressbars">
<div className="progress progress-sm">
<div className="progress-bar progress-bar-info progress-bar-striped active" style={{width: this.props.Dashboard.progress.bundles + '%', fontSize: '80%'}} role="progressbar" data-edexcoin="COIN" id="currency-bundles">
{translate('INDEX.BUNDLES')} <span data-edexcoin="COIN" id="currency-bundles-percent">{this.props.Dashboard.progress.bundles}%</span>
</div>
</div>
</div>
</div>
<div data-edexcoin="COIN" id="additional-progress-bars">
<div className="progress progress-sm">
<div className="progress-bar progress-bar-warning progress-bar-striped active" style={{width: '20%', fontSize: '80%'}} role="progressbar" data-edexcoin="COIN" id="currency-utxo">
utxo <span data-edexcoin="COIN" id="currency-utxo-percent">0%</span>
<div data-edexcoin="COIN" id="additional-progress-bars">
<div className="progress progress-sm">
<div className="progress-bar progress-bar-warning progress-bar-striped active" style={{width: this.props.Dashboard.progress.utxo + '%', fontSize: '80%'}} role="progressbar" data-edexcoin="COIN" id="currency-utxo">
utxo <span data-edexcoin="COIN" id="currency-utxo-percent">{this.props.Dashboard.progress.utxo}%</span>
</div>
</div>
</div>
<div className="progress progress-sm">
<div className="progress-bar progress-bar-danger progress-bar-striped active" style={{width: '20%', fontSize: '80%'}} role="progressbar" data-edexcoin="COIN" id="currency-balances">
<span data-lang="INDEX.BALANCES"></span> <span data-edexcoin="COIN" id="currency-balances-percent">0%</span>
<div className="progress progress-sm">
<div className="progress-bar progress-bar-danger progress-bar-striped active" style={{width: this.props.Dashboard.progress.balances + '%', fontSize: '80%'}} role="progressbar" data-edexcoin="COIN" id="currency-balances">
{translate('INDEX.BALANCES')} <span data-edexcoin="COIN" id="currency-balances-percent">{this.props.Dashboard.progress.balances}%</span>
</div>
</div>
</div>
<div className="progress progress-sm">
<div className="progress-bar progress-bar-success progress-bar-striped active" style={{width: '20%', fontSize: '80%'}} role="progressbar" data-edexcoin="COIN" id="currency-validated">
<span data-lang="INDEX.VALIDATED"></span> <span data-edexcoin="COIN" id="currency-validated-percent">0%</span>
<div className="progress progress-sm">
<div className="progress-bar progress-bar-success progress-bar-striped active" style={{width: this.props.Dashboard.progress.validated + '%', fontSize: '80%'}} role="progressbar" data-edexcoin="COIN" id="currency-validated">
{translate('INDEX.VALIDATED')} <span data-edexcoin="COIN" id="currency-validated-percent">{this.props.Dashboard.progress.validated}%</span>
</div>
</div>
</div>
</div>
</div>
</div>
);
);
}
} else {
return null;
}

2
react/src/config.js

@ -1,2 +1,4 @@
module.exports = {
iguanaCorePort: 7778,
agamaPort: 17777
};

7
react/src/reducers/activeCoin.js

@ -3,7 +3,8 @@ import {
DASHBOARD_ACTIVE_COIN_BALANCE,
DASHBOARD_ACTIVE_COIN_SEND_FORM,
DASHBOARD_ACTIVE_COIN_RECEIVE_FORM,
DASHBOARD_ACTIVE_COIN_RESET_FORMS
DASHBOARD_ACTIVE_COIN_RESET_FORMS,
ACTIVE_COIN_GET_ADDRESSES
} from '../actions/actionCreators';
export function ActiveCoin(state = {
@ -38,6 +39,10 @@ export function ActiveCoin(state = {
send: false,
receive: false,
});
case ACTIVE_COIN_GET_ADDRESSES:
return Object.assign({}, state, {
addresses: action.addresses,
});
default:
return state;
}

31
react/src/reducers/dashboard.js

@ -1,8 +1,17 @@
import { DASHBOARD_SECTION_CHANGE, GET_MAIN_ADDRESS } from '../actions/actionCreators';
import {
DASHBOARD_SECTION_CHANGE,
GET_MAIN_ADDRESS,
BASILISK_REFRESH,
SYNCING_FULL_MODE,
SYNCING_NATIVE_MODE,
BASILISK_CONNECTION
} from '../actions/actionCreators';
export function Dashboard(state = {
activeSection: 'wallets',
activeHandle: null,
basiliskRefresh: false,
basiliskConnection: false,
}, action) {
switch (action.type) {
case DASHBOARD_SECTION_CHANGE:
@ -13,6 +22,26 @@ export function Dashboard(state = {
return Object.assign({}, state, {
activeHandle: action.activeHandle,
});
case BASILISK_REFRESH:
return Object.assign({}, state, {
basiliskRefresh: action.basiliskRefresh,
progress: action.progress,
});
case BASILISK_CONNECTION:
return Object.assign({}, state, {
basiliskConnection: action.basiliskConnection,
progress: action.progress,
});
case SYNCING_FULL_MODE:
return Object.assign({}, state, {
syncingFullMode: action.syncingFullMode,
progress: action.progress,
});
case SYNCING_NATIVE_MODE:
return Object.assign({}, state, {
syncingNativeMode: action.syncingNativeMode,
progress: action.progress,
});
default:
return state;
}

2
react/src/reducers/index.js

@ -8,6 +8,7 @@ import { Dashboard } from './dashboard';
import { ActiveCoin } from './activeCoin';
import { Atomic } from './atomic';
import { Settings } from './settings';
import { Interval } from './interval';
const rootReducer = combineReducers({
AddCoin,
@ -17,6 +18,7 @@ const rootReducer = combineReducers({
ActiveCoin,
Atomic,
Settings,
Interval,
routing: routerReducer,
});

26
react/src/reducers/interval.js

@ -0,0 +1,26 @@
import { START_INTERVAL, STOP_INTERVAL } from '../actions/actionCreators'
export function Interval(state = {
interval: {},
}, action) {
switch (action.type) {
case START_INTERVAL:
var newIntervalState = Object.assign({}, state.interval);
newIntervalState[action.name] = action.handle;
return Object.assign({}, state, {
interval: newIntervalState,
});
case STOP_INTERVAL:
var newIntervalState = Object.assign({}, state.interval);
newIntervalState[action.name] = null;
return Object.assign({}, state, {
interval: newIntervalState,
});
default:
return state;
}
}
export default Interval;

12
react/src/reducers/settings.js

@ -1,8 +1,9 @@
import { GET_WIF_KEY } from '../actions/actionCreators';
import { GET_WIF_KEY, GET_PEERS_LIST, GET_DEBUG_LOG } from '../actions/actionCreators';
export function Settings(state = {
wifkey: null,
address: null,
debugLog: null,
}, action) {
switch (action.type) {
case GET_WIF_KEY:
@ -10,6 +11,15 @@ export function Settings(state = {
wifkey: action.wifkey,
address: action.address,
});
case GET_PEERS_LIST:
return Object.assign({}, state, {
supernetPeers: action.supernetPeers,
rawPeers: action.rawPeers,
});
case GET_DEBUG_LOG:
return Object.assign({}, state, {
debugLog: action.data,
});
default:
return state;
}

13
react/src/styles/index.scss

@ -68,6 +68,19 @@ body {
content: '\F278';
}
#section-dashboard {
height: 100%;
}
#section-iguana-wallet-settings {
background: #f3f4f5;
}
#edexcoin_dashboardinfo a {
cursor: pointer;
cursor: hand;
}
/*.toaster .single-toast:nth-child(0) {
bottom: 12px;
}

Loading…
Cancel
Save