123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <!-- templates/add_account.html -->
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Add Account - KTVManager</title>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
- <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}" />
- <style>
- /* Hide the spinner by default */
- #loadingSpinner,
- #ocrLoadingSpinner {
- display: none;
- }
- </style>
- </head>
- <body>
- <!-- Navbar -->
- <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
- <a class="navbar-brand" href="/">KTVManager</a>
- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
- <span class="navbar-toggler-icon"></span>
- </button>
- <div class="collapse navbar-collapse" id="navbarNav">
- <ul class="navbar-nav ml-auto">
- <li class="nav-item">
- <a class="nav-link" href="/">Home</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="/accounts">Accounts</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="/urls">URLs</a>
- </li>
- </ul>
- </div>
- </nav>
- <!-- Sub-navigation for Accounts -->
- <div class="bg-light py-2">
- <div class="container">
- <ul class="nav nav-pills">
- <li class="nav-item">
- <a class="nav-link" href="/accounts">List Accounts</a>
- </li>
- <li class="nav-item">
- <a class="nav-link active" href="/accounts/add">Add Account</a>
- </li>
- </ul>
- </div>
- </div>
- <!-- Main Content -->
- <main class="container mt-5">
- <h1>Add Account</h1>
- <div>
- <form action="/accounts/add" method="POST" onsubmit="showLoading()">
- <div class="form-group">
- <label for="username">Username</label>
- <input type="text" class="form-control" id="username" name="username" value="{{ username }}" required>
- </div>
- <div class="form-group">
- <label for="password">Password</label>
- <input type="text" class="form-control" id="password" name="password" value="{{ password }}" required>
- </div>
- <div class="form-group">
- <label for="stream">Stream Name</label>
- <input type="text" class="form-control" id="stream" name="stream" required>
- </div>
- <button type="submit" class="btn btn-primary" id="submitButton">
- <span class="spinner-border spinner-border-sm" id="loadingSpinner" role="status" aria-hidden="true"></span>
- <span id="buttonText">Add Account</span>
- </button>
- </form>
- <hr>
- <h4>Load Details Via OCR</h2>
- <form action="/OCRupload" method="POST" enctype="multipart/form-data" onsubmit="showLoadingOCR()">
- <div class="form-group">
- <label for="image">Select Image</label>
- <input type="file" class="form-control-file" id="image" name="image" accept="image/*" required>
- </div>
- <button type="submit" class="btn btn-success" id="ocrButton">
- <span class="spinner-border spinner-border-sm" id="ocrLoadingSpinner" role="status" aria-hidden="true"></span>
- <span id="ocrButtonText">Load Details</span>
- </button>
- </form>
-
- </main>
- <footer class="bg-dark text-white text-center py-3 mt-5">
- <p></p>
- </footer>
- <script>
- function showLoading() {
- document.getElementById("submitButton").disabled = true;
- document.getElementById("loadingSpinner").style.display = "inline-block";
- document.getElementById("buttonText").textContent = "Working...";
- }
- function showLoadingOCR() {
- document.getElementById("ocrButton").disabled = true;
- document.getElementById("ocrLoadingSpinner").style.display = "inline-block";
- document.getElementById("ocrButtonText").textContent = "Processing...";
- }
- </script>
- </body>
- </html>
|