diff --git a/backend/controllers/cln/invoices.js b/backend/controllers/cln/invoices.js index 0864a290..770cec12 100644 --- a/backend/controllers/cln/invoices.js +++ b/backend/controllers/cln/invoices.js @@ -31,10 +31,6 @@ export const listInvoices = (req, res, next) => { logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Invoice', msg: 'Invoices List URL', data: options.url }); request(options).then((body) => { logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Invoice', msg: 'Invoices List Received', data: body }); - if (body.invoices && body.invoices.length > 0) { - body.invoices = common.sortDescByKey(body.invoices, 'expires_at'); - } - logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Invoice', msg: 'Sorted Invoices List Received', data: body }); res.status(200).json(body); }).catch((errRes) => { const err = common.handleError(errRes, 'Invoice', 'List Invoices Error', req.session.selectedNode); diff --git a/server/controllers/cln/invoices.ts b/server/controllers/cln/invoices.ts index f5a0aaf3..32d3ce60 100644 --- a/server/controllers/cln/invoices.ts +++ b/server/controllers/cln/invoices.ts @@ -29,10 +29,6 @@ export const listInvoices = (req, res, next) => { logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Invoice', msg: 'Invoices List URL', data: options.url }); request(options).then((body) => { logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Invoice', msg: 'Invoices List Received', data: body }); - if (body.invoices && body.invoices.length > 0) { - body.invoices = common.sortDescByKey(body.invoices, 'expires_at'); - } - logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Invoice', msg: 'Sorted Invoices List Received', data: body }); res.status(200).json(body); }).catch((errRes) => { const err = common.handleError(errRes, 'Invoice', 'List Invoices Error', req.session.selectedNode); diff --git a/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.html b/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.html index f7a9deb8..6fd9ba4e 100644 --- a/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.html +++ b/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.html @@ -30,12 +30,17 @@
Expiry Date | ++ | +Expiry Date | +{{(invoice?.expires_at * 1000) | date:'dd/MMM/y HH:mm'}} | Description |
-
+
{{invoice?.description}}
|
Label | +
+
+ {{invoice?.label}}
+
+ |
+ Payment Hash | +
+
+ {{invoice?.payment_hash}}
+
+ |
+ Invoice | +
+
+ {{invoice?.bolt11}}
+
+ |
+ Amount (Sats) | {{invoice?.msatoshi/1000 | number:invoice?.msatoshi < 1000 ? '1.0-4' : '1.0-0'}} | diff --git a/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.scss b/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.scss index 2ce046dc..3c18e915 100644 --- a/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.scss +++ b/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.scss @@ -1,4 +1,26 @@ -.mat-column-description { +@import '../../../../shared/theme/styles/mixins.scss'; + +.mat-column-status { + max-width: 1rem; + & .dot { + @include for_screensize(tab-port) { + width:0.6rem; + height: 0.6rem; + left: 2.8rem; + margin-top: -0.3rem; + position: absolute; + } + @include for_screensize(phone) { + width:0.6rem; + height: 0.6rem; + left: 0.8rem; + margin-top: -0.3rem; + position: absolute; + } + } +} + +.mat-column-description, .mat-column-label, .mat-column-payment_hash, .mat-column-bolt11 { flex: 0 0 15%; width: 15%; & .ellipsis-parent { diff --git a/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.ts b/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.ts index cff28c0d..0bf71aa5 100644 --- a/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.ts +++ b/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.ts @@ -9,7 +9,7 @@ import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; import { MatTableDataSource } from '@angular/material/table'; -import { CurrencyUnitEnum, CURRENCY_UNIT_FORMATS, PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, ScreenSizeEnum, APICallStatusEnum, UI_MESSAGES, CLNActions } from '../../../../shared/services/consts-enums-functions'; +import { CurrencyUnitEnum, CURRENCY_UNIT_FORMATS, PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, ScreenSizeEnum, APICallStatusEnum, UI_MESSAGES, CLNActions, CLN_DEFAULT_PAGE_SETTINGS, SortOrderEnum } from '../../../../shared/services/consts-enums-functions'; import { ApiCallStatusPayload } from '../../../../shared/models/apiCallsPayload'; import { SelNodeChild } from '../../../../shared/models/RTLconfig'; import { GetInfo, Invoice, ListInvoices } from '../../../../shared/models/clnModels'; @@ -23,7 +23,8 @@ import { RTLEffects } from '../../../../store/rtl.effects'; import { RTLState } from '../../../../store/rtl.state'; import { openAlert, openConfirmation } from '../../../../store/rtl.actions'; import { deleteExpiredInvoice, invoiceLookup, saveNewInvoice } from '../../../store/cln.actions'; -import { clnNodeInformation, clnNodeSettings, listInvoices } from '../../../store/cln.selector'; +import { clnNodeInformation, clnNodeSettings, clnPageSettings, listInvoices } from '../../../store/cln.selector'; +import { PageSettingsCLN, TableSetting } from '../../../../shared/models/pageSettings'; @Component({ selector: 'rtl-cln-lightning-invoices-table', @@ -39,6 +40,8 @@ export class CLNLightningInvoicesTableComponent implements OnInit, AfterViewInit @ViewChild(MatSort, { static: false }) sort: MatSort | undefined; @ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined; faHistory = faHistory; + public PAGE_ID = 'invoices'; + public tableSetting: TableSetting = { tableId: 'invoices', recordsPerPage: 10, sortBy: 'expires_at', sortOrder: SortOrderEnum.DESCENDING }; public selNode: SelNodeChild | null = {}; public newlyAddedInvoiceMemo = ''; public newlyAddedInvoiceValue = 0; @@ -65,15 +68,6 @@ export class CLNLightningInvoicesTableComponent implements OnInit, AfterViewInit constructor(private logger: LoggerService, private store: Store
---|