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 = {
'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,

27
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(
<div key={ timestamp }>
<div>{ (index + 1) }.</div>
<div key={ _logItem.timestamp }>
<div>{ index + 1 }.</div>
<div>
<strong>Time:</strong> { secondsToString(timestamp, true, true) }
<strong>Time:</strong> { secondsToString(_logItem.timestamp, true, true) }
</div>
<div>
<strong>GUI Function:</strong> { _logItem.function }
@ -106,7 +113,7 @@ class Notifications extends React.Component {
if (this.state.displayModal) {
return (
<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-content">
<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) {
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">
</head>
<body id="body" class="page-login layout-full page-dark">
<!-- style="opacity: 0; height: 1px; width: 1px" -->
<input type="text" id="js-copytextarea" style="opacity: 0; height: 10px; width: 200px" />
<div id="app" style="height: 100%"></div>
<input type="text" id="js-copytextarea" />
<div id="app"></div>
</body>
</html>

Loading…
Cancel
Save