mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
js: Simplify auto-refresh page logic
- Implement ability to refresh page at the framework level so that every page does not need to handle it. - Refresh after number of seconds specified in context of the view. Tests performed: - Trigger the following functions and ensure that page reload after 3 seconds during the running operation while it does refresh before and after the operation. - Diagnostics tests from the module. - Gitweb repository cloning. - Monkeysphere publish key to server. - OpenVPN setup. - Tor configuration update. - Manual software update. - App installation. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
1 parent
1b5a10a628
commit
3efff2fa42
18 files changed
+45
-176
No files matched your search
@@ -82,12 +82,3 @@
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block page_js %}
|
||||
|
||||
{% if cloning %}
|
||||
<script type="text/javascript" src="{% static 'theme/js/refresh.js' %}"></script>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -31,6 +31,7 @@ class GitwebAppView(views.AppView):
|
||||
repos = gitweb.app.get_repo_list()
|
||||
context['repos'] = repos
|
||||
context['cloning'] = any('clone_progress' in repo for repo in repos)
|
||||
context['refresh_page_sec'] = 3 if context['cloning'] else None
|
||||
return context
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user