1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-01-10 01:17:59 +03:00

The index is now "static", so we reload it every minute for the user to

get the state of different services updated.
This commit is contained in:
Adolfo Gómez García 2015-05-10 07:33:12 +02:00
parent 04ec90ad61
commit 78526b3560
2 changed files with 19 additions and 0 deletions

View File

@ -6,6 +6,8 @@ uds.safari = false
uds.ie = false
uds.firefox = false
uds.reloadCounter = 12
# First, detect browser
(() ->
ua = navigator.userAgent.toLowerCase()
@ -226,3 +228,15 @@ uds.onLink = ->
return
uds.resetReloadCounter = ->
uds.reloadCounter = 12
uds.setReload = ->
setTimeout uds.reload, 5000
uds.reload = ->
if uds.reloadCounter == 0
window.location.reload()
else
uds.reloadCounter -= 1
uds.setReload()

View File

@ -188,6 +188,9 @@
<script>
function launchURL(el) {
var $el = $(el);
uds.resetReloadCounter(); // Resets page update
url = $el.attr('data-href');
url = url != null ? url : $el.attr('href');
if ( url.substring(0, 7) == 'udsa://' ) {
@ -257,6 +260,8 @@
autorun = false;
}
uds.setReload();
});
</script>
{% endblock %}