0
0
Fork 0
mirror of https://github.com/healthchecks/healthchecks.git synced 2025-04-07 14:15:34 +00:00

Implement audo-submit in TOTP entry screen. Fixes

This commit is contained in:
Pēteris Caune 2023-11-13 15:20:23 +02:00
parent 336e71e52f
commit ee62dc174c
No known key found for this signature in database
GPG key ID: E28D7679E9A9EDE2
3 changed files with 18 additions and 1 deletions

View file

@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
- Update the Slack integration to not retry when Slack returns 400 "invalid_token"
- Improve Pushover notifications (include tags, period, last ping type etc.)
- Update the Pushover integration to not retry when Pushover reports invalid user
- Implement audo-submit in TOTP entry screen (#905)
### Bug Fixes
- Fix "Ping Details" dialog to handle email bodies not yet uploaded to object storage

7
static/js/auto-submit.js Normal file
View file

@ -0,0 +1,7 @@
$(function() {
$("input[data-auto-submit]").on("keyup input", function() {
if (this.validity.valid) {
this.form.submit();
}
});
})

View file

@ -14,12 +14,15 @@
<div class="form-group {{ form.code.css_classes }}">
<input
id="code"
type="text"
name="code"
pattern="[0-9]{6}"
title="6-digit code"
placeholder="6-digit code"
data-auto-submit="1"
class="form-control input-lg"
required
autofocus />
{% if form.code.errors %}
<div class="help-block">
@ -37,4 +40,10 @@
</div>
</form>
</div>
{% endblock %}
{% endblock %}
{% block scripts %}
{% compress js %}
<script src="{% static 'js/auto-submit.js' %}"></script>
{% endcompress %}
{% endblock %}