add_account.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. #ocrLoadingSpinner {
  14. display: none;
  15. }
  16. </style>
  17. </head>
  18. <body>
  19. <!-- Navbar -->
  20. <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
  21. <a class="navbar-brand" href="/">KTVManager</a>
  22. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
  23. <span class="navbar-toggler-icon"></span>
  24. </button>
  25. <div class="collapse navbar-collapse" id="navbarNav">
  26. <ul class="navbar-nav ml-auto">
  27. <li class="nav-item">
  28. <a class="nav-link" href="/">Home</a>
  29. </li>
  30. <li class="nav-item">
  31. <a class="nav-link" href="/accounts">Accounts</a>
  32. </li>
  33. <li class="nav-item">
  34. <a class="nav-link" href="/urls">URLs</a>
  35. </li>
  36. </ul>
  37. </div>
  38. </nav>
  39. <!-- Sub-navigation for Accounts -->
  40. <div class="bg-light py-2">
  41. <div class="container">
  42. <ul class="nav nav-pills">
  43. <li class="nav-item">
  44. <a class="nav-link" href="/accounts">List Accounts</a>
  45. </li>
  46. <li class="nav-item">
  47. <a class="nav-link active" href="/accounts/add">Add Account</a>
  48. </li>
  49. </ul>
  50. </div>
  51. </div>
  52. <!-- Main Content -->
  53. <main class="container mt-5">
  54. <h1>Add Account</h1>
  55. <div>
  56. <form action="/accounts/add" method="POST" onsubmit="showLoading()">
  57. <div class="form-group">
  58. <label for="username">Username</label>
  59. <input type="text" class="form-control" id="username" name="username" value="{{ username }}" required>
  60. </div>
  61. <div class="form-group">
  62. <label for="password">Password</label>
  63. <input type="text" class="form-control" id="password" name="password" value="{{ password }}" required>
  64. </div>
  65. <div class="form-group">
  66. <label for="stream">Stream Name</label>
  67. <input type="text" class="form-control" id="stream" name="stream" required>
  68. </div>
  69. <button type="submit" class="btn btn-primary" id="submitButton">
  70. <span class="spinner-border spinner-border-sm" id="loadingSpinner" role="status" aria-hidden="true"></span>
  71. <span id="buttonText">Add Account</span>
  72. </button>
  73. </form>
  74. <hr>
  75. <h4>Load Details Via OCR</h2>
  76. <form action="/OCRupload" method="POST" enctype="multipart/form-data" onsubmit="showLoadingOCR()">
  77. <div class="form-group">
  78. <label for="image">Select Image</label>
  79. <input type="file" class="form-control-file" id="image" name="image" accept="image/*" required>
  80. </div>
  81. <button type="submit" class="btn btn-success" id="ocrButton">
  82. <span class="spinner-border spinner-border-sm" id="ocrLoadingSpinner" role="status" aria-hidden="true"></span>
  83. <span id="ocrButtonText">Load Details</span>
  84. </button>
  85. </form>
  86. </main>
  87. <footer class="bg-dark text-white text-center py-3 mt-5">
  88. <p></p>
  89. </footer>
  90. <script>
  91. function showLoading() {
  92. document.getElementById("submitButton").disabled = true;
  93. document.getElementById("loadingSpinner").style.display = "inline-block";
  94. document.getElementById("buttonText").textContent = "Working...";
  95. }
  96. function showLoadingOCR() {
  97. document.getElementById("ocrButton").disabled = true;
  98. document.getElementById("ocrLoadingSpinner").style.display = "inline-block";
  99. document.getElementById("ocrButtonText").textContent = "Processing...";
  100. }
  101. </script>
  102. </body>
  103. </html>