Add customizable enterprise build

This commit is contained in:
Mononaut
2024-04-25 20:18:37 +00:00
parent fd8df2a035
commit ac0f56325b
7 changed files with 68 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ export class EnterpriseService {
private stateService: StateService,
private activatedRoute: ActivatedRoute,
) {
const subdomain = this.document.location.hostname.indexOf(this.exclusiveHostName) > -1
const subdomain = this.stateService.env.customize.enterprise || this.document.location.hostname.indexOf(this.exclusiveHostName) > -1
&& this.document.location.hostname.split(this.exclusiveHostName)[0] || false;
if (subdomain && subdomain.match(/^[A-z0-9-_]+$/)) {
this.subdomain = subdomain;

View File

@@ -20,6 +20,17 @@ export interface MarkBlockState {
export interface ILoadingIndicators { [name: string]: number; }
export interface Customization {
theme: string;
enterprise?: string;
dashboard: {
widgets: {
component: string;
props: { [key: string]: any };
}[];
};
}
export interface Env {
TESTNET_ENABLED: boolean;
SIGNET_ENABLED: boolean;
@@ -50,6 +61,7 @@ export interface Env {
ADDITIONAL_CURRENCIES: boolean;
GIT_COMMIT_HASH_MEMPOOL_SPACE?: string;
PACKAGE_JSON_VERSION_MEMPOOL_SPACE?: string;
customize?: Customization;
}
const defaultEnv: Env = {

View File

@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';
import { defaultMempoolFeeColors, contrastMempoolFeeColors } from '../app.constants';
import { StorageService } from './storage.service';
import { StateService } from './state.service';
@Injectable({
providedIn: 'root'
@@ -14,8 +15,9 @@ export class ThemeService {
constructor(
private storageService: StorageService,
private stateService: StateService,
) {
const theme = this.storageService.getValue('theme-preference') || 'default';
const theme = this.storageService.getValue('theme-preference') || this.stateService.env.customize?.theme || 'default';
this.apply(theme);
}

View File

@@ -5,6 +5,7 @@
<meta charset="utf-8">
<title>mempool - Bitcoin Explorer</title>
<script src="/resources/config.js"></script>
<script src="/resources/customize.js"></script>
<base href="/">
<meta name="description" content="Explore the full Bitcoin ecosystem with The Mempool Open Source Project®. See the real-time status of your transactions, get network info, and more." />