feat(ui): add absolute path copy for error logs

- add absolutePath field to CliproxyErrorLog interface
- inject absolute path in routes.ts from getCliproxyWritablePath()
- update copy button to use absolute path with fallback to filename
- refactor error-logs-monitor to remove demo mode
- add error-log-parser lib for structured log parsing
This commit is contained in:
kaitranntt
2025-12-18 21:06:20 -05:00
parent 78a14e873d
commit 5d4f49e4bb
6 changed files with 850 additions and 235 deletions
+9 -1
View File
@@ -25,6 +25,7 @@ import {
fetchCliproxyErrorLogs,
fetchCliproxyErrorLogContent,
} from '../cliproxy/stats-fetcher';
import { getCliproxyWritablePath } from '../cliproxy/config-generator';
import {
listOpenAICompatProviders,
getOpenAICompatProvider,
@@ -1446,7 +1447,14 @@ apiRoutes.get('/cliproxy/error-logs', async (_req: Request, res: Response): Prom
return;
}
res.json({ files });
// Inject absolute paths into each file entry
const logsDir = path.join(getCliproxyWritablePath(), 'logs');
const filesWithPaths = files.map((file) => ({
...file,
absolutePath: path.join(logsDir, file.name),
}));
res.json({ files: filesWithPaths });
} catch (error) {
res.status(500).json({ error: (error as Error).message });
}