|
@@ -6,16 +6,16 @@
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Add Account - KTVManager</title>
|
|
<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="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
|
|
- <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}" />
|
|
|
|
|
|
+ <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}" />
|
|
<style>
|
|
<style>
|
|
/* Hide the spinner by default */
|
|
/* Hide the spinner by default */
|
|
- #loadingSpinner {
|
|
|
|
|
|
+ #loadingSpinner,
|
|
|
|
+ #ocrLoadingSpinner {
|
|
display: none;
|
|
display: none;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|
|
</head>
|
|
</head>
|
|
<body>
|
|
<body>
|
|
-
|
|
|
|
<!-- Navbar -->
|
|
<!-- Navbar -->
|
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
|
<a class="navbar-brand" href="/">KTVManager</a>
|
|
<a class="navbar-brand" href="/">KTVManager</a>
|
|
@@ -52,18 +52,17 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- Main Content -->
|
|
<!-- Main Content -->
|
|
- <main div class="container mt-5">
|
|
|
|
|
|
+ <main class="container mt-5">
|
|
<h1>Add Account</h1>
|
|
<h1>Add Account</h1>
|
|
- <br>
|
|
|
|
-
|
|
|
|
|
|
+ <div>
|
|
<form action="/accounts/add" method="POST" onsubmit="showLoading()">
|
|
<form action="/accounts/add" method="POST" onsubmit="showLoading()">
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
<label for="username">Username</label>
|
|
<label for="username">Username</label>
|
|
- <input type="text" class="form-control" id="username" name="username" required>
|
|
|
|
|
|
+ <input type="text" class="form-control" id="username" name="username" value="{{ username }}" required>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
<label for="password">Password</label>
|
|
<label for="password">Password</label>
|
|
- <input type="text" class="form-control" id="password" name="password" required>
|
|
|
|
|
|
+ <input type="text" class="form-control" id="password" name="password" value="{{ password }}" required>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
<label for="stream">Stream Name</label>
|
|
<label for="stream">Stream Name</label>
|
|
@@ -74,24 +73,34 @@
|
|
<span id="buttonText">Add Account</span>
|
|
<span id="buttonText">Add Account</span>
|
|
</button>
|
|
</button>
|
|
</form>
|
|
</form>
|
|
- </div>
|
|
|
|
- </main>
|
|
|
|
|
|
+ <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">
|
|
<footer class="bg-dark text-white text-center py-3 mt-5">
|
|
<p></p>
|
|
<p></p>
|
|
</footer>
|
|
</footer>
|
|
-
|
|
|
|
- <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
|
|
|
|
- <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.0.7/dist/umd/popper.min.js"></script>
|
|
|
|
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
|
|
|
|
<script>
|
|
<script>
|
|
function showLoading() {
|
|
function showLoading() {
|
|
- // Disable the button to prevent multiple submissions
|
|
|
|
document.getElementById("submitButton").disabled = true;
|
|
document.getElementById("submitButton").disabled = true;
|
|
- // Show spinner and change button text
|
|
|
|
document.getElementById("loadingSpinner").style.display = "inline-block";
|
|
document.getElementById("loadingSpinner").style.display = "inline-block";
|
|
document.getElementById("buttonText").textContent = "Working...";
|
|
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>
|
|
</script>
|
|
</body>
|
|
</body>
|
|
</html>
|
|
</html>
|