Download app/static/login.html from aionaion/chatdoc: direct link, hf CLI and curl.
- Browser
- Download file 2.9 kB
-
https://huggingface.co/spaces/aionaion/chatdoc/resolve/main/app/static/login.html
- Command line
-
hf download hf://spaces/aionaion/chatdoc/app/static/login.html
-
curl -L -o login.html https://huggingface.co/spaces/aionaion/chatdoc/resolve/main/app/static/login.html
2.9 kB
| <html lang="pt-br"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Login - RAG Chat</title> | |
| <style> | |
| body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #d1d7db; margin: 0; } | |
| .login-container { background-color: white; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); width: 300px; text-align: center; } | |
| h2 { color: #00a884; margin-bottom: 20px; } | |
| input { width: 100%; padding: 10px; margin: 10px 0; border: 1px solid #ddd; border-radius: 5px; box-sizing: border-box; } | |
| button { width: 100%; padding: 10px; background-color: #00a884; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; font-weight: bold; } | |
| button:hover { background-color: #008f6f; } | |
| .error { color: red; font-size: 0.9em; margin-top: 10px; display: none; } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="login-container"> | |
| <h2>Acesso ao Chat</h2> | |
| <form id="login-form"> | |
| <input type="text" id="username" placeholder="Usuário" required> | |
| <input type="password" id="password" placeholder="Senha" required> | |
| <button type="submit">Entrar</button> | |
| <div id="error-msg" class="error"></div> | |
| </form> | |
| </div> | |
| <script> | |
| document.getElementById('login-form').addEventListener('submit', async (e) => { | |
| e.preventDefault(); | |
| const username = document.getElementById('username').value; | |
| const password = document.getElementById('password').value; | |
| const errorMsg = document.getElementById('error-msg'); | |
| const formData = new URLSearchParams(); | |
| formData.append('username', username); | |
| formData.append('password', password); | |
| try { | |
| const response = await fetch('/api/v1/auth/login', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, | |
| body: formData | |
| }); | |
| if (response.ok) { | |
| const data = await response.json(); | |
| localStorage.setItem('token', data.access_token); | |
| window.location.href = '/chatdoc'; | |
| } else { | |
| errorMsg.textContent = 'Usuário ou senha inválidos.'; | |
| errorMsg.style.display = 'block'; | |
| } | |
| } catch (error) { | |
| errorMsg.textContent = 'Erro de conexão.'; | |
| errorMsg.style.display = 'block'; | |
| } | |
| }); | |
| </script> | |
| </body> | |
| </html> | |