MCPcopy
hub / github.com/Anil-matcha/Open-Generative-AI / refresh

Function refresh

src/components/LocalModelManager.js:47–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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;

Callers 1

BinaryStatusBarFunction · 0.85

Calls 2

tFunction · 0.90
getBinaryStatusMethod · 0.80

Tested by

no test coverage detected