From 498c4aedc622d3402bd3c5c0b1bb28f45a6634c7 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sat, 27 May 2017 14:00:51 +0300 Subject: [PATCH] sort http stack desc --- react/src/actions/actionCreators.js | 7 ++--- .../src/components/dashboard/notifications.js | 27 ++++++++++++------- react/src/styles/index.scss | 10 +++++++ react/www/index.html | 5 ++-- 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js index fe8d8b6..4cd9df5 100644 --- a/react/src/actions/actionCreators.js +++ b/react/src/actions/actionCreators.js @@ -2266,7 +2266,7 @@ export function getNewKMDAddresses(coin, pubpriv) { } } -export function iguanaHashHex(data) { +export function iguanaHashHex(data, dispatch) { const payload = { 'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), 'agent': 'hash', @@ -2324,7 +2324,7 @@ export function sendNativeTx(coin, _payload) { } return dispatch => { - return iguanaHashHex(ajax_data_to_hex).then((hashHexJson) => { + return iguanaHashHex(ajax_data_to_hex, dispatch).then((hashHexJson) => { if (getPassthruAgent(coin) === 'iguana') { payload = { 'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), @@ -2408,7 +2408,7 @@ export function getKMDOPID(opid, coin) { } return dispatch => { - return iguanaHashHex(ajax_data_to_hex).then((hashHexJson) => { + return iguanaHashHex(ajax_data_to_hex, dispatch).then((hashHexJson) => { if (hashHexJson === '5b226e756c6c225d00') { hashHexJson = ''; } @@ -3434,6 +3434,7 @@ export function guiLogState(logData) { type: LOG_GUI_HTTP, timestamp: logData.timestamp, log: { + timestamp: logData.timestamp, function: logData.function, httpMethod: logData.type, url: logData.url, diff --git a/react/src/components/dashboard/notifications.js b/react/src/components/dashboard/notifications.js index eb99751..1c77307 100644 --- a/react/src/components/dashboard/notifications.js +++ b/react/src/components/dashboard/notifications.js @@ -4,6 +4,7 @@ import { secondsElapsedToString, secondsToString } from '../../util/time'; +import { sortByDate } from '../../util/sort'; import { translate } from '../../translate/translate'; class Notifications extends React.Component { @@ -16,6 +17,7 @@ class Notifications extends React.Component { totalSuccessCalls: 0, totalPendingCalls: 0, activeTab: 2, + guiLog: null, }; this.toggleNotificationsModal = this.toggleNotificationsModal.bind(this); } @@ -35,8 +37,11 @@ class Notifications extends React.Component { let totalErrorCalls = 0; let totalSuccessCalls = 0; let totalPendingCalls = 0; + let guiLogToArray = []; for (let timestamp in _guiLog) { + guiLogToArray.push(_guiLog[timestamp]); + if (_guiLog[timestamp].status === 'error') { totalErrorCalls++; } @@ -53,27 +58,29 @@ class Notifications extends React.Component { totalErrorCalls, totalSuccessCalls, totalPendingCalls, + guiLog: guiLogToArray, })); } } renderNotificationsByType(type) { // get total number of calls per type - if (this.props.Dashboard && - this.props.Dashboard.guiLog) { - const _guiLog = this.props.Dashboard.guiLog; + if (this.state.guiLog && + this.state.guiLog.length) { + let _guiLog = this.state.guiLog; + _guiLog = sortByDate(_guiLog); let items = []; let index = 0; - for (let timestamp in _guiLog) { - if (_guiLog[timestamp].status === type) { - const _logItem = _guiLog[timestamp]; + for (let i = 0; i < _guiLog.length; i++) { + if (_guiLog[i].status === type) { + const _logItem = _guiLog[i]; items.push( -
-
{ (index + 1) }.
+
+
{ index + 1 }.
- Time: { secondsToString(timestamp, true, true) } + Time: { secondsToString(_logItem.timestamp, true, true) }
GUI Function: { _logItem.function } @@ -106,7 +113,7 @@ class Notifications extends React.Component { if (this.state.displayModal) { return (
this.handleKeydown(event) }> -
+
diff --git a/react/src/styles/index.scss b/react/src/styles/index.scss index ee14f07..32f1a9c 100644 --- a/react/src/styles/index.scss +++ b/react/src/styles/index.scss @@ -491,6 +491,16 @@ input:checked + .slider:before { } } +#js-copytextarea { + opacity: 0; + height: 10px; + width: 200px; +} + +#app { + height: 100%; +} + /*.toaster .single-toast:nth-child(0) { bottom: 12px; } diff --git a/react/www/index.html b/react/www/index.html index 519ba0c..8fa9278 100644 --- a/react/www/index.html +++ b/react/www/index.html @@ -15,8 +15,7 @@ - - -
+ +