()
| 45 | bar.appendChild(progressBar); |
| 46 | |
| 47 | const refresh = async () => { |
| 48 | const status = await localAI.getBinaryStatus(); |
| 49 | const text = bar.querySelector('#binary-status-text'); |
| 50 | if (status.exists) { |
| 51 | text.textContent = t('localModels.installed'); |
| 52 | text.className = 'text-[11px] text-green-400'; |
| 53 | btn.classList.add('hidden'); |
| 54 | } else { |
| 55 | text.textContent = t('localModels.notInstalled'); |
| 56 | text.className = 'text-[11px] text-yellow-400'; |
| 57 | btn.textContent = t('localModels.installEngine'); |
| 58 | btn.className = 'px-3 py-1.5 rounded-lg text-xs font-bold bg-primary text-black transition-all'; |
| 59 | btn.classList.remove('hidden'); |
| 60 | } |
| 61 | if (onStatusChange) onStatusChange(status.exists); |
| 62 | }; |
| 63 | |
| 64 | btn.onclick = async () => { |
| 65 | btn.disabled = true; |
no test coverage detected