feat: Refactor embedding pool sidebar rendering and always load semantic dependencies status

This commit is contained in:
catlog22
2025-12-25 17:36:11 +08:00
parent 0515ef6e8b
commit a8cf3e1ad6
2 changed files with 147 additions and 77 deletions

View File

@@ -1947,16 +1947,9 @@ async function renderCodexLensManager() {
// Wait for LiteLLM config before loading semantic deps (it may need provider info)
await litellmPromise;
// Load semantic deps status (skip if we already have it from dashboard-init)
if (!dashboardData?.semantic) {
loadSemanticDepsStatus();
} else {
// Use cached semantic status from dashboard-init
var semanticContainer = document.getElementById('semanticDepsStatus');
if (semanticContainer && dashboardData.semantic) {
updateSemanticDepsUI(semanticContainer, dashboardData.semantic);
}
}
// Always load semantic deps status - it needs GPU detection and device list
// which are not included in the aggregated endpoint
loadSemanticDepsStatus();
loadModelList();
@@ -1970,20 +1963,6 @@ async function renderCodexLensManager() {
}
}
/**
* Update semantic deps UI from cached data
*/
function updateSemanticDepsUI(container, semanticData) {
if (!container) return;
if (semanticData.available) {
container.innerHTML = '<div class="flex items-center gap-2 text-success"><i data-lucide="check-circle" class="w-4 h-4"></i><span>' + (semanticData.backend || 'Ready') + '</span></div>';
} else {
container.innerHTML = '<div class="flex items-center gap-2 text-muted-foreground"><i data-lucide="circle-dashed" class="w-4 h-4"></i><span>' + t('codexlens.notInstalled') + '</span></div>';
}
if (window.lucide) lucide.createIcons();
}
/**
* Build CodexLens Manager page content
*/