diff --git a/internal/gateway/ui/index.html b/internal/gateway/ui/index.html index aa76e9a..c7915cc 100644 --- a/internal/gateway/ui/index.html +++ b/internal/gateway/ui/index.html @@ -691,13 +691,22 @@ async function renderStatus() { const s = await api('/api/status'); const base = window._base = s.base_url || location.origin + '/v1'; const key = window._key = (s.gateway_keys && s.gateway_keys[0]) || ''; + // If the status page is already built, don't rebuild the whole DOM (tab + // switches would stutter); just refresh the live data via paintStats. + const pane = $('#tab-status'); + if (pane && pane.dataset.built) { + if (statsTimerId) clearInterval(statsTimerId); + await paintStats(); + statsTimerId = setInterval(paintStats, 3000); + return; + } const srcRows = s.sources ? s.sources.map(x => `${x.live_available ? `${t('online')}` : `${t('offline')}`} ${esc(x.name)}${esc(x.adapter)}
${x.models.map(m => `${esc(m)}`).join('')}
${esc(x.base_url || '')} ${x.max_concurrent}`).join('') : ''; - $('#tab-status').innerHTML = ` + pane.innerHTML = `

${t('connTitle')}

@@ -727,6 +736,7 @@ async function renderStatus() {
${s.adapters.map(a => ``).join('')}
${t('tName')}${t('tVersion')}
${esc(a.name)}${esc(a.version || '')}
` : ''}`; + pane.dataset.built = '1'; $('#conncfg').textContent = ''; showModelConfig(null, ''); $('#model-chips').innerHTML = s.models.map(m => `${esc(m)}`).join('');