mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-05-14 17:55:08 +00:00
fix: theme.json goes next to config.json, log location on startup
- Search order: app dir first (next to config.json), then data/ dir - Startup log: '[theme] Loaded from ...' or 'No theme.json found. Place it next to config.json' - README updated: 'put it next to config.json' instead of confusing data/ path
This commit is contained in:
@@ -139,7 +139,7 @@ docker run -d \
|
||||
# Now edit ./data/config.json directly on the host
|
||||
```
|
||||
|
||||
**Theme customization:** Drop a `theme.json` in the same data directory (`/app/data/theme.json`) to override default colors, branding, and node/packet type colors for all users. Use the built-in customizer (Tools → Customize) to design your theme and download the file.
|
||||
**Theme customization:** Put `theme.json` next to `config.json` — wherever your config lives, that's where the theme goes. Use the built-in customizer (Tools → Customize) to design your theme, download the file, and drop it in. Changes are picked up on page refresh — no restart needed. The server logs where it's looking on startup.
|
||||
|
||||
### Manual Install
|
||||
|
||||
|
||||
@@ -394,10 +394,10 @@ function getObserverIdsForRegions(regionParam) {
|
||||
return ids;
|
||||
}
|
||||
|
||||
// Theme: hot-load from theme.json (checks data dir first, then app dir)
|
||||
// Theme: hot-load from theme.json (same dir as config.json, or data/ dir)
|
||||
const THEME_PATHS = [
|
||||
path.join(__dirname, 'data', 'theme.json'),
|
||||
path.join(__dirname, 'theme.json')
|
||||
path.join(__dirname, 'theme.json'),
|
||||
path.join(__dirname, 'data', 'theme.json')
|
||||
];
|
||||
function loadThemeFile() {
|
||||
for (const p of THEME_PATHS) {
|
||||
@@ -3039,6 +3039,12 @@ const listenPort = process.env.PORT || config.port;
|
||||
server.listen(listenPort, () => {
|
||||
const protocol = isHttps ? 'https' : 'http';
|
||||
console.log(`MeshCore Analyzer running on ${protocol}://localhost:${listenPort}`);
|
||||
// Log theme file location
|
||||
let themeFound = false;
|
||||
for (const p of THEME_PATHS) {
|
||||
try { fs.accessSync(p); console.log(`[theme] Loaded from ${p}`); themeFound = true; break; } catch {}
|
||||
}
|
||||
if (!themeFound) console.log(`[theme] No theme.json found. Place it next to config.json or in data/ to customize.`);
|
||||
// Pre-warm expensive caches via self-requests (yields event loop between each)
|
||||
setTimeout(() => {
|
||||
const port = listenPort;
|
||||
|
||||
Reference in New Issue
Block a user