-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from EOSEssentials/dev
- Loading branch information
Showing
20 changed files
with
143 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { AppService } from '../../services/app.service'; | ||
import { Observable } from 'rxjs'; | ||
|
||
@Component({ | ||
templateUrl: './dashboard.component.html', | ||
styleUrls: ['./dashboard.component.scss'] | ||
}) | ||
export class DashboardComponent implements OnInit { | ||
|
||
constructor() { } | ||
isMaintenance$: Observable<boolean>; | ||
|
||
constructor( | ||
private appService: AppService | ||
) { } | ||
|
||
ngOnInit() { | ||
this.isMaintenance$ = this.appService.isMaintenance$; | ||
} | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
src/app/dashboard1/dashboard/maintenance/maintenance.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="16px" class="mat-elevation-z1" style="padding:24px;"> | ||
<mat-icon color="warn">warning</mat-icon> | ||
<p class="mat-body-1 mat-error">EOS Tracker Database is down for maintenance. We expect to be back in a couple hours. But you can still check Block, Transaction | ||
and Account information via search. Thanks for your patience.</p> | ||
</div> |
Empty file.
15 changes: 15 additions & 0 deletions
15
src/app/dashboard1/dashboard/maintenance/maintenance.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-dashboard-maintenance', | ||
templateUrl: './maintenance.component.html', | ||
styleUrls: ['./maintenance.component.scss'] | ||
}) | ||
export class MaintenanceComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { EosService } from './eos.service'; | ||
import { Observable, Subject } from 'rxjs'; | ||
import { map, share, withLatestFrom } from 'rxjs/operators'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class AppService { | ||
|
||
private latestBlockNumberSource = new Subject<number>(); | ||
|
||
latestBlockNumber$ = this.latestBlockNumberSource.asObservable(); | ||
chainStatus$: Observable<any>; | ||
isMaintenance$: Observable<boolean>; | ||
|
||
constructor( | ||
private eosService: EosService | ||
) { | ||
this.chainStatus$ = this.eosService.getInfo().pipe( | ||
share() | ||
); | ||
this.isMaintenance$ = this.chainStatus$.pipe( | ||
withLatestFrom(this.latestBlockNumber$), | ||
map(([chainStatus, blockNumber]) => { | ||
return (chainStatus.head_block_num - blockNumber) > 600; | ||
}), | ||
share() | ||
); | ||
} | ||
|
||
setLatestBlockNumber(blockNumber: number) { | ||
if (blockNumber) { | ||
this.latestBlockNumberSource.next(blockNumber); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div class="truncate" | ||
[ngStyle.xs]="{'max-width.px':breakpoint.xs}" | ||
[ngStyle.sm]="{'max-width.px':breakpoint.sm}" | ||
[ngStyle.md]="{'max-width.px':breakpoint.md}" | ||
[ngStyle.lg]="{'max-width.px':breakpoint.lg}"> | ||
{{id}} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.truncate { | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Component, OnChanges, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'id-64', | ||
templateUrl: './id64.component.html', | ||
styleUrls: ['./id64.component.scss'] | ||
}) | ||
export class Id64Component implements OnChanges { | ||
|
||
@Input() id: string; | ||
@Input() override; | ||
breakpoint; | ||
|
||
constructor() { } | ||
|
||
ngOnChanges() { | ||
this.breakpoint = { ...DEFAULTS, ...this.override }; | ||
} | ||
|
||
} | ||
|
||
const DEFAULTS = { xs: 160, sm: 240, md: 320, lg: 400 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,3 +60,8 @@ a { | |
color: mat-color($app-light-accent); | ||
text-decoration: none; | ||
} | ||
|
||
p { | ||
margin: 0; | ||
padding: 0; | ||
} |