Eric Xu commited on
Hide badges until loaded — no more 'checking...' on first paint
Browse files- web/static/index.html +12 -11
web/static/index.html
CHANGED
|
@@ -314,8 +314,8 @@
|
|
| 314 |
<header>
|
| 315 |
<h1>Semantic Gradient Optimization</h1>
|
| 316 |
<p>Build a panel. See what they think. Test what to change next.</p>
|
| 317 |
-
<div id="configBadge" class="config-badge">
|
| 318 |
-
<div id="nemotronBadge" class="config-badge" style="margin-left:8px">
|
| 319 |
</header>
|
| 320 |
|
| 321 |
<!-- API Key setup (shown if no key configured) -->
|
|
@@ -760,28 +760,29 @@ async function init() {
|
|
| 760 |
if (cfg.has_api_key) {
|
| 761 |
badge.textContent = cfg.model;
|
| 762 |
badge.className = 'config-badge ok';
|
|
|
|
| 763 |
} else if (!cfg.is_spaces) {
|
| 764 |
badge.textContent = 'No API key';
|
| 765 |
badge.className = 'config-badge warn';
|
|
|
|
| 766 |
document.getElementById('apiKeySetup').classList.remove('hidden');
|
| 767 |
-
} else {
|
| 768 |
-
badge.textContent = 'No API key configured';
|
| 769 |
-
badge.className = 'config-badge warn';
|
| 770 |
}
|
| 771 |
|
| 772 |
const nemBadge = document.getElementById('nemotronBadge');
|
| 773 |
if (cfg.nemotron_available) {
|
| 774 |
nemBadge.textContent = 'Nemotron 1M';
|
| 775 |
nemBadge.className = 'config-badge ok';
|
| 776 |
-
|
| 777 |
-
|
|
|
|
| 778 |
nemBadge.className = 'config-badge warn';
|
|
|
|
| 779 |
document.getElementById('nemotronSetup').classList.remove('hidden');
|
| 780 |
document.getElementById('nemotronPath').value = 'data/nemotron';
|
| 781 |
-
|
| 782 |
-
|
| 783 |
-
|
| 784 |
-
|
| 785 |
}
|
| 786 |
|
| 787 |
// Changes are auto-generated from evaluation concerns
|
|
|
|
| 314 |
<header>
|
| 315 |
<h1>Semantic Gradient Optimization</h1>
|
| 316 |
<p>Build a panel. See what they think. Test what to change next.</p>
|
| 317 |
+
<div id="configBadge" class="config-badge" style="display:none"></div>
|
| 318 |
+
<div id="nemotronBadge" class="config-badge" style="display:none;margin-left:8px"></div>
|
| 319 |
</header>
|
| 320 |
|
| 321 |
<!-- API Key setup (shown if no key configured) -->
|
|
|
|
| 760 |
if (cfg.has_api_key) {
|
| 761 |
badge.textContent = cfg.model;
|
| 762 |
badge.className = 'config-badge ok';
|
| 763 |
+
badge.style.display = '';
|
| 764 |
} else if (!cfg.is_spaces) {
|
| 765 |
badge.textContent = 'No API key';
|
| 766 |
badge.className = 'config-badge warn';
|
| 767 |
+
badge.style.display = '';
|
| 768 |
document.getElementById('apiKeySetup').classList.remove('hidden');
|
|
|
|
|
|
|
|
|
|
| 769 |
}
|
| 770 |
|
| 771 |
const nemBadge = document.getElementById('nemotronBadge');
|
| 772 |
if (cfg.nemotron_available) {
|
| 773 |
nemBadge.textContent = 'Nemotron 1M';
|
| 774 |
nemBadge.className = 'config-badge ok';
|
| 775 |
+
nemBadge.style.display = '';
|
| 776 |
+
} else if (!cfg.is_spaces) {
|
| 777 |
+
nemBadge.textContent = 'No panel data';
|
| 778 |
nemBadge.className = 'config-badge warn';
|
| 779 |
+
nemBadge.style.display = '';
|
| 780 |
document.getElementById('nemotronSetup').classList.remove('hidden');
|
| 781 |
document.getElementById('nemotronPath').value = 'data/nemotron';
|
| 782 |
+
} else {
|
| 783 |
+
// On Spaces without data — show setup but hide folder field
|
| 784 |
+
document.getElementById('nemotronSetup').classList.remove('hidden');
|
| 785 |
+
document.getElementById('nemotronPathField').classList.add('hidden');
|
| 786 |
}
|
| 787 |
|
| 788 |
// Changes are auto-generated from evaluation concerns
|