Forwarding history with Fee and icon-buttons width

Forwarding history with Fee and icon-buttons width
pull/266/head
Shahana Farooqui 4 years ago
parent fa243ad257
commit 2260311408

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -9,8 +9,8 @@
<link rel="icon" type="image/png" sizes="32x32" href="assets/images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/images/favicon/favicon-16x16.png">
<link rel="manifest" href="assets/images/favicon/site.webmanifest">
<link rel="stylesheet" href="styles.08e149af9f1299f2561a.css"></head>
<link rel="stylesheet" href="styles.c452c40f97742816928a.css"></head>
<body>
<rtl-app></rtl-app>
<script src="runtime.656a05f7ed4e80fb0e9e.js" defer></script><script src="polyfills-es5.2ae7ace69949ec0a3f00.js" nomodule defer></script><script src="polyfills.3302e98effc5e50a54c2.js" defer></script><script src="main.68421d3df3504f21cdd9.js" defer></script></body>
<script src="runtime.f242db472c61d1f9d9fe.js" defer></script><script src="polyfills-es5.2ae7ace69949ec0a3f00.js" nomodule defer></script><script src="polyfills.3302e98effc5e50a54c2.js" defer></script><script src="main.0d8230caec3b794058d2.js" defer></script></body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +1 @@
!function(e){function r(r){for(var n,a,i=r[0],c=r[1],f=r[2],p=0,s=[];p<i.length;p++)a=i[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&s.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++)0!==o[t[i]]&&(n=!1);n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={0:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({}[e]||e)+"."+{1:"a69b5e7729a9d343f7d1",6:"0fc217575a57adec8f25",7:"1afa7584c941b6a5dcd1"}[e]+".js"}(e);var c=new Error;u=function(r){i.onerror=i.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout((function(){u({type:"timeout",target:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,(function(r){return e[r]}).bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var f=0;f<i.length;f++)r(i[f]);var l=c;t()}([]);
!function(e){function r(r){for(var n,a,i=r[0],c=r[1],f=r[2],p=0,s=[];p<i.length;p++)a=i[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&s.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++)0!==o[t[i]]&&(n=!1);n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={0:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({}[e]||e)+"."+{1:"a69b5e7729a9d343f7d1",6:"6a316c85440aa1f75686",7:"e2f968b9a2bdba71e623"}[e]+".js"}(e);var c=new Error;u=function(r){i.onerror=i.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout((function(){u({type:"timeout",target:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,(function(r){return e[r]}).bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var f=0;f<i.length;f++)r(i[f]);var l=c;t()}([]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -37,23 +37,17 @@ exports.getFees = (req, res, next) => {
let month_start_time = current_time - 2629743;
let week_start_time = current_time - 604800;
let day_start_time = current_time - 86400;
return swtch.getAllForwardingEvents(month_start_time, current_time, 0, 1000)
.then((history) => {
swtch.getAllForwardingEvents(month_start_time, current_time, 0, (history) => {
logger.info({fileName: 'Fees', msg: 'Forwarding History Received: ' + JSON.stringify(history)});
let daily_tx_count = history.forwarding_events.filter(event => event.timestamp >= day_start_time);
body.daily_tx_count = daily_tx_count && daily_tx_count.length ? daily_tx_count.length : 0;
let weekly_tx_count = history.forwarding_events.filter(event => event.timestamp >= week_start_time);
body.weekly_tx_count = weekly_tx_count && weekly_tx_count.length ? weekly_tx_count.length : 0;
body.monthly_tx_count = history.forwarding_events && history.forwarding_events.length ? history.forwarding_events.length : 0;
return res.status(200).json(body);
body.forwarding_events_history = history;
if (history.error) { logger.error({fileName: 'Fees', lineNum: 48, msg: 'Fetch Forwarding Events Error: ' + JSON.stringify(err)}); }
res.status(200).json(body);
})
.catch(err => {
logger.error({fileName: 'Fees', lineNum: 54, msg: 'Fetch Forwarding Events Error: ' + JSON.stringify(err)});
body.daily_tx_count = 0;
body.weekly_tx_count = 0;
body.monthly_tx_count = 0;
return res.status(200).json(body);
});
}
})
.catch(function (err) {

@ -12,12 +12,6 @@ exports.forwardingHistory = (req, res, next) => {
if (eventsResponse.error) {
res.status(500).json(eventsResponse);
} else {
if (eventsResponse.forwarding_events && eventsResponse.forwarding_events.length > 0) {
eventsResponse.forwarding_events.forEach(event => {
event.timestamp_str = !event.timestamp ? '' : common.convertTimestampToDate(event.timestamp);
});
eventsResponse.forwarding_events = common.sortDescByKey(eventsResponse.forwarding_events, 'timestamp');
}
res.status(201).json(eventsResponse);
}
});
@ -35,20 +29,21 @@ exports.getAllForwardingEvents = (start, end, offset, callback) => {
logger.info({fileName: 'Switch', msg: 'Forwarding History Params: ' + options.form});
request.post(options).then((body) => {
logger.info({fileName: 'Switch', msg: 'Forwarding History: ' + JSON.stringify(body)});
try {
if (body.forwarding_events) {
console.warn('LENGTH: ' + body.forwarding_events.length);
responseData.forwarding_events.push(...body.forwarding_events);
}
if (!body.last_offset_index || body.last_offset_index < offset + num_max_events) {
responseData.last_offset_index = body.last_offset_index ? body.last_offset_index : 0
callback(responseData);
} else {
this.getAllForwardingEvents(start, end, offset + num_max_events, callback);
}
} catch(err) {
console.warn(err);
if (body.forwarding_events) {
responseData.forwarding_events.push(...body.forwarding_events);
}
if (!body.last_offset_index || body.last_offset_index < offset + num_max_events) {
responseData.last_offset_index = body.last_offset_index ? body.last_offset_index : 0
if (responseData.forwarding_events) {
responseData.forwarding_events.forEach(event => {
event.timestamp_str = !event.timestamp ? '' : common.convertTimestampToDate(event.timestamp);
});
responseData.forwarding_events = common.sortDescByKey(responseData.forwarding_events, 'timestamp');
}
callback(responseData);
} else {
this.getAllForwardingEvents(start, end, offset + num_max_events, callback);
}
}).catch(err => {
logger.error({fileName: 'Switch', lineNum: 32, msg: 'Get All Forwarding Events Failed: ' + JSON.stringify(err)});
callback({

@ -16,7 +16,7 @@
<span *ngIf="!xSmallScreen">Ride The Lightning</span>
</div>
<div>
<rtl-top-menu class="mr-1"></rtl-top-menu>
<rtl-top-menu></rtl-top-menu>
</div>
</mat-toolbar>
<mat-sidenav-container>

@ -9,7 +9,7 @@
.more-button {
position: absolute;
top: 7px;
right: 20px;
right: 7px;
}
.dashboard-card-content {

@ -9,7 +9,7 @@
.more-button {
position: absolute;
top: 7px;
right: 20px;
right: 7px;
}
.dashboard-card-content {

@ -35,7 +35,6 @@ export class RoutingComponent implements OnInit, OnDestroy {
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.RTLState>, private actions$: Actions) {}
ngOnInit() {
this.onEventsFetch();
this.actions$.pipe(takeUntil(this.unSubs[1]), filter((action) => action.type === RTLActions.RESET_LND_STORE || action.type === RTLActions.SET_ALL_CHANNELS))
.subscribe((action: RTLActions.ResetLNDStore | RTLActions.SetAllChannels) => {
this.onEventsFetch();

@ -401,6 +401,10 @@ export class LNDEffects implements OnDestroy {
}),
map((fees) => {
this.logger.info(fees);
if(fees.forwarding_events_history) {
this.store.dispatch(new RTLActions.SetForwardingHistory(fees.forwarding_events_history));
delete fees.forwarding_events_history;
}
return {
type: RTLActions.SET_FEES,
payload: fees ? fees : {}
@ -1127,7 +1131,7 @@ export class LNDEffects implements OnDestroy {
smaller_currency_unit: info.smaller_currency_unit
};
this.store.dispatch(new RTLActions.SetNodeData(node_data));
this.store.dispatch(new RTLActions.FetchFees());
this.store.dispatch(new RTLActions.FetchFees()); //Fetches monthly forwarding history as well, to count total number of events
this.store.dispatch(new RTLActions.FetchPeers());
this.store.dispatch(new RTLActions.FetchBalance('channels'));
this.store.dispatch(new RTLActions.FetchNetwork());

@ -156,6 +156,7 @@ export interface Fees {
daily_tx_count?: number;
weekly_tx_count?: number;
monthly_tx_count?: number;
forwarding_events_history?: SwitchRes;
}
export interface GetInfoChain {

@ -466,12 +466,6 @@
overflow: hidden;
}
.mat-icon-button {
width: 18px;
height: 18px;
line-height: 18px;
}
.balances-info-pie-chart {
& .legend-label:nth-child(1) .legend-label-color {
background-color: mat-color($primary, 200) !important;
@ -579,4 +573,9 @@
}
}
.mat-form-field-appearance-legacy .mat-form-field-prefix .mat-datepicker-toggle-default-icon,
.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-datepicker-toggle-default-icon {
width: 1.8rem;
}
}

@ -984,4 +984,4 @@ table {
.icon-green {
fill: $green-color;
}
}

Loading…
Cancel
Save