Self-hosted AI workspace.
Python
Add cookbook empty scan buttons
pewdiepie-archdaemon6d78f6f7f7e2
diff --git a/static/js/cookbook-hwfit.js b/static/js/cookbook-hwfit.jsindex e22b75b74..7fab5570c 100644--- a/static/js/cookbook-hwfit.js+++ b/static/js/cookbook-hwfit.js@@ -592,7 +592,11 @@ export async function _hwfitFetch(fresh = false, opts = {}) {if (!allowNetwork) {_hwfitCache = null;_hwfitRenderHw(hw, null);- list.innerHTML = '<div class="hwfit-loading" style="flex-direction:column;gap:6px;text-align:center;"><div>No cached scan yet</div><div style="font-size:11px;opacity:0.55;max-width:420px;line-height:1.4;">Press Scan to test hardware and rank models for this server.</div></div>';+ list.innerHTML = '<div class="hwfit-loading" style="flex-direction:column;gap:8px;text-align:center;"><div>No cached scan yet</div><div style="font-size:11px;opacity:0.55;max-width:420px;line-height:1.4;">Test hardware and rank models for this server.</div><button type="button" class="hwfit-gpu-btn hwfit-empty-scan-btn" style="height:26px;padding:3px 10px;">Scan</button></div>';+ list.querySelector('.hwfit-empty-scan-btn')?.addEventListener('click', () => {+ _resetGpuToggleState();+ _hwfitFetch(true);+ });try { wp.destroy(); } catch {}return;}diff --git a/static/js/cookbookServe.js b/static/js/cookbookServe.jsindex 98af9d0e2..deb6ea7a5 100644--- a/static/js/cookbookServe.js+++ b/static/js/cookbookServe.js@@ -3743,7 +3743,10 @@ export async function _fetchCachedModels(fresh = false, opts = {}) {}if (!allowNetwork) {_dlWp.destroy();- list.innerHTML = '<div class="hwfit-loading" style="flex-direction:column;gap:6px;text-align:center;"><div>No cached model scan yet</div><div style="font-size:11px;opacity:0.55;max-width:420px;line-height:1.4;">Press Scan to check this server\'s model cache.</div></div>';+ list.innerHTML = '<div class="hwfit-loading" style="flex-direction:column;gap:8px;text-align:center;"><div>No cached model scan yet</div><div style="font-size:11px;opacity:0.55;max-width:420px;line-height:1.4;">Check this server\'s model cache.</div><button type="button" class="hwfit-gpu-btn serve-empty-scan-btn" style="height:26px;padding:3px 10px;">Scan</button></div>';+ list.querySelector('.serve-empty-scan-btn')?.addEventListener('click', () => {+ _fetchCachedModels(true);+ });const tagContainer = document.getElementById('serve-tags');if (tagContainer) tagContainer.innerHTML = '';return;