mirror of
https://github.com/lklynet/hypermind.git
synced 2026-05-03 09:30:36 +00:00
add ENABLE_THEMES .env var
This commit is contained in:
@@ -10,6 +10,7 @@ services:
|
||||
# --- Add-ons ---
|
||||
# - ENABLE_CHAT=false # Enable decentralized chat
|
||||
# - ENABLE_MAP=false # Enable peer map visualization
|
||||
# - ENABLE_THEMES=true # Enable theme switcher button
|
||||
|
||||
# --- Refinements ---
|
||||
# - MAX_PEERS=50000 # Max peers to track in memory
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button id="theme-switcher" class="theme-btn" title="Cycle Themes">
|
||||
<button id="theme-switcher" class="theme-btn {{THEMES_CLASS}}" title="Cycle Themes">
|
||||
<span class="material-symbols-outlined">palette</span>
|
||||
</button>
|
||||
<div id="terminal" class="terminal hidden">
|
||||
|
||||
@@ -29,6 +29,7 @@ const DIAGNOSTICS_INTERVAL = 10000;
|
||||
const PORT = process.env.PORT || 3000;
|
||||
const ENABLE_CHAT = process.env.ENABLE_CHAT === "true";
|
||||
const ENABLE_MAP = process.env.ENABLE_MAP === 'true';
|
||||
const ENABLE_THEMES = process.env.ENABLE_THEMES !== "false";
|
||||
const CHAT_RATE_LIMIT = parseInt(process.env.CHAT_RATE_LIMIT) || 5000;
|
||||
const VISUAL_LIMIT = parseInt(process.env.VISUAL_LIMIT) || 500;
|
||||
|
||||
@@ -49,6 +50,7 @@ module.exports = {
|
||||
PORT,
|
||||
ENABLE_CHAT,
|
||||
ENABLE_MAP,
|
||||
ENABLE_THEMES,
|
||||
CHAT_RATE_LIMIT,
|
||||
VISUAL_LIMIT,
|
||||
};
|
||||
|
||||
+2
-1
@@ -3,7 +3,7 @@ const fs = require("fs");
|
||||
const path = require("path");
|
||||
const crypto = require("crypto");
|
||||
const { signMessage } = require("../core/security");
|
||||
const { ENABLE_CHAT, ENABLE_MAP, CHAT_RATE_LIMIT, VISUAL_LIMIT } = require("../config/constants");
|
||||
const { ENABLE_CHAT, ENABLE_MAP, ENABLE_THEMES, CHAT_RATE_LIMIT, VISUAL_LIMIT } = require("../config/constants");
|
||||
|
||||
const HTML_TEMPLATE = fs.readFileSync(
|
||||
path.join(__dirname, "../../public/index.html"),
|
||||
@@ -22,6 +22,7 @@ const setupRoutes = (app, identity, peerManager, swarm, sseManager, diagnostics)
|
||||
.replace(/\{\{ID\}\}/g, "..." + identity.id.slice(-8))
|
||||
.replace(/\{\{DIRECT\}\}/g, directPeers)
|
||||
.replace(/\{\{MAP_CLASS\}\}/g, ENABLE_MAP ? '' : 'hidden')
|
||||
.replace(/\{\{THEMES_CLASS\}\}/g, ENABLE_THEMES ? '' : 'hidden')
|
||||
.replace(/\{\{VISUAL_LIMIT\}\}/g, VISUAL_LIMIT);
|
||||
|
||||
res.send(html);
|
||||
|
||||
Reference in New Issue
Block a user