mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
setup: Reduce refresh time when application is already installed
In the event setup page is being shown after the application installation is already completed. Immediately reload instead of waiting for 3 seconds are usual. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
65f1af7a7b
commit
915b8013d9
@ -81,6 +81,7 @@
|
||||
{% block page_js %}
|
||||
{% if is_running %}
|
||||
<script type="text/javascript" src="{% static 'theme/js/refresh.js' %}"></script>
|
||||
<script type="text/javascript">refresh();</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@ -173,6 +173,7 @@
|
||||
{% block page_js %}
|
||||
{% if running %}
|
||||
<script type="text/javascript" src="{% static 'theme/js/refresh.js' %}"></script>
|
||||
<script type="text/javascript">refresh();</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@ -133,5 +133,6 @@
|
||||
{% block page_js %}
|
||||
{% if status.setup_running %}
|
||||
<script type="text/javascript" src="{% static 'theme/js/refresh.js' %}"></script>
|
||||
<script type="text/javascript">refresh();</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
@ -173,6 +173,7 @@
|
||||
|
||||
{% if config_running %}
|
||||
<script type="text/javascript" src="{% static 'theme/js/refresh.js' %}"></script>
|
||||
<script type="text/javascript">refresh();</script>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@ -88,5 +88,6 @@
|
||||
|
||||
{% if is_busy %}
|
||||
<script type="text/javascript" src="{% static 'theme/js/refresh.js' %}"></script>
|
||||
<script type="text/javascript">refresh();</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
@ -23,7 +23,11 @@
|
||||
{% load static %}
|
||||
|
||||
{% block page_head %}
|
||||
{% if setup_current_operation or setup_state == 'up-to-date' %}
|
||||
{% if setup_state == 'up-to-date' %}
|
||||
<noscript>
|
||||
<meta http-equiv="refresh" content="0" />
|
||||
</noscript>
|
||||
{% elif setup_current_operation %}
|
||||
<noscript>
|
||||
<meta http-equiv="refresh" content="3" />
|
||||
</noscript>
|
||||
@ -140,6 +144,11 @@
|
||||
|
||||
{% if setup_current_operation or setup_state == 'up-to-date' %}
|
||||
<script type="text/javascript" src="{% static 'theme/js/refresh.js' %}"></script>
|
||||
{% if setup_state == 'up-to-date' %}
|
||||
<script type="text/javascript">refresh(0);</script>
|
||||
{% else %}
|
||||
<script type="text/javascript">refresh();</script>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@ -21,9 +21,9 @@ function sleep(ms) {
|
||||
|
||||
// Refresh the page once in n seconds
|
||||
async function refresh(ms) {
|
||||
if (typeof ms === 'undefined')
|
||||
ms = 3000;
|
||||
|
||||
await sleep(ms);
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
refresh(3000);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user