forked from lthn/blockchain
Develop (#215)
* fixed issue when user at first typing '.' in field amount * show amount value in modal without 0 * changed wallet colors style * fixed few issues with attachment encryption * added extra conditions on extra fields update in wallet * has_field_of_type_in_extra() -> have_type_in_variant_container() * implemented exclude_staking_txs filter * Implement master password confirmation * Small GUI bugs-> added translate for scale * Unexpected screen after clicking 'go back' * #154->Make alias registration error messages more informative * added Wallet Status on Lock-Screen * cleaned unused code * changed ! to i in sidebar * fixed ng build --prod issue * 139 -> Search in History tab * restored wallet text after not right merge * hide for Tracking wallet 'send' and 'contracts' tabs Co-authored-by: cryptozoidberg <crypto.zoidberg@gmail.com> Co-authored-by: sowle <crypto.sowle@gmail.com>
This commit is contained in:
parent
3de757e634
commit
c330b2bf39
11 changed files with 106 additions and 21 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -14,6 +14,7 @@ export class Wallet {
|
|||
tracking_hey: string;
|
||||
is_auditable: boolean;
|
||||
is_watch_only: boolean;
|
||||
exclude_mining_txs: boolean;
|
||||
alias_available: boolean;
|
||||
|
||||
alias?: object;
|
||||
|
|
|
|||
|
|
@ -636,11 +636,12 @@ export class BackendService {
|
|||
}
|
||||
}
|
||||
|
||||
getRecentTransfers( id, offset, count, callback) {
|
||||
getRecentTransfers( id, offset, count,exclude_mining_txs, callback) {
|
||||
const params = {
|
||||
wallet_id: id,
|
||||
offset: offset,
|
||||
count: count
|
||||
count: count,
|
||||
exclude_mining_txs: exclude_mining_txs
|
||||
};
|
||||
this.runCommand('get_recent_transfers', params, callback);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,6 +186,7 @@ export class LoginComponent implements OnInit, OnDestroy {
|
|||
new_wallet.is_auditable = open_data['wi'].is_auditable;
|
||||
new_wallet.is_watch_only = open_data['wi'].is_watch_only;
|
||||
new_wallet.currentPage = 1;
|
||||
new_wallet.exclude_mining_txs = false;
|
||||
if (open_data.recent_history && open_data.recent_history.history) {
|
||||
new_wallet.total_history_item = open_data.recent_history.total_history_items;
|
||||
new_wallet.totalPages = Math.ceil( open_data.recent_history.total_history_items / this.variablesService.count);
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ export class OpenWalletModalComponent implements OnInit {
|
|||
new_wallet.is_auditable = open_data['wi'].is_auditable;
|
||||
new_wallet.is_watch_only = open_data['wi'].is_watch_only;
|
||||
new_wallet.currentPage = 1;
|
||||
new_wallet.exclude_mining_txs = false;
|
||||
if (open_data.recent_history && open_data.recent_history.history) {
|
||||
new_wallet.total_history_item = open_data.recent_history.total_history_items;
|
||||
new_wallet.totalPages = Math.ceil( open_data.recent_history.total_history_items / this.variablesService.count);
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ export class OpenWalletComponent implements OnInit, OnDestroy {
|
|||
);
|
||||
new_wallet.alias = this.backend.getWalletAlias(new_wallet.address);
|
||||
new_wallet.currentPage = 1;
|
||||
new_wallet.exclude_mining_txs = false;
|
||||
new_wallet.is_auditable = open_data['wi'].is_auditable;
|
||||
new_wallet.is_watch_only = open_data['wi'].is_watch_only;
|
||||
if (open_data.recent_history && open_data.recent_history.history) {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
Watch-only
|
||||
</div>
|
||||
<div class="content auditable-watch-only" *ngIf="wallet.is_auditable && wallet.is_watch_only">
|
||||
Auditable Watch-Only
|
||||
Tracking
|
||||
</div>
|
||||
</div>
|
||||
<div class="close-wallet-wrapper">
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
<div class="tabs">
|
||||
<div class="tabs-header">
|
||||
<ng-container *ngFor="let tab of tabs; let index = index">
|
||||
<div class="tab" [class.active]="tab.active"
|
||||
<div class="tab" [class.active]="tab.active" [ngClass]="{ 'hide': ((tab.link === '/send' || tab.link === '/contracts') && variablesService.currentWallet.is_watch_only && variablesService.currentWallet.is_auditable) }"
|
||||
[class.disabled]="((tab.link === '/send' || tab.link === '/contracts' || tab.link === '/staking') && (variablesService.daemon_state !== 2 || !variablesService.currentWallet.loaded))
|
||||
|| ((tab.link === '/send' || tab.link === '/contracts') && variablesService.currentWallet.is_watch_only && variablesService.currentWallet.is_auditable)"
|
||||
(click)="changeTab(index)" (mouseover)="itemHovered(index, true)" (mouseleave)="itemHovered(index, false)">
|
||||
|
|
@ -50,12 +50,26 @@
|
|||
</div>
|
||||
<div *ngIf="activeTab === 'history'" class="pagination-wrapper">
|
||||
<div class="pagination">
|
||||
<div>
|
||||
<button [disabled]="variablesService.currentWallet.currentPage === 1" (click)="setPage(variablesService.currentWallet.currentPage - 1)"><</button>
|
||||
<ng-container *ngFor="let page of variablesService.currentWallet.pages">
|
||||
<button [ngClass]="{ 'active': variablesService.currentWallet.currentPage === page }"
|
||||
(click)="setPage(page)">{{page}}</button>
|
||||
<ng-container *ngIf="!mining">
|
||||
<button *ngFor="let page of variablesService.currentWallet.pages" [ngClass]="{ 'active': variablesService.currentWallet.currentPage === page }"
|
||||
(click)="setPage(page)">{{page}}</button>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="mining">
|
||||
<button [ngClass]="{ 'active': variablesService.currentWallet.currentPage }"
|
||||
(click)="setPage(variablesService.currentWallet.currentPage)">{{variablesService.currentWallet.currentPage}}</button>
|
||||
</ng-container>
|
||||
<button [disabled]="variablesService.currentWallet.currentPage === variablesService.currentWallet.totalPages" (click)="setPage(variablesService.currentWallet.currentPage + 1)">></button>
|
||||
</div>
|
||||
<div class="mining-transaction-switch">
|
||||
<span class="switch-text">Hide mining transactions</span>
|
||||
<div class="switch" (click)="toggleMiningTransactions(); $event.stopPropagation()">
|
||||
<span class="option" *ngIf="mining">{{ 'STAKING.SWITCH.ON' | translate }}</span>
|
||||
<span class="circle" [class.on]="mining" [class.off]="!mining"></span>
|
||||
<span class="option" *ngIf="!mining">{{ 'STAKING.SWITCH.OFF' | translate }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -160,19 +160,21 @@
|
|||
cursor: pointer;
|
||||
padding: 0 1rem;
|
||||
height: 5rem;
|
||||
|
||||
&.hide {
|
||||
display: none;
|
||||
}
|
||||
.animated {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-right: 1.3rem;
|
||||
}
|
||||
|
||||
|
||||
.animated ::ng-deep svg {
|
||||
|
||||
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
|
||||
|
||||
path, circle, polygon {
|
||||
fill: #4db1ff;
|
||||
}
|
||||
|
|
@ -239,10 +241,13 @@
|
|||
overflow-y: overlay;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.pagination-wrapper {
|
||||
.pagination {
|
||||
padding: 1rem;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
button {
|
||||
margin-right: 0.5rem;
|
||||
padding: 0;
|
||||
|
|
@ -253,3 +258,37 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mining-transaction-switch {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.switch-text {
|
||||
margin-right: 1rem;
|
||||
font-size: 1.3rem;
|
||||
color: #565c62;
|
||||
}
|
||||
|
||||
.switch {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-radius: 1rem;
|
||||
cursor: pointer;
|
||||
font-size: 1rem;
|
||||
padding: 0.5rem;
|
||||
width: 5rem;
|
||||
height: 2rem;
|
||||
|
||||
.circle {
|
||||
border-radius: 1rem;
|
||||
width: 1.2rem;
|
||||
height: 1.2rem;
|
||||
}
|
||||
|
||||
.option {
|
||||
margin: 0 0.2rem;
|
||||
line-height: 1.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ export class WalletComponent implements OnInit, OnDestroy {
|
|||
copyAnimationTimeout;
|
||||
balanceTooltip;
|
||||
activeTab = 'history';
|
||||
public mining:boolean = false;
|
||||
|
||||
public currentPage = 1;
|
||||
|
||||
|
|
@ -104,6 +105,7 @@ export class WalletComponent implements OnInit, OnDestroy {
|
|||
this.scrolledContent.nativeElement.scrollTop = 0;
|
||||
clearTimeout(this.copyAnimationTimeout);
|
||||
this.copyAnimation = false;
|
||||
this.mining = this.variablesService.currentWallet.exclude_mining_txs;
|
||||
});
|
||||
this.subRouting2 = this.router.events.subscribe(val => {
|
||||
if (val instanceof RoutesRecognized) {
|
||||
|
|
@ -194,10 +196,20 @@ export class WalletComponent implements OnInit, OnDestroy {
|
|||
return;
|
||||
}
|
||||
this.variablesService.currentWallet.currentPage = pageNumber;
|
||||
this.getRecentTransfers();
|
||||
}
|
||||
toggleMiningTransactions() {
|
||||
this.mining = !this.mining;
|
||||
this.variablesService.currentWallet.exclude_mining_txs = this.mining;
|
||||
this.variablesService.currentWallet.currentPage = 1;
|
||||
this.getRecentTransfers();
|
||||
}
|
||||
|
||||
getRecentTransfers () {
|
||||
this.backend.getRecentTransfers(
|
||||
this.walletID,
|
||||
(this.variablesService.currentWallet.currentPage - 1) * this.variablesService.count,
|
||||
this.variablesService.count, (status, data) => {
|
||||
this.variablesService.count, this.variablesService.currentWallet.exclude_mining_txs, (status, data) => {
|
||||
if (status && data.total_history_items) {
|
||||
this.variablesService.currentWallet.history.splice(0, this.variablesService.currentWallet.history.length);
|
||||
this.ngZone.run(() => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue