Gnomon Control & Live Status
1. Gnomon Process Control
- Implemented start/stop buttons in the Gnomon manager page (
gnomon.js) that now successfully launch and terminate thegnomonindexerprocess. - Fixed the renderer ↔ main communication using
ipcRenderer.invokeandipcMain.handleforgnomon:startandgnomon:stop. - Ensured persistent state of Gnomon with a
gnomonRunningflag to track whether it’s active.
2. Gnomon Status Checking
- Added
check-gnomonhandler to verify if Gnomon’s API is responsive (via HTTP request to127.0.0.1:8099). - Added
gnomon:get-infoto fetch detailed information from Gnomon’s/api/getinfo. - Updated the Gnomon manager UI to reflect running/stopped status with a yellow/green/red LED indicator.
3. Live Logs
- Wired up
gnomon-logevents to stream stdout/stderr from the Gnomon process to the renderer. - Ensured logs are displayable in real-time, though some display issues remain in the UI.
4. Start Page (start.html) Integration
- Explored auto-refresh / live updates when Gnomon starts.
- Integrated SCID fetching via the Gnomon API (
/indexedscsand/scvarsbyheight). - Not fully functional yet: SCIDs don’t update live when Gnomon starts or indexes new entries.
5. App Lifecycle & Cleanup
-
Implemented graceful shutdown of Gnomon when the app closes:
- Listens for
before-quit,window-all-closed,SIGINT,SIGTERM. - Sends
SIGINTto Gnomon and waits for exit. - Fallback timeout to
SIGKILLin case it hangs.
- Listens for
-
Prevents orphaned Gnomon processes.
6. Debugging & Renderer Safety
- Added checks in the renderer (
gnomon.js) to ensureelectronAPIis available. - Allowed logs and state updates even if Gnomon crashes or is stopped manually.