diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 1f640a4..559fd95 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -6,6 +6,7 @@ import { HomeRoutingModule } from './home/home-routing.module'; import { DetailRoutingModule } from './detail/detail-routing.module'; import { HardForkInfoRoutingModule } from './hard-fork-info/hard-fork-info-routing.module'; import { SettingsModule } from './settings/settings.module'; +import { TransactionsModule } from './transactions/transactions.module'; const routes: Routes = [ { @@ -24,6 +25,7 @@ const routes: Routes = [ RouterModule.forRoot(routes, {}), HomeRoutingModule, DetailRoutingModule, + TransactionsModule, HardForkInfoRoutingModule, SettingsModule ], diff --git a/src/app/app.component.html b/src/app/app.component.html index e330bae..7836fbc 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,7 +1,7 @@
-
+
diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 015259d..8ad3137 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -20,6 +20,8 @@ import { LoadComponent } from "./load/load.component"; import { BansModule } from './bans/bans.module'; import { NavbarComponent } from "./navbar/navbar.component"; import { MiningModule } from './mining/mining.module'; +import { TransactionsModule } from './transactions/transactions.module'; +import { OutputsModule } from './outputs/outputs.module'; // AoT requires an exported function for factories const httpLoaderFactory = (http: HttpClient): TranslateHttpLoader => new TranslateHttpLoader(http, './assets/i18n/', '.json'); @@ -36,6 +38,9 @@ const httpLoaderFactory = (http: HttpClient): TranslateHttpLoader => new Transl DetailModule, BansModule, MiningModule, + TransactionsModule, + OutputsModule, + TranslateModule, AppRoutingModule, TranslateModule.forRoot({ loader: { diff --git a/src/app/detail/detail.component.html b/src/app/detail/detail.component.html index 9099a33..b4666ac 100644 --- a/src/app/detail/detail.component.html +++ b/src/app/detail/detail.component.html @@ -5,9 +5,13 @@
-

Daemon not running

+

Daemon not running

Start monero daemon

- + +
@for(card of cards; track card.header) { diff --git a/src/app/detail/detail.component.ts b/src/app/detail/detail.component.ts index 2ce99e2..f556c14 100644 --- a/src/app/detail/detail.component.ts +++ b/src/app/detail/detail.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, AfterViewInit, NgZone } from '@angular/core'; +import { Component, OnInit, AfterViewInit, NgZone, OnDestroy } from '@angular/core'; import { DaemonService } from '../core/services/daemon/daemon.service'; import { SyncInfo } from '../../common/SyncInfo'; import { Peer } from '../../common/Peer'; @@ -12,9 +12,10 @@ import { DaemonInfo } from '../../common/DaemonInfo'; templateUrl: './detail.component.html', styleUrls: ['./detail.component.scss'] }) -export class DetailComponent implements OnInit, AfterViewInit { +export class DetailComponent implements OnInit, AfterViewInit, OnDestroy { public daemonRunning: boolean; + public startingDaemon: boolean; private syncInfo?: SyncInfo; private daemonInfo?: DaemonInfo; private readonly navbarLinks: NavbarLink[]; @@ -38,6 +39,8 @@ export class DetailComponent implements OnInit, AfterViewInit { private isLoading: boolean; + private loadInterval?: any; + public get loading(): boolean { return this.isLoading; } @@ -46,6 +49,7 @@ export class DetailComponent implements OnInit, AfterViewInit { constructor(private router: Router,private daemonService: DaemonService, private navbarService: NavbarService, private ngZone: NgZone) { this.daemonRunning = false; + this.startingDaemon = false; this.syncStatus = 'Not synced'; this.height = 0; this.targetHeight = 0; @@ -86,8 +90,11 @@ export class DetailComponent implements OnInit, AfterViewInit { console.log('DetailComponent AFTER VIEW INIT'); this.navbarService.setNavbarLinks(this.navbarLinks); - setTimeout(() => { + this.loadInterval = setInterval(() => { this.ngZone.run(() => { + if (this.isLoading) { + return; + } const $table = $('#table'); $table.bootstrapTable({}); $table.bootstrapTable('refreshOptions', { @@ -95,8 +102,16 @@ export class DetailComponent implements OnInit, AfterViewInit { }); this.load(); - }, 500); }); + }, 5000); + } + + ngOnDestroy(): void { + console.log("DetailComponent ON DESTROY"); + + if(this.loadInterval != null) { + clearInterval(this.loadInterval); + } } public async startDaemon(): Promise { @@ -104,9 +119,17 @@ export class DetailComponent implements OnInit, AfterViewInit { console.warn("Daemon already running"); return; } + this.startingDaemon = true; - await this.daemonService.startDaemon(); - this.daemonRunning = await this.daemonService.isRunning(); + try { + await this.daemonService.startDaemon(); + this.daemonRunning = await this.daemonService.isRunning(); + } + catch(error) { + console.error(error); + } + + this.startingDaemon = false; } private onNavigationEnd(): void { diff --git a/src/app/mining/mining.component.html b/src/app/mining/mining.component.html index 3195148..d23f054 100644 --- a/src/app/mining/mining.component.html +++ b/src/app/mining/mining.component.html @@ -55,11 +55,13 @@
-

Core is busy.

+

Core is busy.

Mining capabilities are not available during daemon sync.

+