cleanup api model defs

This commit is contained in:
Vladimir Mandic
2024-01-28 10:25:26 -05:00
parent 1ed97c7d89
commit b79d8ea6c3
9 changed files with 38 additions and 44 deletions
+4 -2
View File
@@ -29,8 +29,10 @@ async function setupControlUI() {
const intersectionObserver = new IntersectionObserver((entries) => {
if (entries[0].intersectionRatio > 0) {
const tab = gradioApp().querySelector('#control-tabs > .tab-nav > .selected')?.innerText.toLowerCase() || ''; // selected tab name
const btn = gradioApp().getElementById(`refresh_${tab}_models`);
if (btn) btn.click();
for (let i = 0; i < 10; i += 1) {
const btn = gradioApp().getElementById(`refresh_${tab}_models_${i}`);
if (btn) btn.click();
}
}
});
intersectionObserver.observe(el); // monitor visibility of tab