From 752156281fbdebbc5dfea991270ba5df4ee575a4 Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Tue, 7 Jun 2022 23:27:35 -0400 Subject: [PATCH] Show rate limiting note on official instances only Also fix some styling flaws resulting from hiding the rate limiting text. --- frontend/src/app/docs/api-docs/api-docs.component.html | 4 ++-- frontend/src/app/docs/api-docs/api-docs.component.scss | 8 ++++++-- frontend/src/app/docs/api-docs/api-docs.component.ts | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/docs/api-docs/api-docs.component.html b/frontend/src/app/docs/api-docs/api-docs.component.html index 42de7dfef..f73de31c7 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.html +++ b/frontend/src/app/docs/api-docs/api-docs.component.html @@ -34,8 +34,8 @@
-

Below is a reference for the {{ network.val === '' ? 'Bitcoin' : network.val.charAt(0).toUpperCase() + network.val.slice(1) }} REST API service.

-

Note that we enforce rate limits. If you exceed these limits, you will get a polite error encouraging you to run your own Mempool instance. If you repeatedly exceed the limits, you may be banned from accessing the service altogether.

+

Below is a reference for the {{ network.val === '' ? 'Bitcoin' : network.val.charAt(0).toUpperCase() + network.val.slice(1) }} REST API service.

+

Note that we enforce rate limits. If you exceed these limits, you will get a polite error encouraging you to run your own Mempool instance. If you repeatedly exceed the limits, you may be banned from accessing the service altogether.

{{ item.title }}

diff --git a/frontend/src/app/docs/api-docs/api-docs.component.scss b/frontend/src/app/docs/api-docs/api-docs.component.scss index 1729a7dbd..456983657 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.scss +++ b/frontend/src/app/docs/api-docs/api-docs.component.scss @@ -22,10 +22,14 @@ li.nav-item { } } -.no-bottom-space { +.doc-welcome-note { margin-bottom: 0; } +.api-note { + margin-top: 1rem; +} + .nav-tabs .nav-link.active { border-bottom: 1px solid #fff; @media (min-width: 676px){ @@ -242,7 +246,7 @@ h3 { transition: 0.5s opacity ease; } - .api-note { + .doc-welcome-note { font-size: 0.85rem; } } diff --git a/frontend/src/app/docs/api-docs/api-docs.component.ts b/frontend/src/app/docs/api-docs/api-docs.component.ts index 0041fa8cd..94eccd4e2 100644 --- a/frontend/src/app/docs/api-docs/api-docs.component.ts +++ b/frontend/src/app/docs/api-docs/api-docs.component.ts @@ -23,6 +23,7 @@ export class ApiDocsComponent implements OnInit { restDocs: any[]; wsDocs: any; screenWidth: number; + officialMempoolInstance: boolean; constructor( private stateService: StateService, @@ -43,6 +44,7 @@ export class ApiDocsComponent implements OnInit { ngOnInit(): void { this.env = this.stateService.env; + this.officialMempoolInstance = this.env.OFFICIAL_MEMPOOL_SPACE; this.network$ = merge(of(''), this.stateService.networkChanged$).pipe( tap((network: string) => { if (this.env.BASE_MODULE === 'mempool' && network !== '') {