feat: 更新 CodexLens 工作区状态 API,支持通过查询参数指定项目路径

This commit is contained in:
catlog22
2026-01-12 21:00:50 +08:00
parent 76e1f855f1
commit 5282551277
2 changed files with 7 additions and 4 deletions

View File

@@ -106,7 +106,7 @@ async function preloadCodexLensData() {
!isCacheValid('rerankerConfig') ? fetch('/api/codexlens/reranker/config').then(r => r.json()).then(d => setCacheData('rerankerConfig', d)) : Promise.resolve(),
!isCacheValid('rerankerModels') ? fetch('/api/codexlens/reranker/models').then(r => r.json()).then(d => setCacheData('rerankerModels', d)).catch(() => null) : Promise.resolve(),
// Workspace status
!isCacheValid('workspaceStatus') ? fetch('/api/codexlens/workspace-status').then(r => r.json()).then(d => setCacheData('workspaceStatus', d)).catch(() => null) : Promise.resolve(),
!isCacheValid('workspaceStatus') ? fetch('/api/codexlens/workspace-status?path=' + encodeURIComponent(projectPath || '')).then(r => r.json()).then(d => setCacheData('workspaceStatus', d)).catch(() => null) : Promise.resolve(),
// Semantic status (for FastEmbed detection)
!isCacheValid('semanticStatus') ? fetch('/api/codexlens/semantic/status').then(r => r.json()).then(d => setCacheData('semanticStatus', d)).catch(() => null) : Promise.resolve(),
// Environment variables
@@ -172,7 +172,7 @@ async function refreshWorkspaceIndexStatus(forceRefresh) {
}
try {
var response = await fetch('/api/codexlens/workspace-status');
var response = await fetch('/api/codexlens/workspace-status?path=' + encodeURIComponent(projectPath || ''));
var result = await response.json();
// Cache the result