Browse Source

sort http stack desc

all-modes
pbca26 8 years ago
parent
commit
498c4aedc6
  1. 7
      react/src/actions/actionCreators.js
  2. 27
      react/src/components/dashboard/notifications.js
  3. 10
      react/src/styles/index.scss
  4. 5
      react/www/index.html

7
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 = { const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), 'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'agent': 'hash', 'agent': 'hash',
@ -2324,7 +2324,7 @@ export function sendNativeTx(coin, _payload) {
} }
return dispatch => { return dispatch => {
return iguanaHashHex(ajax_data_to_hex).then((hashHexJson) => { return iguanaHashHex(ajax_data_to_hex, dispatch).then((hashHexJson) => {
if (getPassthruAgent(coin) === 'iguana') { if (getPassthruAgent(coin) === 'iguana') {
payload = { payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), 'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
@ -2408,7 +2408,7 @@ export function getKMDOPID(opid, coin) {
} }
return dispatch => { return dispatch => {
return iguanaHashHex(ajax_data_to_hex).then((hashHexJson) => { return iguanaHashHex(ajax_data_to_hex, dispatch).then((hashHexJson) => {
if (hashHexJson === '5b226e756c6c225d00') { if (hashHexJson === '5b226e756c6c225d00') {
hashHexJson = ''; hashHexJson = '';
} }
@ -3434,6 +3434,7 @@ export function guiLogState(logData) {
type: LOG_GUI_HTTP, type: LOG_GUI_HTTP,
timestamp: logData.timestamp, timestamp: logData.timestamp,
log: { log: {
timestamp: logData.timestamp,
function: logData.function, function: logData.function,
httpMethod: logData.type, httpMethod: logData.type,
url: logData.url, url: logData.url,

27
react/src/components/dashboard/notifications.js

@ -4,6 +4,7 @@ import {
secondsElapsedToString, secondsElapsedToString,
secondsToString secondsToString
} from '../../util/time'; } from '../../util/time';
import { sortByDate } from '../../util/sort';
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
class Notifications extends React.Component { class Notifications extends React.Component {
@ -16,6 +17,7 @@ class Notifications extends React.Component {
totalSuccessCalls: 0, totalSuccessCalls: 0,
totalPendingCalls: 0, totalPendingCalls: 0,
activeTab: 2, activeTab: 2,
guiLog: null,
}; };
this.toggleNotificationsModal = this.toggleNotificationsModal.bind(this); this.toggleNotificationsModal = this.toggleNotificationsModal.bind(this);
} }
@ -35,8 +37,11 @@ class Notifications extends React.Component {
let totalErrorCalls = 0; let totalErrorCalls = 0;
let totalSuccessCalls = 0; let totalSuccessCalls = 0;
let totalPendingCalls = 0; let totalPendingCalls = 0;
let guiLogToArray = [];
for (let timestamp in _guiLog) { for (let timestamp in _guiLog) {
guiLogToArray.push(_guiLog[timestamp]);
if (_guiLog[timestamp].status === 'error') { if (_guiLog[timestamp].status === 'error') {
totalErrorCalls++; totalErrorCalls++;
} }
@ -53,27 +58,29 @@ class Notifications extends React.Component {
totalErrorCalls, totalErrorCalls,
totalSuccessCalls, totalSuccessCalls,
totalPendingCalls, totalPendingCalls,
guiLog: guiLogToArray,
})); }));
} }
} }
renderNotificationsByType(type) { renderNotificationsByType(type) {
// get total number of calls per type // get total number of calls per type
if (this.props.Dashboard && if (this.state.guiLog &&
this.props.Dashboard.guiLog) { this.state.guiLog.length) {
const _guiLog = this.props.Dashboard.guiLog; let _guiLog = this.state.guiLog;
_guiLog = sortByDate(_guiLog);
let items = []; let items = [];
let index = 0; let index = 0;
for (let timestamp in _guiLog) { for (let i = 0; i < _guiLog.length; i++) {
if (_guiLog[timestamp].status === type) { if (_guiLog[i].status === type) {
const _logItem = _guiLog[timestamp]; const _logItem = _guiLog[i];
items.push( items.push(
<div key={ timestamp }> <div key={ _logItem.timestamp }>
<div>{ (index + 1) }.</div> <div>{ index + 1 }.</div>
<div> <div>
<strong>Time:</strong> { secondsToString(timestamp, true, true) } <strong>Time:</strong> { secondsToString(_logItem.timestamp, true, true) }
</div> </div>
<div> <div>
<strong>GUI Function:</strong> { _logItem.function } <strong>GUI Function:</strong> { _logItem.function }
@ -106,7 +113,7 @@ class Notifications extends React.Component {
if (this.state.displayModal) { if (this.state.displayModal) {
return ( return (
<div onKeyDown={ (event) => this.handleKeydown(event) }> <div onKeyDown={ (event) => this.handleKeydown(event) }>
<div className="modal show" aria-hidden="false" role="dialog"> <div className="modal show notifications-modal" aria-hidden="false" role="dialog">
<div className="modal-dialog modal-center modal-lg"> <div className="modal-dialog modal-center modal-lg">
<div className="modal-content"> <div className="modal-content">
<div className="modal-body" style={{ height: '590px' }}> <div className="modal-body" style={{ height: '590px' }}>

10
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) { /*.toaster .single-toast:nth-child(0) {
bottom: 12px; bottom: 12px;
} }

5
react/www/index.html

@ -15,8 +15,7 @@
<link rel="icon" type="image/png" href="assets/images/favicon-16x16.png" sizes="16x16"> <link rel="icon" type="image/png" href="assets/images/favicon-16x16.png" sizes="16x16">
</head> </head>
<body id="body" class="page-login layout-full page-dark"> <body id="body" class="page-login layout-full page-dark">
<!-- style="opacity: 0; height: 1px; width: 1px" --> <input type="text" id="js-copytextarea" />
<input type="text" id="js-copytextarea" style="opacity: 0; height: 10px; width: 200px" /> <div id="app"></div>
<div id="app" style="height: 100%"></div>
</body> </body>
</html> </html>

Loading…
Cancel
Save