diff --git a/frontend/httpd.conf b/frontend/httpd.conf index 5cd1d4b0a8..425d969b69 100644 --- a/frontend/httpd.conf +++ b/frontend/httpd.conf @@ -230,9 +230,23 @@ SSLProxyEngine On # Cache rules - - Header set Cache-Control "public, max-age=31536000, immutable" - + +# Add cache for web node files +; +; Header set Cache-Control "public, max-age=31536000, immutable" +; + +# REMOVE CACHE + + FileETag None + + Header unset ETag + Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" + Header set Pragma "no-cache" + Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT" + + + # Make sure mod_headers is enabled diff --git a/frontend/src/app/core/services/web-node.service.ts b/frontend/src/app/core/services/web-node.service.ts index 2457c01638..b2da5fc31c 100644 --- a/frontend/src/app/core/services/web-node.service.ts +++ b/frontend/src/app/core/services/web-node.service.ts @@ -101,7 +101,7 @@ export class WebNodeService { // } if (!this.sentryEvents.firstPeerConnected && peers.some((p: any) => p.connection_status === DashboardPeerStatus.CONNECTED)) { const seconds = (Date.now() - this.webNodeStartTime) / 1000; - sendSentryEvent(`WebNode connected in ${seconds.toFixed(1)}s`); + sendSentryEvent(`WebNode connected in ${seconds.toFixed(1)}s`, 'info'); this.sentryEvents.firstPeerConnected = true; this.webnodeProgress$.next('Connected'); } diff --git a/frontend/src/app/features/webnode/web-node-initialization/web-node-initialization.component.ts b/frontend/src/app/features/webnode/web-node-initialization/web-node-initialization.component.ts index f926e3e6ef..cc65d098fd 100644 --- a/frontend/src/app/features/webnode/web-node-initialization/web-node-initialization.component.ts +++ b/frontend/src/app/features/webnode/web-node-initialization/web-node-initialization.component.ts @@ -105,14 +105,14 @@ export class WebNodeInitializationComponent extends StoreDispatcher implements O this.loading[1].status = WebNodeStepStatus.LOADING; this.advanceProgressFor2ndStep(); } else if (state === 'Started') { - this.updateLoadingMessage('~2 seconds left'); + this.updateLoadingMessage('~3 seconds left'); setTimeout(() => { if (!this.hasError && this.loading[2].status !== WebNodeStepStatus.DONE) { this.updateLoadingMessage('Slower than usual'); this.hasWarn = true; this.detect(); } - }, 2000); + }, 3500); clearInterval(this.secondStepInterval); this.loading[0].loaded = true; this.loading[1].loaded = true; diff --git a/frontend/src/app/features/webnode/web-node-not-supported/web-node-not-supported.component.html b/frontend/src/app/features/webnode/web-node-not-supported/web-node-not-supported.component.html index 4dca3c9465..7fa84854eb 100644 --- a/frontend/src/app/features/webnode/web-node-not-supported/web-node-not-supported.component.html +++ b/frontend/src/app/features/webnode/web-node-not-supported/web-node-not-supported.component.html @@ -14,21 +14,21 @@
Switch to one of the following platforms
- + Windows
- + Android
- + MacOS
-
And use Chrome, Edge or Safari
+
And use Chrome, Edge, Safari or Brave
} @else {
@@ -36,25 +36,32 @@
Your browser isn't supported
To run a Mina node in your browser,
-
we recommend Chrome or similar.
+
we recommend one of the following.
- + Chrome
- + Safari
- + Edge
} +@if (devMode) { +
You entered Dev mode!
+
+ + +
+} diff --git a/frontend/src/app/features/webnode/web-node-not-supported/web-node-not-supported.component.ts b/frontend/src/app/features/webnode/web-node-not-supported/web-node-not-supported.component.ts index 905b24bd30..df65c4988e 100644 --- a/frontend/src/app/features/webnode/web-node-not-supported/web-node-not-supported.component.ts +++ b/frontend/src/app/features/webnode/web-node-not-supported/web-node-not-supported.component.ts @@ -1,4 +1,8 @@ -import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { Platform } from '@angular/cdk/platform'; +import { sendSentryEvent } from '@shared/helpers/webnode.helper'; + +const code = [1, 2, 3, 2]; @Component({ selector: 'mina-web-node-not-supported', @@ -10,5 +14,31 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; host: { class: 'h-100 flex-column align-center' }, }) export class WebNodeNotSupportedComponent { + @Input() isPhone!: boolean; + + @Output() bypassUnsupportedDevice = new EventEmitter(); + + devMode: boolean = false; + private codeVerifier: number[] = []; + + constructor(private platform: Platform) {} + + addDevKey(key: number): void { + this.codeVerifier.push(key); + if (this.codeVerifier.length === code.length) { + if (this.codeVerifier.every((v, i) => v === code[i])) { + this.devMode = true; + } else { + this.codeVerifier = []; + } + } + } + + c_hcK1_V_a_l_id(input: HTMLInputElement): void { + if (input.value === 'allowme') { + sendSentryEvent('A developer is testing the app on ' + this.platform, 'debug'); + this.bypassUnsupportedDevice.emit(); + } + } } diff --git a/frontend/src/app/features/webnode/webnode.component.html b/frontend/src/app/features/webnode/webnode.component.html index d01339f4b8..71207172ed 100644 --- a/frontend/src/app/features/webnode/webnode.component.html +++ b/frontend/src/app/features/webnode/webnode.component.html @@ -1,5 +1,5 @@ @if (supported) { } @else { - + } diff --git a/frontend/src/app/shared/helpers/webnode.helper.ts b/frontend/src/app/shared/helpers/webnode.helper.ts index 60d49ed541..7a223fb132 100644 --- a/frontend/src/app/shared/helpers/webnode.helper.ts +++ b/frontend/src/app/shared/helpers/webnode.helper.ts @@ -1,5 +1,6 @@ import * as Sentry from '@sentry/angular'; +import { SeverityLevel } from '@sentry/angular'; -export function sendSentryEvent(message: string): void { - Sentry.captureEvent({ message: message, tags: { type: 'webnode' } }); +export function sendSentryEvent(message: string, level: SeverityLevel = 'error'): void { + Sentry.captureEvent({ message: message, level, tags: { type: 'webnode' } }); }