Spaces:
Sleeping
Sleeping
feat(ui): add loading state to submit button and exclude tts models
Browse files- services/genai_service.py +1 -1
- templates/chat.html +11 -1
services/genai_service.py
CHANGED
|
@@ -54,7 +54,7 @@ def list_available_models():
|
|
| 54 |
continue
|
| 55 |
|
| 56 |
# 3. Exclui variantes problemáticas ou não suportadas
|
| 57 |
-
if any(x in name_lower for x in ['image', 'vision', 'pro']):
|
| 58 |
continue
|
| 59 |
|
| 60 |
models.append({"id": m.name, "name": m.display_name})
|
|
|
|
| 54 |
continue
|
| 55 |
|
| 56 |
# 3. Exclui variantes problemáticas ou não suportadas
|
| 57 |
+
if any(x in name_lower for x in ['image', 'vision', 'pro', 'tts']):
|
| 58 |
continue
|
| 59 |
|
| 60 |
models.append({"id": m.name, "name": m.display_name})
|
templates/chat.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
| 27 |
O que você deseja saber?</p>
|
| 28 |
|
| 29 |
<input type="text" id="question" name="question" required>
|
| 30 |
-
<button type="submit">Enviar</button>
|
| 31 |
</form>
|
| 32 |
|
| 33 |
</div>
|
|
@@ -39,5 +39,15 @@
|
|
| 39 |
</div>
|
| 40 |
{% endif %}
|
| 41 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
</body>
|
| 43 |
</html>
|
|
|
|
| 27 |
O que você deseja saber?</p>
|
| 28 |
|
| 29 |
<input type="text" id="question" name="question" required>
|
| 30 |
+
<button type="submit" id="submit-btn">Enviar</button>
|
| 31 |
</form>
|
| 32 |
|
| 33 |
</div>
|
|
|
|
| 39 |
</div>
|
| 40 |
{% endif %}
|
| 41 |
</div>
|
| 42 |
+
|
| 43 |
+
<script>
|
| 44 |
+
document.querySelector('form').addEventListener('submit', function(e) {
|
| 45 |
+
const btn = document.getElementById('submit-btn');
|
| 46 |
+
btn.disabled = true;
|
| 47 |
+
btn.innerHTML = 'Aguarde, escrevendo... ⏳';
|
| 48 |
+
btn.style.opacity = '0.7';
|
| 49 |
+
btn.style.cursor = 'wait';
|
| 50 |
+
});
|
| 51 |
+
</script>
|
| 52 |
</body>
|
| 53 |
</html>
|