add_account.html 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <!-- templates/add_account.html -->
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <meta charset="UTF-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Add Account - KTVManager</title>
  8. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
  9. <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}" />
  10. <style>
  11. /* Hide the spinner by default */
  12. #loadingSpinner {
  13. display: none;
  14. }
  15. </style>
  16. </head>
  17. <body>
  18. <!-- Navbar -->
  19. <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
  20. <a class="navbar-brand" href="/">KTVManager</a>
  21. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
  22. <span class="navbar-toggler-icon"></span>
  23. </button>
  24. <div class="collapse navbar-collapse" id="navbarNav">
  25. <ul class="navbar-nav ml-auto">
  26. <li class="nav-item">
  27. <a class="nav-link" href="/">Home</a>
  28. </li>
  29. <li class="nav-item">
  30. <a class="nav-link" href="/accounts">Accounts</a>
  31. </li>
  32. <li class="nav-item">
  33. <a class="nav-link" href="/urls">URLs</a>
  34. </li>
  35. </ul>
  36. </div>
  37. </nav>
  38. <!-- Sub-navigation for Accounts -->
  39. <div class="bg-light py-2">
  40. <div class="container">
  41. <ul class="nav nav-pills">
  42. <li class="nav-item">
  43. <a class="nav-link" href="/accounts">List Accounts</a>
  44. </li>
  45. <li class="nav-item">
  46. <a class="nav-link active" href="/accounts/add">Add Account</a>
  47. </li>
  48. </ul>
  49. </div>
  50. </div>
  51. <!-- Main Content -->
  52. <main div class="container mt-5">
  53. <h1>Add Account</h1>
  54. <br>
  55. <form action="/accounts/add" method="POST" onsubmit="showLoading()">
  56. <div class="form-group">
  57. <label for="username">Username</label>
  58. <input type="text" class="form-control" id="username" name="username" required>
  59. </div>
  60. <div class="form-group">
  61. <label for="password">Password</label>
  62. <input type="text" class="form-control" id="password" name="password" required>
  63. </div>
  64. <div class="form-group">
  65. <label for="stream">Stream Name</label>
  66. <input type="text" class="form-control" id="stream" name="stream" required>
  67. </div>
  68. <button type="submit" class="btn btn-primary" id="submitButton">
  69. <span class="spinner-border spinner-border-sm" id="loadingSpinner" role="status" aria-hidden="true"></span>
  70. <span id="buttonText">Add Account</span>
  71. </button>
  72. </form>
  73. </div>
  74. </main>
  75. <footer class="bg-dark text-white text-center py-3 mt-5">
  76. <p></p>
  77. </footer>
  78. <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
  79. <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.0.7/dist/umd/popper.min.js"></script>
  80. <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
  81. <script>
  82. function showLoading() {
  83. // Disable the button to prevent multiple submissions
  84. document.getElementById("submitButton").disabled = true;
  85. // Show spinner and change button text
  86. document.getElementById("loadingSpinner").style.display = "inline-block";
  87. document.getElementById("buttonText").textContent = "Working...";
  88. }
  89. </script>
  90. </body>
  91. </html>