Compare commits
No commits in common. "40bead1e6a0a119a4ae3bf7ad05ca47f29dc85ce" and "5a5692d8cc4f0353876d8980977cf387341246e7" have entirely different histories.
40bead1e6a
...
5a5692d8cc
5
app.py
5
app.py
@ -26,7 +26,6 @@ else:
|
|||||||
app.config.from_object(DevelopmentConfig)
|
app.config.from_object(DevelopmentConfig)
|
||||||
cache = Cache(app, config={"CACHE_TYPE": "SimpleCache"})
|
cache = Cache(app, config={"CACHE_TYPE": "SimpleCache"})
|
||||||
|
|
||||||
if app.config.get("OCR_ENABLED"):
|
|
||||||
ocr = PaddleOCR(use_angle_cls=True, lang='en') # Adjust language if needed
|
ocr = PaddleOCR(use_angle_cls=True, lang='en') # Adjust language if needed
|
||||||
|
|
||||||
app.config["SESSION_COOKIE_SECURE"] = not app.config["DEBUG"]
|
app.config["SESSION_COOKIE_SECURE"] = not app.config["DEBUG"]
|
||||||
@ -86,7 +85,6 @@ def home():
|
|||||||
accounts=count,
|
accounts=count,
|
||||||
current_month_accounts=current_month_accounts,
|
current_month_accounts=current_month_accounts,
|
||||||
expired_accounts=expired_accounts,
|
expired_accounts=expired_accounts,
|
||||||
ocr_enabled=app.config.get("OCR_ENABLED"),
|
|
||||||
)
|
)
|
||||||
return render_template("index.html")
|
return render_template("index.html")
|
||||||
|
|
||||||
@ -165,7 +163,7 @@ def add_account():
|
|||||||
return redirect(url_for("user_accounts"))
|
return redirect(url_for("user_accounts"))
|
||||||
return render_template("add_account.html")
|
return render_template("add_account.html")
|
||||||
|
|
||||||
return render_template("add_account.html", ocr_enabled=app.config.get("OCR_ENABLED"), text_input_enabled=app.config.get("TEXT_INPUT_ENABLED"))
|
return render_template("add_account.html")
|
||||||
|
|
||||||
|
|
||||||
@app.route("/accounts/delete", methods=["POST"])
|
@app.route("/accounts/delete", methods=["POST"])
|
||||||
@ -189,7 +187,6 @@ def stream_names():
|
|||||||
return jsonify(stream_names)
|
return jsonify(stream_names)
|
||||||
|
|
||||||
|
|
||||||
if app.config.get("OCR_ENABLED"):
|
|
||||||
@app.route('/OCRupload', methods=['POST'])
|
@app.route('/OCRupload', methods=['POST'])
|
||||||
def OCRupload():
|
def OCRupload():
|
||||||
if 'image' not in request.files:
|
if 'image' not in request.files:
|
||||||
|
8
pyproject.toml
Normal file
8
pyproject.toml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[tool.bump-my-version]
|
||||||
|
current_version = "1.0.6"
|
||||||
|
commit = true
|
||||||
|
tag = true
|
||||||
|
message = "bump version to {new_version}"
|
||||||
|
|
||||||
|
[[tool.bump-my-version.files]]
|
||||||
|
filename = "VERSION"
|
@ -74,7 +74,6 @@
|
|||||||
<span id="buttonText">Add Account</span>
|
<span id="buttonText">Add Account</span>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
{% if ocr_enabled %}
|
|
||||||
<hr>
|
<hr>
|
||||||
<h2>Load Details Via OCR</h2>
|
<h2>Load Details Via OCR</h2>
|
||||||
<form action="/OCRupload" method="POST" enctype="multipart/form-data" onsubmit="showLoadingOCR()">
|
<form action="/OCRupload" method="POST" enctype="multipart/form-data" onsubmit="showLoadingOCR()">
|
||||||
@ -87,15 +86,6 @@
|
|||||||
<span id="ocrButtonText">Load Details</span>
|
<span id="ocrButtonText">Load Details</span>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
|
||||||
{% if text_input_enabled %}
|
|
||||||
<hr>
|
|
||||||
<h2>Load Details Via Text</h2>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="accountDetails">Paste Account Details</label>
|
|
||||||
<textarea class="form-control" id="accountDetails" rows="4"></textarea>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</main>
|
</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">
|
||||||
@ -116,47 +106,12 @@
|
|||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
var streamInput = document.getElementById("stream");
|
var streamInput = document.getElementById("stream");
|
||||||
var awesomplete;
|
|
||||||
fetch('/get_stream_names')
|
fetch('/get_stream_names')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
awesomplete = new Awesomplete(streamInput, {
|
new Awesomplete(streamInput, {
|
||||||
list: data
|
list: data
|
||||||
});
|
});
|
||||||
|
|
||||||
streamInput.addEventListener('awesomplete-selectcomplete', function(event) {
|
|
||||||
this.value = event.text.value;
|
|
||||||
});
|
|
||||||
|
|
||||||
{% if text_input_enabled %}
|
|
||||||
const accountDetailsTextarea = document.getElementById('accountDetails');
|
|
||||||
if (accountDetailsTextarea) {
|
|
||||||
accountDetailsTextarea.addEventListener('input', function() {
|
|
||||||
const text = this.value;
|
|
||||||
const lines = text.split('\n');
|
|
||||||
|
|
||||||
const streamName = lines[0] ? lines[0].trim() : '';
|
|
||||||
const usernameLine = lines.find(line => line.toUpperCase().startsWith('USER:'));
|
|
||||||
const passwordLine = lines.find(line => line.toUpperCase().startsWith('PASS:'));
|
|
||||||
|
|
||||||
if (usernameLine) {
|
|
||||||
document.getElementById('username').value = usernameLine.substring(5).trim();
|
|
||||||
}
|
|
||||||
if (passwordLine) {
|
|
||||||
document.getElementById('password').value = passwordLine.substring(5).trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (streamName) {
|
|
||||||
streamInput.value = streamName;
|
|
||||||
awesomplete.evaluate();
|
|
||||||
if (awesomplete.ul.children.length > 0) {
|
|
||||||
awesomplete.goto(0);
|
|
||||||
awesomplete.select();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
{% endif %}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user