Merge branch 'master' into unfurler-refactor
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule, PreloadAllModules } from '@angular/router';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { AppPreloadingStrategy } from './app.preloading-strategy'
|
||||
import { StartComponent } from './components/start/start.component';
|
||||
import { TransactionComponent } from './components/transaction/transaction.component';
|
||||
import { TransactionPreviewComponent } from './components/transaction/transaction-preview.component';
|
||||
@@ -25,6 +26,10 @@ import { AssetsComponent } from './components/assets/assets.component';
|
||||
import { AssetComponent } from './components/asset/asset.component';
|
||||
import { AssetsNavComponent } from './components/assets/assets-nav/assets-nav.component';
|
||||
|
||||
const browserWindow = window || {};
|
||||
// @ts-ignore
|
||||
const browserWindowEnv = browserWindow.__env || {};
|
||||
|
||||
let routes: Routes = [
|
||||
{
|
||||
path: 'testnet',
|
||||
@@ -32,7 +37,8 @@ let routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
pathMatch: 'full',
|
||||
loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule)
|
||||
loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule),
|
||||
data: { preload: true },
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
@@ -109,7 +115,8 @@ let routes: Routes = [
|
||||
},
|
||||
{
|
||||
path: 'docs',
|
||||
loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule)
|
||||
loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule),
|
||||
data: { preload: true },
|
||||
},
|
||||
{
|
||||
path: 'api',
|
||||
@@ -117,7 +124,8 @@ let routes: Routes = [
|
||||
},
|
||||
{
|
||||
path: 'lightning',
|
||||
loadChildren: () => import('./lightning/lightning.module').then(m => m.LightningModule)
|
||||
loadChildren: () => import('./lightning/lightning.module').then(m => m.LightningModule),
|
||||
data: { preload: browserWindowEnv && browserWindowEnv.LIGHTNING === true },
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -410,10 +418,6 @@ let routes: Routes = [
|
||||
},
|
||||
];
|
||||
|
||||
const browserWindow = window || {};
|
||||
// @ts-ignore
|
||||
const browserWindowEnv = browserWindow.__env || {};
|
||||
|
||||
if (browserWindowEnv && browserWindowEnv.BASE_MODULE === 'bisq') {
|
||||
routes = [{
|
||||
path: '',
|
||||
@@ -691,7 +695,7 @@ if (browserWindowEnv && browserWindowEnv.BASE_MODULE === 'liquid') {
|
||||
initialNavigation: 'enabled',
|
||||
scrollPositionRestoration: 'enabled',
|
||||
anchorScrolling: 'enabled',
|
||||
preloadingStrategy: PreloadAllModules
|
||||
preloadingStrategy: AppPreloadingStrategy
|
||||
})],
|
||||
})
|
||||
export class AppRoutingModule { }
|
||||
|
||||
@@ -18,6 +18,7 @@ import { LanguageService } from './services/language.service';
|
||||
import { FiatShortenerPipe } from './shared/pipes/fiat-shortener.pipe';
|
||||
import { ShortenStringPipe } from './shared/pipes/shorten-string-pipe/shorten-string.pipe';
|
||||
import { CapAddressPipe } from './shared/pipes/cap-address-pipe/cap-address-pipe';
|
||||
import { AppPreloadingStrategy } from './app.preloading-strategy';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
@@ -44,6 +45,7 @@ import { CapAddressPipe } from './shared/pipes/cap-address-pipe/cap-address-pipe
|
||||
ShortenStringPipe,
|
||||
FiatShortenerPipe,
|
||||
CapAddressPipe,
|
||||
AppPreloadingStrategy,
|
||||
{ provide: HTTP_INTERCEPTORS, useClass: HttpCacheInterceptor, multi: true }
|
||||
],
|
||||
bootstrap: [AppComponent]
|
||||
|
||||
10
frontend/src/app/app.preloading-strategy.ts
Normal file
10
frontend/src/app/app.preloading-strategy.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { PreloadingStrategy, Route } from '@angular/router';
|
||||
import { Observable, timer, mergeMap, of } from 'rxjs';
|
||||
|
||||
export class AppPreloadingStrategy implements PreloadingStrategy {
|
||||
preload(route: Route, load: Function): Observable<any> {
|
||||
return route.data && route.data.preload
|
||||
? timer(1500).pipe(mergeMap(() => load()))
|
||||
: of(null);
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@
|
||||
flex-direction: column;
|
||||
@media (min-width: 991px) {
|
||||
position: relative;
|
||||
top: -65px;
|
||||
top: -100px;
|
||||
}
|
||||
@media (min-width: 830px) and (max-width: 991px) {
|
||||
position: relative;
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
flex-direction: column;
|
||||
@media (min-width: 991px) {
|
||||
position: relative;
|
||||
top: -65px;
|
||||
top: -100px;
|
||||
}
|
||||
@media (min-width: 830px) and (max-width: 991px) {
|
||||
position: relative;
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
flex-direction: column;
|
||||
@media (min-width: 991px) {
|
||||
position: relative;
|
||||
top: -65px;
|
||||
top: -100px;
|
||||
}
|
||||
@media (min-width: 830px) and (max-width: 991px) {
|
||||
position: relative;
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
flex-direction: column;
|
||||
@media (min-width: 991px) {
|
||||
position: relative;
|
||||
top: -65px;
|
||||
top: -100px;
|
||||
}
|
||||
@media (min-width: 830px) and (max-width: 991px) {
|
||||
position: relative;
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
flex-direction: column;
|
||||
@media (min-width: 1130px) {
|
||||
position: relative;
|
||||
top: -65px;
|
||||
top: -100px;
|
||||
}
|
||||
@media (min-width: 830px) and (max-width: 1130px) {
|
||||
position: relative;
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
flex-direction: column;
|
||||
@media (min-width: 991px) {
|
||||
position: relative;
|
||||
top: -65px;
|
||||
top: -100px;
|
||||
}
|
||||
@media (min-width: 830px) and (max-width: 991px) {
|
||||
position: relative;
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
flex-direction: column;
|
||||
@media (min-width: 991px) {
|
||||
position: relative;
|
||||
top: -65px;
|
||||
top: -100px;
|
||||
}
|
||||
@media (min-width: 830px) and (max-width: 991px) {
|
||||
position: relative;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
flex-direction: column;
|
||||
@media (min-width: 991px) {
|
||||
position: relative;
|
||||
top: -65px;
|
||||
top: -100px;
|
||||
}
|
||||
@media (min-width: 830px) and (max-width: 991px) {
|
||||
position: relative;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</div>
|
||||
|
||||
<form [formGroup]="radioGroupForm" class="formRadioGroup"
|
||||
[class]="stateService.env.MINING_DASHBOARD ? 'mining' : ''" (click)="saveGraphPreference()">
|
||||
[class]="(stateService.env.MINING_DASHBOARD || stateService.env.LIGHTNING) ? 'mining' : 'no-menu'" (click)="saveGraphPreference()">
|
||||
<div *ngIf="!isMobile()" class="btn-group btn-group-toggle">
|
||||
<label ngbButtonLabel class="btn-primary btn-sm mr-2">
|
||||
<a [routerLink]="['/tv' | relativeUrl]" style="color: white" id="btn-tv">
|
||||
|
||||
@@ -55,13 +55,19 @@
|
||||
.formRadioGroup.mining {
|
||||
@media (min-width: 991px) {
|
||||
position: relative;
|
||||
top: -65px;
|
||||
top: -100px;
|
||||
}
|
||||
@media (min-width: 830px) and (max-width: 991px) {
|
||||
position: relative;
|
||||
top: 0px;
|
||||
}
|
||||
}
|
||||
.formRadioGroup.no-menu {
|
||||
@media (min-width: 991px) {
|
||||
position: relative;
|
||||
top: -33px;
|
||||
}
|
||||
}
|
||||
|
||||
.loading{
|
||||
display: flex;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div *ngIf="channels$ | async as response; else skeleton">
|
||||
<form [formGroup]="channelStatusForm" class="formRadioGroup float-right">
|
||||
<div *ngIf="channels$ | async as response; else skeleton" style="position: relative;">
|
||||
<form [formGroup]="channelStatusForm" class="formRadioGroup">
|
||||
<div class="btn-group btn-group-toggle" ngbRadioGroup name="radioBasic" formControlName="status">
|
||||
<label ngbButtonLabel class="btn-primary btn-sm">
|
||||
<input ngbButton type="radio" [value]="'open'" fragment="open" i18n="open">Open
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<table class="table table-borderless" *ngIf="response.channels.length > 0">
|
||||
<table class="table table-borderless" *ngIf="response.channels.length > 0" [style]="isLoading ? 'opacity: 0.75' : ''">
|
||||
<ng-container *ngTemplateOutlet="tableHeader"></ng-container>
|
||||
<tbody>
|
||||
<tr *ngFor="let channel of response.channels; let i = index;">
|
||||
|
||||
@@ -7,3 +7,20 @@
|
||||
font-size: 12px;
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
.formRadioGroup {
|
||||
@media (min-width: 435px) {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: -46px;
|
||||
}
|
||||
@media (max-width: 435px) {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-group {
|
||||
@media (max-width: 435px) {
|
||||
flex-grow: 1;
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import { LightningApiService } from '../lightning-api.service';
|
||||
export class ChannelsListComponent implements OnInit, OnChanges {
|
||||
@Input() publicKey: string;
|
||||
@Output() channelsStatusChangedEvent = new EventEmitter<string>();
|
||||
@Output() loadingEvent = new EventEmitter<boolean>(false);
|
||||
channels$: Observable<any>;
|
||||
|
||||
// @ts-ignore
|
||||
@@ -26,6 +27,7 @@ export class ChannelsListComponent implements OnInit, OnChanges {
|
||||
defaultStatus = 'open';
|
||||
status = 'open';
|
||||
publicKeySize = 25;
|
||||
isLoading = false;
|
||||
|
||||
constructor(
|
||||
private lightningApiService: LightningApiService,
|
||||
@@ -56,6 +58,8 @@ export class ChannelsListComponent implements OnInit, OnChanges {
|
||||
)
|
||||
.pipe(
|
||||
tap((val) => {
|
||||
this.isLoading = true;
|
||||
this.loadingEvent.emit(true);
|
||||
if (typeof val === 'string') {
|
||||
this.status = val;
|
||||
this.page = 1;
|
||||
@@ -64,10 +68,12 @@ export class ChannelsListComponent implements OnInit, OnChanges {
|
||||
}
|
||||
}),
|
||||
switchMap(() => {
|
||||
this.channelsStatusChangedEvent.emit(this.status);
|
||||
return this.lightningApiService.getChannelsByNodeId$(this.publicKey, (this.page - 1) * this.itemsPerPage, this.status);
|
||||
this.channelsStatusChangedEvent.emit(this.status);
|
||||
return this.lightningApiService.getChannelsByNodeId$(this.publicKey, (this.page - 1) * this.itemsPerPage, this.status);
|
||||
}),
|
||||
map((response) => {
|
||||
this.isLoading = false;
|
||||
this.loadingEvent.emit(false);
|
||||
return {
|
||||
channels: response.body,
|
||||
totalItems: parseInt(response.headers.get('x-total-count'), 10)
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
<app-node-channels style="display:block;margin-bottom: 40px" [publicKey]="node.public_key"></app-node-channels>
|
||||
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="d-flex">
|
||||
<h2 *ngIf="channelsListStatus === 'open'">
|
||||
<span i18n="lightning.open-channels">Open channels</span>
|
||||
<span> ({{ node.opened_channel_count }})</span>
|
||||
@@ -142,10 +142,13 @@
|
||||
<span i18n="lightning.open-channels">Closed channels</span>
|
||||
<span> ({{ node.closed_channel_count }})</span>
|
||||
</h2>
|
||||
<div *ngIf="channelListLoading" class="spinner-border ml-3" role="status"></div>
|
||||
</div>
|
||||
|
||||
<app-channels-list [publicKey]="node.public_key"
|
||||
(channelsStatusChangedEvent)="onChannelsListStatusChanged($event)"></app-channels-list>
|
||||
(channelsStatusChangedEvent)="onChannelsListStatusChanged($event)"
|
||||
(loadingEvent)="onLoadingEvent($event)"
|
||||
></app-channels-list>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -56,4 +56,17 @@ app-fiat {
|
||||
display: inline-block;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.spinner-border {
|
||||
@media (min-width: 768px) {
|
||||
margin-top: 6.5px;
|
||||
width: 1.75rem;
|
||||
height: 1.75rem;
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
margin-top: 2.3px;
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ export class NodeComponent implements OnInit {
|
||||
channelsListStatus: string;
|
||||
error: Error;
|
||||
publicKey: string;
|
||||
|
||||
channelListLoading = false;
|
||||
publicKeySize = 99;
|
||||
|
||||
constructor(
|
||||
@@ -97,4 +97,8 @@ export class NodeComponent implements OnInit {
|
||||
onChannelsListStatusChanged(e) {
|
||||
this.channelsListStatus = e;
|
||||
}
|
||||
|
||||
onLoadingEvent(e) {
|
||||
this.channelListLoading = e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,13 +44,13 @@ export class NodeChannels implements OnChanges {
|
||||
switchMap((response) => {
|
||||
this.isLoading = true;
|
||||
if ((response.body?.length ?? 0) <= 0) {
|
||||
return [];
|
||||
this.isLoading = false;
|
||||
return [''];
|
||||
}
|
||||
return [response.body];
|
||||
}),
|
||||
tap((body: any[]) => {
|
||||
if (body.length === 0) {
|
||||
this.isLoading = false;
|
||||
if (body.length === 0 || body[0].length === 0) {
|
||||
return;
|
||||
}
|
||||
const biggestCapacity = body[0].capacity;
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
flex-direction: column;
|
||||
@media (min-width: 991px) {
|
||||
position: relative;
|
||||
top: -65px;
|
||||
top: -100px;
|
||||
}
|
||||
@media (min-width: 830px) and (max-width: 991px) {
|
||||
position: relative;
|
||||
|
||||
@@ -300,7 +300,7 @@ export class NodesNetworksChartComponent implements OnInit {
|
||||
{ offset: 1, color: '#D81B60AA' },
|
||||
]),
|
||||
|
||||
smooth: true,
|
||||
smooth: false,
|
||||
},
|
||||
{
|
||||
zlevel: 1,
|
||||
@@ -321,7 +321,7 @@ export class NodesNetworksChartComponent implements OnInit {
|
||||
{ offset: 0, color: '#FFB300' },
|
||||
{ offset: 1, color: '#FFB300AA' },
|
||||
]),
|
||||
smooth: true,
|
||||
smooth: false,
|
||||
},
|
||||
{
|
||||
zlevel: 1,
|
||||
@@ -342,7 +342,7 @@ export class NodesNetworksChartComponent implements OnInit {
|
||||
{ offset: 0, color: '#7D4698' },
|
||||
{ offset: 1, color: '#7D4698AA' },
|
||||
]),
|
||||
smooth: true,
|
||||
smooth: false,
|
||||
},
|
||||
],
|
||||
dataZoom: this.widget ? null : [{
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
flex-direction: column;
|
||||
@media (min-width: 991px) {
|
||||
position: relative;
|
||||
top: -65px;
|
||||
top: -100px;
|
||||
}
|
||||
@media (min-width: 830px) and (max-width: 991px) {
|
||||
position: relative;
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
flex-direction: column;
|
||||
@media (min-width: 991px) {
|
||||
position: relative;
|
||||
top: -65px;
|
||||
top: -100px;
|
||||
}
|
||||
@media (min-width: 830px) and (max-width: 991px) {
|
||||
position: relative;
|
||||
|
||||
@@ -274,7 +274,7 @@ export class LightningStatisticsChartComponent implements OnInit {
|
||||
width: 1,
|
||||
},
|
||||
},
|
||||
smooth: true,
|
||||
smooth: false,
|
||||
},
|
||||
{
|
||||
zlevel: 0,
|
||||
@@ -288,7 +288,7 @@ export class LightningStatisticsChartComponent implements OnInit {
|
||||
opacity: 0.5,
|
||||
},
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
smooth: false,
|
||||
}
|
||||
],
|
||||
dataZoom: this.widget ? null : [{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<title>mempool - Bisq Markets</title>
|
||||
<base href="/">
|
||||
|
||||
<meta name="description" content="The Mempool Open Source Project™ - our self-hosted explorer for the Bisq Network.">
|
||||
<meta name="description" content="The Mempool Open Source Project™ - Explore the full Bitcoin ecosystem.">
|
||||
|
||||
<meta property="og:image" content="https://bisq.markets/resources/bisq/bisq-markets-preview.png" />
|
||||
<meta property="og:image:type" content="image/jpeg" />
|
||||
@@ -14,7 +14,7 @@
|
||||
<meta property="twitter:site" content="https://bisq.markets/">
|
||||
<meta property="twitter:creator" content="@bisq_network">
|
||||
<meta property="twitter:title" content="The Mempool Open Source Project™">
|
||||
<meta property="twitter:description" content="Our self-hosted markets explorer for the Bisq community.">
|
||||
<meta property="twitter:description" content="Explore the full Bitcoin ecosystem with mempool.space™" />
|
||||
<meta property="twitter:image:src" content="https://bisq.markets/resources/bisq/bisq-markets-preview.png" />
|
||||
<meta property="twitter:domain" content="bisq.markets">
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<title>mempool - Liquid Network</title>
|
||||
<base href="/">
|
||||
|
||||
<meta name="description" content="The Mempool Open Source Project™ - our self-hosted explorer for the Liquid Network.">
|
||||
<meta name="description" content="The Mempool Open Source Project™ - Explore the full Bitcoin ecosystem.">
|
||||
<meta property="og:image" content="https://liquid.network/resources/liquid/liquid-network-preview.png" />
|
||||
<meta property="og:image:type" content="image/png" />
|
||||
<meta property="og:image:width" content="1000" />
|
||||
@@ -14,7 +14,7 @@
|
||||
<meta property="twitter:site" content="@mempool">
|
||||
<meta property="twitter:creator" content="@mempool">
|
||||
<meta property="twitter:title" content="The Mempool Open Source Project™">
|
||||
<meta property="twitter:description" content="Our self-hosted network explorer for the Liquid community.">
|
||||
<meta property="twitter:description" content="Explore the full Bitcoin ecosystem with mempool.space™" />
|
||||
<meta property="twitter:image:src" content="https://liquid.network/resources/liquid/liquid-network-preview.png" />
|
||||
<meta property="twitter:domain" content="liquid.network">
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<title>mempool - Bitcoin Explorer</title>
|
||||
<base href="/">
|
||||
|
||||
<meta name="description" content="The Mempool Open Source Project™ - our self-hosted explorer for the Bitcoin community." />
|
||||
<meta name="description" content="The Mempool Open Source Project™ - Explore the full Bitcoin ecosystem." />
|
||||
<meta property="og:image" content="https://mempool.space/resources/mempool-space-preview.png" />
|
||||
<meta property="og:image:type" content="image/png" />
|
||||
<meta property="og:image:width" content="1000" />
|
||||
@@ -14,7 +14,7 @@
|
||||
<meta property="twitter:site" content="@mempool">
|
||||
<meta property="twitter:creator" content="@mempool">
|
||||
<meta property="twitter:title" content="The Mempool Open Source Project™">
|
||||
<meta property="twitter:description" content="Our self-hosted mempool explorer for the Bitcoin community." />
|
||||
<meta property="twitter:description" content="Explore the full Bitcoin ecosystem with mempool.space™" />
|
||||
<meta property="twitter:image:src" content="https://mempool.space/resources/mempool-space-preview.png" />
|
||||
<meta property="twitter:domain" content="mempool.space">
|
||||
|
||||
|
||||
@@ -705,6 +705,10 @@ th {
|
||||
.locktime { color: #ff8c00 }
|
||||
.reserved { color: #ff8c00 }
|
||||
|
||||
.shortable-address {
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.rtl-layout {
|
||||
|
||||
.navbar-brand {
|
||||
@@ -881,6 +885,7 @@ th {
|
||||
|
||||
.shortable-address {
|
||||
direction: ltr;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.lastest-blocks-table {
|
||||
|
||||
Reference in New Issue
Block a user