mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-21 12:11:28 -07:00
feat(stats): add stats server, API endpoints, config, and Anki integration
- Hono HTTP server with 20+ REST endpoints for stats data - Stats overlay BrowserWindow with toggle keybinding - IPC channel definitions and preload bridge - Stats config section (toggleKey, serverPort, autoStartServer, autoOpenBrowser) - Config resolver for stats section - AnkiConnect proxy endpoints (guiBrowse, notesInfo) - Note ID passthrough in card mining callback chain - Stats CLI command with autoOpenBrowser respect
This commit is contained in:
33
src/config/definitions/options-stats.ts
Normal file
33
src/config/definitions/options-stats.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { ResolvedConfig } from '../../types.js';
|
||||
import { ConfigOptionRegistryEntry } from './shared.js';
|
||||
|
||||
export function buildStatsConfigOptionRegistry(
|
||||
defaultConfig: ResolvedConfig,
|
||||
): ConfigOptionRegistryEntry[] {
|
||||
return [
|
||||
{
|
||||
path: 'stats.toggleKey',
|
||||
kind: 'string',
|
||||
defaultValue: defaultConfig.stats.toggleKey,
|
||||
description: 'Key code to toggle the stats overlay.',
|
||||
},
|
||||
{
|
||||
path: 'stats.serverPort',
|
||||
kind: 'number',
|
||||
defaultValue: defaultConfig.stats.serverPort,
|
||||
description: 'Port for the stats HTTP server.',
|
||||
},
|
||||
{
|
||||
path: 'stats.autoStartServer',
|
||||
kind: 'boolean',
|
||||
defaultValue: defaultConfig.stats.autoStartServer,
|
||||
description: 'Automatically start the stats server on launch.',
|
||||
},
|
||||
{
|
||||
path: 'stats.autoOpenBrowser',
|
||||
kind: 'boolean',
|
||||
defaultValue: defaultConfig.stats.autoOpenBrowser,
|
||||
description: 'Automatically open the stats dashboard in a browser when the server starts.',
|
||||
},
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user