1
0
Fork 0
forked from lthn/blockchain

transaction details width fix

This commit is contained in:
wildkif 2019-01-22 17:02:50 +02:00
parent 5ccdc59c48
commit f097dd1bc9
8 changed files with 66 additions and 36 deletions

View file

@ -463,7 +463,7 @@ var TooltipDirective = /** @class */ (function () {
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "<div class=\"table\">\r\n <div class=\"row\">\r\n <span class=\"cell label\" [style.flex-basis]=\"cellSizes['1']\">{{ 'HISTORY.DETAILS.ID' | translate }}</span>\r\n <span class=\"cell key-value\" [style.flex-basis]=\"cellSizes['2']\">{{transaction.tx_hash}}</span>\r\n <span class=\"cell label\" [style.flex-basis]=\"cellSizes['3']\">{{ 'HISTORY.DETAILS.SIZE' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"cellSizes['4']\">{{ 'HISTORY.DETAILS.SIZE_VALUE' | translate : {value: transaction.tx_blob_size} }}</span>\r\n </div>\r\n <div class=\"row\">\r\n <span class=\"cell label\" [style.flex-basis]=\"cellSizes['1']\">{{ 'HISTORY.DETAILS.HEIGHT' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"cellSizes['2']\">{{transaction.height}}</span>\r\n <span class=\"cell label\" [style.flex-basis]=\"cellSizes['3']\">{{ 'HISTORY.DETAILS.CONFIRMATION' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"cellSizes['4']\">{{variablesService.height_app - transaction.height}}</span>\r\n </div>\r\n <div class=\"row\">\r\n <span class=\"cell label\" [style.flex-basis]=\"cellSizes['1']\">{{ 'HISTORY.DETAILS.INPUTS' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"cellSizes['2']\">{{transaction.td['rcv']?.length || 0}}</span>\r\n <span class=\"cell label\" [style.flex-basis]=\"cellSizes['3']\">{{ 'HISTORY.DETAILS.OUTPUTS' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"cellSizes['4']\">{{transaction.td['spn']?.length || 0}}</span>\r\n </div>\r\n</div>\r\n"
module.exports = "<div class=\"table\">\r\n <div class=\"row\">\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[0] + 'px'\">{{ 'HISTORY.DETAILS.ID' | translate }}</span>\r\n <span class=\"cell key-value\" [style.flex-basis]=\"sizes[1] + 'px'\">{{transaction.tx_hash}}</span>\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[2] + 'px'\">{{ 'HISTORY.DETAILS.SIZE' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[3] + 'px'\">{{ 'HISTORY.DETAILS.SIZE_VALUE' | translate : {value: transaction.tx_blob_size} }}</span>\r\n </div>\r\n <div class=\"row\">\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[0] + 'px'\">{{ 'HISTORY.DETAILS.HEIGHT' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[1] + 'px'\">{{transaction.height}}</span>\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[2] + 'px'\">{{ 'HISTORY.DETAILS.CONFIRMATION' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[3] + 'px'\">{{variablesService.height_app - transaction.height}}</span>\r\n </div>\r\n <div class=\"row\">\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[0] + 'px'\">{{ 'HISTORY.DETAILS.INPUTS' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[1] + 'px'\">{{transaction.td['rcv']?.length || 0}}</span>\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[2] + 'px'\">{{ 'HISTORY.DETAILS.OUTPUTS' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[3] + 'px'\">{{transaction.td['spn']?.length || 0}}</span>\r\n </div>\r\n</div>\r\n"
/***/ }),
@ -474,7 +474,7 @@ module.exports = "<div class=\"table\">\r\n <div class=\"row\">\r\n <span cl
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = ":host {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%; }\n\n.table {\n border-top: 0.2rem solid #ebebeb;\n margin: 0 3rem;\n padding: 0.5rem 0; }\n\n.table .row {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n border-top: none;\n line-height: 3rem;\n margin: 0 -0.5rem;\n width: 100%;\n height: 3rem; }\n\n.table .row .cell {\n flex-shrink: 0;\n flex-grow: 0;\n padding: 0 0.5rem;\n overflow: hidden;\n text-overflow: ellipsis; }\n\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvX2hlbHBlcnMvZGlyZWN0aXZlcy90cmFuc2FjdGlvbi1kZXRhaWxzL0Q6XFxQcm9qZWN0c1xcWmFub1xcc3JjXFxndWlcXHF0LWRhZW1vblxcaHRtbF9zb3VyY2Uvc3JjXFxhcHBcXF9oZWxwZXJzXFxkaXJlY3RpdmVzXFx0cmFuc2FjdGlvbi1kZXRhaWxzXFx0cmFuc2FjdGlvbi1kZXRhaWxzLmNvbXBvbmVudC5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0Usa0JBQWtCO0VBQ2xCLE1BQU07RUFDTixPQUFPO0VBQ1AsV0FBVyxFQUFBOztBQUdiO0VBQ0UsZ0NBQWdDO0VBQ2hDLGNBQWM7RUFDZCxpQkFBaUIsRUFBQTs7QUFIbkI7SUFNSSxhQUFhO0lBQ2IsMkJBQTJCO0lBQzNCLG1CQUFtQjtJQUNuQixnQkFBZ0I7SUFDaEIsaUJBQWlCO0lBQ2pCLGlCQUFpQjtJQUNqQixXQUFXO0lBQ1gsWUFBWSxFQUFBOztBQWJoQjtNQWdCTSxjQUFjO01BQ2QsWUFBWTtNQUNaLGlCQUFpQjtNQUNqQixnQkFBZ0I7TUFDaEIsdUJBQXVCLEVBQUEiLCJmaWxlIjoic3JjL2FwcC9faGVscGVycy9kaXJlY3RpdmVzL3RyYW5zYWN0aW9uLWRldGFpbHMvdHJhbnNhY3Rpb24tZGV0YWlscy5jb21wb25lbnQuc2NzcyIsInNvdXJjZXNDb250ZW50IjpbIjpob3N0IHtcclxuICBwb3NpdGlvbjogYWJzb2x1dGU7XHJcbiAgdG9wOiAwO1xyXG4gIGxlZnQ6IDA7XHJcbiAgd2lkdGg6IDEwMCU7XHJcbn1cclxuXHJcbi50YWJsZSB7XHJcbiAgYm9yZGVyLXRvcDogMC4ycmVtIHNvbGlkICNlYmViZWI7XHJcbiAgbWFyZ2luOiAwIDNyZW07XHJcbiAgcGFkZGluZzogMC41cmVtIDA7XHJcblxyXG4gIC5yb3cge1xyXG4gICAgZGlzcGxheTogZmxleDtcclxuICAgIGp1c3RpZnktY29udGVudDogZmxleC1zdGFydDtcclxuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XHJcbiAgICBib3JkZXItdG9wOiBub25lO1xyXG4gICAgbGluZS1oZWlnaHQ6IDNyZW07XHJcbiAgICBtYXJnaW46IDAgLTAuNXJlbTtcclxuICAgIHdpZHRoOiAxMDAlO1xyXG4gICAgaGVpZ2h0OiAzcmVtO1xyXG5cclxuICAgIC5jZWxsIHtcclxuICAgICAgZmxleC1zaHJpbms6IDA7XHJcbiAgICAgIGZsZXgtZ3JvdzogMDtcclxuICAgICAgcGFkZGluZzogMCAwLjVyZW07XHJcbiAgICAgIG92ZXJmbG93OiBoaWRkZW47XHJcbiAgICAgIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xyXG4gICAgfVxyXG4gIH1cclxufVxyXG4iXX0= */"
module.exports = ":host {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%; }\n\n.table {\n border-top: 0.2rem solid #ebebeb;\n margin: 0 3rem;\n padding: 0.5rem 0; }\n\n.table .row {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n border-top: none;\n line-height: 3rem;\n margin: 0 -3rem;\n width: 100%;\n height: 3rem; }\n\n.table .row .cell {\n flex-shrink: 0;\n flex-grow: 0;\n padding: 0 1rem;\n overflow: hidden;\n text-overflow: ellipsis; }\n\n.table .row .cell:first-child {\n padding-left: 3rem; }\n\n.table .row .cell:last-child {\n padding-right: 3rem; }\n\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvX2hlbHBlcnMvZGlyZWN0aXZlcy90cmFuc2FjdGlvbi1kZXRhaWxzL0Q6XFxQcm9qZWN0c1xcWmFub1xcc3JjXFxndWlcXHF0LWRhZW1vblxcaHRtbF9zb3VyY2Uvc3JjXFxhcHBcXF9oZWxwZXJzXFxkaXJlY3RpdmVzXFx0cmFuc2FjdGlvbi1kZXRhaWxzXFx0cmFuc2FjdGlvbi1kZXRhaWxzLmNvbXBvbmVudC5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0Usa0JBQWtCO0VBQ2xCLE1BQU07RUFDTixPQUFPO0VBQ1AsV0FBVyxFQUFBOztBQUdiO0VBQ0UsZ0NBQWdDO0VBQ2hDLGNBQWM7RUFDZCxpQkFBaUIsRUFBQTs7QUFIbkI7SUFNSSxhQUFhO0lBQ2IsMkJBQTJCO0lBQzNCLG1CQUFtQjtJQUNuQixnQkFBZ0I7SUFDaEIsaUJBQWlCO0lBQ2pCLGVBQWU7SUFDZixXQUFXO0lBQ1gsWUFBWSxFQUFBOztBQWJoQjtNQWdCTSxjQUFjO01BQ2QsWUFBWTtNQUNaLGVBQWU7TUFDZixnQkFBZ0I7TUFDaEIsdUJBQXVCLEVBQUE7O0FBcEI3QjtRQXVCUSxrQkFBa0IsRUFBQTs7QUF2QjFCO1FBMkJRLG1CQUFtQixFQUFBIiwiZmlsZSI6InNyYy9hcHAvX2hlbHBlcnMvZGlyZWN0aXZlcy90cmFuc2FjdGlvbi1kZXRhaWxzL3RyYW5zYWN0aW9uLWRldGFpbHMuY29tcG9uZW50LnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyI6aG9zdCB7XHJcbiAgcG9zaXRpb246IGFic29sdXRlO1xyXG4gIHRvcDogMDtcclxuICBsZWZ0OiAwO1xyXG4gIHdpZHRoOiAxMDAlO1xyXG59XHJcblxyXG4udGFibGUge1xyXG4gIGJvcmRlci10b3A6IDAuMnJlbSBzb2xpZCAjZWJlYmViO1xyXG4gIG1hcmdpbjogMCAzcmVtO1xyXG4gIHBhZGRpbmc6IDAuNXJlbSAwO1xyXG5cclxuICAucm93IHtcclxuICAgIGRpc3BsYXk6IGZsZXg7XHJcbiAgICBqdXN0aWZ5LWNvbnRlbnQ6IGZsZXgtc3RhcnQ7XHJcbiAgICBhbGlnbi1pdGVtczogY2VudGVyO1xyXG4gICAgYm9yZGVyLXRvcDogbm9uZTtcclxuICAgIGxpbmUtaGVpZ2h0OiAzcmVtO1xyXG4gICAgbWFyZ2luOiAwIC0zcmVtO1xyXG4gICAgd2lkdGg6IDEwMCU7XHJcbiAgICBoZWlnaHQ6IDNyZW07XHJcblxyXG4gICAgLmNlbGwge1xyXG4gICAgICBmbGV4LXNocmluazogMDtcclxuICAgICAgZmxleC1ncm93OiAwO1xyXG4gICAgICBwYWRkaW5nOiAwIDFyZW07XHJcbiAgICAgIG92ZXJmbG93OiBoaWRkZW47XHJcbiAgICAgIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xyXG5cclxuICAgICAgJjpmaXJzdC1jaGlsZCB7XHJcbiAgICAgICAgcGFkZGluZy1sZWZ0OiAzcmVtO1xyXG4gICAgICB9XHJcblxyXG4gICAgICAmOmxhc3QtY2hpbGQge1xyXG4gICAgICAgIHBhZGRpbmctcmlnaHQ6IDNyZW07XHJcbiAgICAgIH1cclxuICAgIH1cclxuICB9XHJcbn1cclxuIl19 */"
/***/ }),
@ -506,18 +506,16 @@ var __metadata = (undefined && undefined.__metadata) || function (k, v) {
var TransactionDetailsComponent = /** @class */ (function () {
function TransactionDetailsComponent(variablesService) {
this.variablesService = variablesService;
this.cellSizes = {
1: '25%',
2: '25%',
3: '25%',
4: '25%'
};
}
TransactionDetailsComponent.prototype.ngOnInit = function () { };
__decorate([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
__metadata("design:type", _models_transaction_model__WEBPACK_IMPORTED_MODULE_1__["Transaction"])
], TransactionDetailsComponent.prototype, "transaction", void 0);
__decorate([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
__metadata("design:type", Array)
], TransactionDetailsComponent.prototype, "sizes", void 0);
TransactionDetailsComponent = __decorate([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
selector: 'app-transaction-details',
@ -1603,7 +1601,7 @@ var BackendService = /** @class */ (function () {
this.runCommand('close_wallet', { wallet_id: wallet_id }, callback);
};
BackendService.prototype.getSmartWalletInfo = function (wallet_id, callback) {
this.runCommand('get_smart_safe_info', { wallet_id: +wallet_id }, callback);
this.runCommand('get_smart_wallet_info', { wallet_id: +wallet_id }, callback);
};
BackendService.prototype.runWallet = function (wallet_id, callback) {
this.runCommand('run_wallet', { wallet_id: +wallet_id }, callback);
@ -3214,7 +3212,7 @@ var CreateWalletComponent = /** @class */ (function () {
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "<div class=\"wrap-table\">\r\n <table class=\"history-table\">\r\n <thead>\r\n <tr>\r\n <th>{{ 'HISTORY.STATUS' | translate }}</th>\r\n <th>{{ 'HISTORY.DATE' | translate }}</th>\r\n <th>{{ 'HISTORY.AMOUNT' | translate }}</th>\r\n <th>{{ 'HISTORY.FEE' | translate }}</th>\r\n <th>{{ 'HISTORY.ADDRESS' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let item of variablesService.currentWallet.history; let index = index\">\r\n <tr (click)=\"openDetails(index)\">\r\n <td>\r\n <div class=\"status\" [class.send]=\"!item.is_income\" [class.received]=\"item.is_income\">\r\n <ng-container *ngIf=\"variablesService.height_app - item.height < 10 || item.height === 0 && item.timestamp > 0\">\r\n <div class=\"confirmation\" tooltip=\"{{ 'HISTORY.STATUS_TOOLTIP' | translate : {'current': getHeight(item)/10, 'total': 10} }}\" placement=\"bottom\" tooltipClass=\"history-tooltip\" [delay]=\"500\">\r\n <div class=\"fill\" [style.height]=\"getHeight(item) + '%'\"></div>\r\n </div>\r\n </ng-container>\r\n <i class=\"icon\"></i>\r\n <span>{{ (item.is_income ? 'HISTORY.RECEIVED' : 'HISTORY.SEND') | translate }}</span>\r\n </div>\r\n </td>\r\n <td>{{item.timestamp * 1000 | date : 'dd-MM-yyyy HH:mm'}}</td>\r\n <td>\r\n <span *ngIf=\"item.sortAmount && item.sortAmount.toString() !== '0'\">{{item.sortAmount | intToMoney}} {{variablesService.defaultCurrency}}</span>\r\n </td>\r\n <td>\r\n <span *ngIf=\"item.sortFee && item.sortFee.toString() !== '0'\">{{item.sortFee | intToMoney}} {{variablesService.defaultCurrency}}</span>\r\n </td>\r\n <td class=\"remote-address\">\r\n <span>{{item | historyTypeMessages}}</span>\r\n </td>\r\n </tr>\r\n <tr class=\"transaction-details\" [class.open]=\"index === openedDetails\">\r\n <td colspan=\"5\">\r\n <app-transaction-details *ngIf=\"index === openedDetails\" [transaction]=\"item\"></app-transaction-details>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n</div>\r\n"
module.exports = "<div class=\"wrap-table\">\r\n <table class=\"history-table\">\r\n <thead>\r\n <tr #head (window:resize)=\"calculateWidth()\">\r\n <th>{{ 'HISTORY.STATUS' | translate }}</th>\r\n <th>{{ 'HISTORY.DATE' | translate }}</th>\r\n <th>{{ 'HISTORY.AMOUNT' | translate }}</th>\r\n <th>{{ 'HISTORY.FEE' | translate }}</th>\r\n <th>{{ 'HISTORY.ADDRESS' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let item of variablesService.currentWallet.history; let index = index\">\r\n <tr (click)=\"openDetails(index)\">\r\n <td>\r\n <div class=\"status\" [class.send]=\"!item.is_income\" [class.received]=\"item.is_income\">\r\n <ng-container *ngIf=\"variablesService.height_app - item.height < 10 || item.height === 0 && item.timestamp > 0\">\r\n <div class=\"confirmation\" tooltip=\"{{ 'HISTORY.STATUS_TOOLTIP' | translate : {'current': getHeight(item)/10, 'total': 10} }}\" placement=\"bottom\" tooltipClass=\"history-tooltip\" [delay]=\"500\">\r\n <div class=\"fill\" [style.height]=\"getHeight(item) + '%'\"></div>\r\n </div>\r\n </ng-container>\r\n <i class=\"icon\"></i>\r\n <span>{{ (item.is_income ? 'HISTORY.RECEIVED' : 'HISTORY.SEND') | translate }}</span>\r\n </div>\r\n </td>\r\n <td>{{item.timestamp * 1000 | date : 'dd-MM-yyyy HH:mm'}}</td>\r\n <td>\r\n <span *ngIf=\"item.sortAmount && item.sortAmount.toString() !== '0'\">{{item.sortAmount | intToMoney}} {{variablesService.defaultCurrency}}</span>\r\n </td>\r\n <td>\r\n <span *ngIf=\"item.sortFee && item.sortFee.toString() !== '0'\">{{item.sortFee | intToMoney}} {{variablesService.defaultCurrency}}</span>\r\n </td>\r\n <td class=\"remote-address\">\r\n <span>{{item | historyTypeMessages}}</span>\r\n </td>\r\n </tr>\r\n <tr class=\"transaction-details\" [class.open]=\"index === openedDetails\">\r\n <td colspan=\"5\">\r\n <app-transaction-details *ngIf=\"index === openedDetails\" [transaction]=\"item\" [sizes]=\"calculatedWidth\"></app-transaction-details>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n</div>\r\n"
/***/ }),
@ -3256,8 +3254,12 @@ var HistoryComponent = /** @class */ (function () {
function HistoryComponent(variablesService) {
this.variablesService = variablesService;
this.openedDetails = false;
this.calculatedWidth = [];
}
HistoryComponent.prototype.ngOnInit = function () { };
HistoryComponent.prototype.ngAfterViewChecked = function () {
this.calculateWidth();
};
HistoryComponent.prototype.getHeight = function (item) {
if ((this.variablesService.height_app - item.height >= 10 && item.height !== 0) || (item.is_mining === true && item.height === 0)) {
return 100;
@ -3279,7 +3281,18 @@ var HistoryComponent = /** @class */ (function () {
this.openedDetails = index;
}
};
HistoryComponent.prototype.calculateWidth = function () {
this.calculatedWidth = [];
this.calculatedWidth.push(this.head.nativeElement.childNodes[0].clientWidth);
this.calculatedWidth.push(this.head.nativeElement.childNodes[1].clientWidth + this.head.nativeElement.childNodes[2].clientWidth);
this.calculatedWidth.push(this.head.nativeElement.childNodes[3].clientWidth);
this.calculatedWidth.push(this.head.nativeElement.childNodes[4].clientWidth);
};
HistoryComponent.prototype.ngOnDestroy = function () { };
__decorate([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"])('head'),
__metadata("design:type", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"])
], HistoryComponent.prototype, "head", void 0);
HistoryComponent = __decorate([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
selector: 'app-history',

File diff suppressed because one or more lines are too long

View file

@ -1,20 +1,20 @@
<div class="table">
<div class="row">
<span class="cell label" [style.flex-basis]="cellSizes['1']">{{ 'HISTORY.DETAILS.ID' | translate }}</span>
<span class="cell key-value" [style.flex-basis]="cellSizes['2']">{{transaction.tx_hash}}</span>
<span class="cell label" [style.flex-basis]="cellSizes['3']">{{ 'HISTORY.DETAILS.SIZE' | translate }}</span>
<span class="cell value" [style.flex-basis]="cellSizes['4']">{{ 'HISTORY.DETAILS.SIZE_VALUE' | translate : {value: transaction.tx_blob_size} }}</span>
<span class="cell label" [style.flex-basis]="sizes[0] + 'px'">{{ 'HISTORY.DETAILS.ID' | translate }}</span>
<span class="cell key-value" [style.flex-basis]="sizes[1] + 'px'">{{transaction.tx_hash}}</span>
<span class="cell label" [style.flex-basis]="sizes[2] + 'px'">{{ 'HISTORY.DETAILS.SIZE' | translate }}</span>
<span class="cell value" [style.flex-basis]="sizes[3] + 'px'">{{ 'HISTORY.DETAILS.SIZE_VALUE' | translate : {value: transaction.tx_blob_size} }}</span>
</div>
<div class="row">
<span class="cell label" [style.flex-basis]="cellSizes['1']">{{ 'HISTORY.DETAILS.HEIGHT' | translate }}</span>
<span class="cell value" [style.flex-basis]="cellSizes['2']">{{transaction.height}}</span>
<span class="cell label" [style.flex-basis]="cellSizes['3']">{{ 'HISTORY.DETAILS.CONFIRMATION' | translate }}</span>
<span class="cell value" [style.flex-basis]="cellSizes['4']">{{variablesService.height_app - transaction.height}}</span>
<span class="cell label" [style.flex-basis]="sizes[0] + 'px'">{{ 'HISTORY.DETAILS.HEIGHT' | translate }}</span>
<span class="cell value" [style.flex-basis]="sizes[1] + 'px'">{{transaction.height}}</span>
<span class="cell label" [style.flex-basis]="sizes[2] + 'px'">{{ 'HISTORY.DETAILS.CONFIRMATION' | translate }}</span>
<span class="cell value" [style.flex-basis]="sizes[3] + 'px'">{{variablesService.height_app - transaction.height}}</span>
</div>
<div class="row">
<span class="cell label" [style.flex-basis]="cellSizes['1']">{{ 'HISTORY.DETAILS.INPUTS' | translate }}</span>
<span class="cell value" [style.flex-basis]="cellSizes['2']">{{transaction.td['rcv']?.length || 0}}</span>
<span class="cell label" [style.flex-basis]="cellSizes['3']">{{ 'HISTORY.DETAILS.OUTPUTS' | translate }}</span>
<span class="cell value" [style.flex-basis]="cellSizes['4']">{{transaction.td['spn']?.length || 0}}</span>
<span class="cell label" [style.flex-basis]="sizes[0] + 'px'">{{ 'HISTORY.DETAILS.INPUTS' | translate }}</span>
<span class="cell value" [style.flex-basis]="sizes[1] + 'px'">{{transaction.td['rcv']?.length || 0}}</span>
<span class="cell label" [style.flex-basis]="sizes[2] + 'px'">{{ 'HISTORY.DETAILS.OUTPUTS' | translate }}</span>
<span class="cell value" [style.flex-basis]="sizes[3] + 'px'">{{transaction.td['spn']?.length || 0}}</span>
</div>
</div>

View file

@ -16,16 +16,24 @@
align-items: center;
border-top: none;
line-height: 3rem;
margin: 0 -0.5rem;
margin: 0 -3rem;
width: 100%;
height: 3rem;
.cell {
flex-shrink: 0;
flex-grow: 0;
padding: 0 0.5rem;
padding: 0 1rem;
overflow: hidden;
text-overflow: ellipsis;
&:first-child {
padding-left: 3rem;
}
&:last-child {
padding-right: 3rem;
}
}
}
}

View file

@ -10,12 +10,7 @@ import {VariablesService} from "../../services/variables.service";
export class TransactionDetailsComponent implements OnInit {
@Input() transaction: Transaction;
cellSizes = {
1: '25%',
2: '25%',
3: '25%',
4: '25%'
};
@Input() sizes: Array<number>;
constructor(private variablesService: VariablesService) {}

View file

@ -343,7 +343,7 @@ export class BackendService {
}
getSmartWalletInfo(wallet_id, callback) {
this.runCommand('get_smart_safe_info', {wallet_id: +wallet_id}, callback);
this.runCommand('get_smart_wallet_info', {wallet_id: +wallet_id}, callback);
}
runWallet(wallet_id, callback) {

View file

@ -1,7 +1,7 @@
<div class="wrap-table">
<table class="history-table">
<thead>
<tr>
<tr #head (window:resize)="calculateWidth()">
<th>{{ 'HISTORY.STATUS' | translate }}</th>
<th>{{ 'HISTORY.DATE' | translate }}</th>
<th>{{ 'HISTORY.AMOUNT' | translate }}</th>
@ -36,7 +36,7 @@
</tr>
<tr class="transaction-details" [class.open]="index === openedDetails">
<td colspan="5">
<app-transaction-details *ngIf="index === openedDetails" [transaction]="item"></app-transaction-details>
<app-transaction-details *ngIf="index === openedDetails" [transaction]="item" [sizes]="calculatedWidth"></app-transaction-details>
</td>
</tr>
</ng-container>

View file

@ -1,4 +1,4 @@
import {Component, OnInit, OnDestroy} from '@angular/core';
import {Component, OnInit, OnDestroy, AfterViewChecked, ViewChild, ElementRef} from '@angular/core';
import {VariablesService} from '../_helpers/services/variables.service';
@Component({
@ -6,14 +6,20 @@ import {VariablesService} from '../_helpers/services/variables.service';
templateUrl: './history.component.html',
styleUrls: ['./history.component.scss']
})
export class HistoryComponent implements OnInit, OnDestroy {
export class HistoryComponent implements OnInit, OnDestroy, AfterViewChecked {
openedDetails = false;
calculatedWidth = [];
@ViewChild('head') head: ElementRef;
constructor(private variablesService: VariablesService) {}
ngOnInit() {}
ngAfterViewChecked() {
this.calculateWidth();
}
getHeight(item) {
if ((this.variablesService.height_app - item.height >= 10 && item.height !== 0) || (item.is_mining === true && item.height === 0)) {
return 100;
@ -34,6 +40,14 @@ export class HistoryComponent implements OnInit, OnDestroy {
}
}
calculateWidth() {
this.calculatedWidth = [];
this.calculatedWidth.push(this.head.nativeElement.childNodes[0].clientWidth);
this.calculatedWidth.push(this.head.nativeElement.childNodes[1].clientWidth + this.head.nativeElement.childNodes[2].clientWidth);
this.calculatedWidth.push(this.head.nativeElement.childNodes[3].clientWidth);
this.calculatedWidth.push(this.head.nativeElement.childNodes[4].clientWidth);
}
ngOnDestroy() {}
}