Spaces:
Runtime error
Runtime error
Download templates/index.html from BFManza/FastAPITest1: direct link, hf CLI and curl.
- Browser
- Download file 4.77 kB
-
https://huggingface.co/spaces/BFManza/FastAPITest1/resolve/main/templates/index.html
- Command line
-
hf download hf://spaces/BFManza/FastAPITest1/templates/index.html
-
curl -L -o index.html https://huggingface.co/spaces/BFManza/FastAPITest1/resolve/main/templates/index.html
4.77 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Welcome Page</title> | |
| <!-- Bootstrap CSS --> | |
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" | |
| integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> | |
| </head> | |
| <body> | |
| <div class="modal modal-tour position-static d-block bg-secondary py-5" tabindex="-1" role="dialog" id="modalTour"> | |
| <div class="modal-dialog" role="document"> | |
| <div class="modal-content rounded-4 shadow"> | |
| <div class="modal-body p-5"> | |
| <h2 class="fw-bold mb-0">What's new {{ name }}</h2> | |
| <div id="alertBox" class="alert" role="alert" style="display: none;"> | |
| <!-- The message will be filled in by JavaScript --> | |
| </div> | |
| <ul class="d-grid gap-4 my-5 list-unstyled"> | |
| <li class="d-flex gap-4"> | |
| <img src="/static/img/robotface2.jpg" alt="Image description" width="52" height="52"> | |
| <div> | |
| <h5 class="mb-0"> | |
| Step 1 | |
| </h5> | |
| Push the button to generate the .... | |
| </div> | |
| </li> | |
| <li class="d-flex gap-4"> | |
| <img src="/static/img/robotface.jpg" alt="Image description" width="52" height="52"> | |
| <div> | |
| <h5 class="mb-0"> | |
| Step 2 | |
| </h5> | |
| Make api to get answer | |
| </div> | |
| </li> | |
| </ul> | |
| <button type="button" class="btn btn-lg btn-primary mt-5 w-100" data-bs-dismiss="modal"> | |
| Genrate Faiss | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Optional JavaScript; choose one of the two! --> | |
| <!-- Option 1: Bootstrap Bundle with Popper --> | |
| <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" | |
| integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" | |
| crossorigin="anonymous"></script> | |
| <!-- Option 2: Separate Popper and Bootstrap JS --> | |
| <!-- | |
| <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script> | |
| --> | |
| </body> | |
| <script> | |
| document.querySelector('.btn-primary').addEventListener('click', function () { | |
| fetch('/run-script/', { | |
| method: 'POST', | |
| headers: { | |
| 'Content-Type': 'application/json' | |
| } | |
| }) | |
| .then(response => response.json()) | |
| .then(data => { | |
| console.log(data); // Log the response from the server | |
| const alertBox = document.getElementById('alertBox'); | |
| if (data.status === 'success') { | |
| alertBox.classList.remove('alert-danger'); | |
| alertBox.classList.add('alert-success'); | |
| alertBox.innerText = data.message; | |
| } else { | |
| alertBox.classList.remove('alert-success'); | |
| alertBox.classList.add('alert-danger'); | |
| alertBox.innerText = "Error: " + data.message; | |
| } | |
| alertBox.style.display = 'block'; // Show the alert box | |
| setTimeout(function() { | |
| alertBox.style.display = 'none'; // Hide the alert box after 5 seconds | |
| }, 5000); | |
| }) | |
| .catch(error => { | |
| console.error('Error:', error); | |
| const alertBox = document.getElementById('alertBox'); | |
| alertBox.classList.remove('alert-success'); | |
| alertBox.classList.add('alert-danger'); | |
| alertBox.innerText = "Error: An unexpected error occurred."; | |
| alertBox.style.display = 'block'; // Show the alert box | |
| setTimeout(function() { | |
| alertBox.style.display = 'none'; // Hide the alert box after 5 seconds | |
| }, 5000); | |
| }); | |
| }); | |
| </script> | |
| </html> |