mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-03 00:17:47 +00:00
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:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user