1
0
Fork 0
forked from lthn/blockchain

Merge branch 'frontend'

This commit is contained in:
wildkif 2019-03-27 16:29:36 +02:00
commit 05f3cd5c0d
14 changed files with 209 additions and 96 deletions

View file

@ -1,3 +1,16 @@
.app-content {
.preloader {
.loading-bar {
@include themify($themes) {
background-color: themed(progressBarFullBackgroundColor);
}
}
}
}
button {
border: none;
font-family: OpenSans, sans-serif;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

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

View file

@ -119,7 +119,7 @@ export class Wallet {
}
}
if (!exists) {
if (this.history.length && items[i].timestamp > this.history[0].timestamp) {
if (this.history.length && items[i].timestamp >= this.history[0].timestamp) {
this.history.unshift(this.prepareHistoryItem(items[i]));
} else {
this.history.push(this.prepareHistoryItem(items[i]));

View file

@ -1,10 +1,15 @@
<app-sidebar *ngIf="variablesService.appPass"></app-sidebar>
<div class="app-content scrolled-content">
<router-outlet></router-outlet>
<router-outlet *ngIf="[0, 1, 2].indexOf(variablesService.daemon_state) !== -1"></router-outlet>
<div class="preloader" *ngIf="[3, 4, 5].indexOf(variablesService.daemon_state) !== -1">
<span *ngIf="variablesService.daemon_state === 3">{{ 'SIDEBAR.SYNCHRONIZATION.LOADING' | translate }}</span>
<span *ngIf="variablesService.daemon_state === 4">{{ 'SIDEBAR.SYNCHRONIZATION.ERROR' | translate }}</span>
<span *ngIf="variablesService.daemon_state === 5">{{ 'SIDEBAR.SYNCHRONIZATION.COMPLETE' | translate }}</span>
<span class="loading-bar"></span>
</div>
</div>
<context-menu #allContextMenu>
<ng-template contextMenuItem (execute)="contextMenuCopy($event.item)">{{ 'CONTEXT_MENU.COPY' | translate }}</ng-template>
<ng-template contextMenuItem (execute)="contextMenuPaste($event.item)">{{ 'CONTEXT_MENU.PASTE' | translate }}</ng-template>

View file

@ -5,4 +5,54 @@
overflow-x: overlay;
overflow-y: hidden;
width: 100%;
.preloader {
align-self: center;
color: #fff;
font-size: 2rem;
margin: 0 auto;
text-align: center;
width: 50%;
.loading-bar {
display: block;
animation: move 5s linear infinite;
background-image:
-webkit-gradient(
linear, 0 0, 100% 100%,
color-stop(.125, rgba(0, 0, 0, .15)), color-stop(.125, transparent),
color-stop(.250, transparent), color-stop(.250, rgba(0, 0, 0, .10)),
color-stop(.375, rgba(0, 0, 0, .10)), color-stop(.375, transparent),
color-stop(.500, transparent), color-stop(.500, rgba(0, 0, 0, .15)),
color-stop(.625, rgba(0, 0, 0, .15)), color-stop(.625, transparent),
color-stop(.750, transparent), color-stop(.750, rgba(0, 0, 0, .10)),
color-stop(.875, rgba(0, 0, 0, .10)), color-stop(.875, transparent),
to(transparent)
),
-webkit-gradient(
linear, 0 100%, 100% 0,
color-stop(.125, rgba(0, 0, 0, .30)), color-stop(.125, transparent),
color-stop(.250, transparent), color-stop(.250, rgba(0, 0, 0, .25)),
color-stop(.375, rgba(0, 0, 0, .25)), color-stop(.375, transparent),
color-stop(.500, transparent), color-stop(.500, rgba(0, 0, 0, .30)),
color-stop(.625, rgba(0, 0, 0, .30)), color-stop(.625, transparent),
color-stop(.750, transparent), color-stop(.750, rgba(0, 0, 0, .25)),
color-stop(.875, rgba(0, 0, 0, .25)), color-stop(.875, transparent),
to(transparent)
);
background-size: 10rem 10rem;
margin-top: 2rem;
width: 100%;
height: 1rem;
}
}
@keyframes move {
0% {
background-position: 100% -10rem;
}
100% {
background-position: 100% 10rem;
}
}
}

View file

@ -75,6 +75,7 @@ export class AppComponent implements OnInit, OnDestroy {
this.ngZone.run(() => {
this.router.navigate(['/']);
});
this.variablesService.daemon_state = 5;
this.backend.storeSecureAppData(() => {
this.backend.storeAppData(() => {
const recursionCloseWallets = () => {

View file

@ -81,45 +81,43 @@ export class LoginComponent implements OnInit, OnDestroy {
this.backend.openWallet(wallet.path, wallet.pass, true, (open_status, open_data) => {
if (open_status) {
openWallets++;
this.ngZone.run(() => {
const new_wallet = new Wallet(
open_data.wallet_id,
wallet.name,
wallet.pass,
open_data['wi'].path,
open_data['wi'].address,
open_data['wi'].balance,
open_data['wi'].unlocked_balance,
open_data['wi'].mined_total,
open_data['wi'].tracking_hey
);
new_wallet.alias = this.backend.getWalletAlias(new_wallet.address);
if (open_data.recent_history && open_data.recent_history.history) {
new_wallet.prepareHistory(open_data.recent_history.history);
}
this.backend.getContracts(open_data.wallet_id, (contracts_status, contracts_data) => {
if (contracts_status && contracts_data.hasOwnProperty('contracts')) {
this.ngZone.run(() => {
new_wallet.prepareContractsAfterOpen(contracts_data.contracts, this.variablesService.exp_med_ts, this.variablesService.height_app, this.variablesService.settings.viewedContracts, this.variablesService.settings.notViewedContracts);
});
}
});
this.variablesService.wallets.push(new_wallet);
if (this.variablesService.wallets.length === 1) {
this.router.navigate(['/wallet/' + this.variablesService.wallets[0].wallet_id]);
}
});
this.backend.runWallet(open_data.wallet_id, (run_status) => {
if (run_status) {
runWallets++;
this.ngZone.run(() => {
const new_wallet = new Wallet(
open_data.wallet_id,
wallet.name,
wallet.pass,
open_data['wi'].path,
open_data['wi'].address,
open_data['wi'].balance,
open_data['wi'].unlocked_balance,
open_data['wi'].mined_total,
open_data['wi'].tracking_hey
);
new_wallet.alias = this.backend.getWalletAlias(new_wallet.address);
if (open_data.recent_history && open_data.recent_history.history) {
new_wallet.prepareHistory(open_data.recent_history.history);
}
this.backend.getContracts(open_data.wallet_id, (contracts_status, contracts_data) => {
if (contracts_status && contracts_data.hasOwnProperty('contracts')) {
this.ngZone.run(() => {
new_wallet.prepareContractsAfterOpen(contracts_data.contracts, this.variablesService.exp_med_ts, this.variablesService.height_app, this.variablesService.settings.viewedContracts, this.variablesService.settings.notViewedContracts);
});
}
});
this.variablesService.wallets.push(new_wallet);
if (this.variablesService.wallets.length === 1) {
this.router.navigate(['/wallet/' + this.variablesService.wallets[0].wallet_id]);
}
});
} else {
if (wallet_index === data.length - 1 && runWallets === 0) {
this.ngZone.run(() => {
this.router.navigate(['/']);
});
}
// console.log(run_data['error_code']);
}
});
} else {

View file

@ -85,31 +85,31 @@ export class OpenWalletComponent implements OnInit, OnDestroy {
});
});
} else {
const new_wallet = new Wallet(
open_data.wallet_id,
this.openForm.get('name').value,
this.openForm.get('password').value,
open_data['wi'].path,
open_data['wi'].address,
open_data['wi'].balance,
open_data['wi'].unlocked_balance,
open_data['wi'].mined_total,
open_data['wi'].tracking_hey
);
new_wallet.alias = this.backend.getWalletAlias(new_wallet.address);
if (open_data.recent_history && open_data.recent_history.history) {
new_wallet.prepareHistory(open_data.recent_history.history);
}
this.backend.getContracts(open_data.wallet_id, (contracts_status, contracts_data) => {
if (contracts_status && contracts_data.hasOwnProperty('contracts')) {
this.ngZone.run(() => {
new_wallet.prepareContractsAfterOpen(contracts_data.contracts, this.variablesService.exp_med_ts, this.variablesService.height_app, this.variablesService.settings.viewedContracts, this.variablesService.settings.notViewedContracts);
});
}
});
this.variablesService.wallets.push(new_wallet);
this.backend.runWallet(open_data.wallet_id, (run_status, run_data) => {
if (run_status) {
const new_wallet = new Wallet(
open_data.wallet_id,
this.openForm.get('name').value,
this.openForm.get('password').value,
open_data['wi'].path,
open_data['wi'].address,
open_data['wi'].balance,
open_data['wi'].unlocked_balance,
open_data['wi'].mined_total,
open_data['wi'].tracking_hey
);
new_wallet.alias = this.backend.getWalletAlias(new_wallet.address);
if (open_data.recent_history && open_data.recent_history.history) {
new_wallet.prepareHistory(open_data.recent_history.history);
}
this.backend.getContracts(open_data.wallet_id, (contracts_status, contracts_data) => {
if (contracts_status && contracts_data.hasOwnProperty('contracts')) {
this.ngZone.run(() => {
new_wallet.prepareContractsAfterOpen(contracts_data.contracts, this.variablesService.exp_med_ts, this.variablesService.height_app, this.variablesService.settings.viewedContracts, this.variablesService.settings.notViewedContracts);
});
}
});
this.variablesService.wallets.push(new_wallet);
this.backend.storeSecureAppData((status, data) => {
console.log('Store App Data', status, data);
});

View file

@ -240,8 +240,41 @@
}
.loading {
background-image: url("../../assets/images/loading.png");
animation: move 5s linear infinite;
background-image:
-webkit-gradient(
linear, 0 0, 100% 100%,
color-stop(.125, rgba(0, 0, 0, .15)), color-stop(.125, transparent),
color-stop(.250, transparent), color-stop(.250, rgba(0, 0, 0, .10)),
color-stop(.375, rgba(0, 0, 0, .10)), color-stop(.375, transparent),
color-stop(.500, transparent), color-stop(.500, rgba(0, 0, 0, .15)),
color-stop(.625, rgba(0, 0, 0, .15)), color-stop(.625, transparent),
color-stop(.750, transparent), color-stop(.750, rgba(0, 0, 0, .10)),
color-stop(.875, rgba(0, 0, 0, .10)), color-stop(.875, transparent),
to(transparent)
),
-webkit-gradient(
linear, 0 100%, 100% 0,
color-stop(.125, rgba(0, 0, 0, .30)), color-stop(.125, transparent),
color-stop(.250, transparent), color-stop(.250, rgba(0, 0, 0, .25)),
color-stop(.375, rgba(0, 0, 0, .25)), color-stop(.375, transparent),
color-stop(.500, transparent), color-stop(.500, rgba(0, 0, 0, .30)),
color-stop(.625, rgba(0, 0, 0, .30)), color-stop(.625, transparent),
color-stop(.750, transparent), color-stop(.750, rgba(0, 0, 0, .25)),
color-stop(.875, rgba(0, 0, 0, .25)), color-stop(.875, transparent),
to(transparent)
);
background-size: 7rem 7rem;
height: 100%;
}
}
}
@keyframes move {
0% {
background-position: 100% -7rem;
}
100% {
background-position: 100% 7rem;
}
}

View file

@ -1,3 +1,16 @@
.app-content {
.preloader {
.loading-bar {
@include themify($themes) {
background-color: themed(progressBarFullBackgroundColor);
}
}
}
}
button {
border: none;
font-family: OpenSans, sans-serif;