From: Calin Crisan Date: Sat, 9 Nov 2013 11:34:17 +0000 (+0200) Subject: added a main loading progress X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=9c0cbb71741e1b241244db87e7c6dbf58fb6ac2b;p=motioneye-debian added a main loading progress --- diff --git a/doc/todo.txt b/doc/todo.txt index c5f1c4d..73afdb5 100644 --- a/doc/todo.txt +++ b/doc/todo.txt @@ -1,4 +1,3 @@ --> add a loading progress when page loads -> order of the cams is a bit random -> disk usage at bottom -> make camera frames positions configurable diff --git a/settings_default.py b/settings_default.py index 6c60897..cce949a 100644 --- a/settings_default.py +++ b/settings_default.py @@ -37,3 +37,6 @@ CLEANUP_INTERVAL = 43200 # timeout in seconds to wait for responses when contacting a remote server REMOTE_REQUEST_TIMEOUT = 10 + +# timeout in seconds to wait for an access to a mjpg client before removing it +MJPG_CLIENT_TIMEOUT = 10 diff --git a/static/css/main.css b/static/css/main.css index 62b5cd4..847fc4a 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -127,6 +127,12 @@ img.logo { vertical-align: middle; } +img.main-loading-progress { + display: block; + margin: auto; + margin-top: 50px; +} + /* settings */ diff --git a/static/img/main-loading-progress.gif b/static/img/main-loading-progress.gif new file mode 100644 index 0000000..4f7a78e Binary files /dev/null and b/static/img/main-loading-progress.gif differ diff --git a/static/js/main.js b/static/js/main.js index 66c7e39..172dcb8 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -865,7 +865,16 @@ function fetchCurrentConfig() { updateConfigUi(); } - recreateCameraFrames(cameras); + var mainLoadingProgressImg = $('img.main-loading-progress'); + if (mainLoadingProgressImg.length) { + mainLoadingProgressImg.animate({'opacity': 0}, 200, function () { + recreateCameraFrames(cameras); + mainLoadingProgressImg.remove(); + }); + } + else { + recreateCameraFrames(cameras); + } }); } diff --git a/templates/main.html b/templates/main.html index 570d6e4..7a8694d 100644 --- a/templates/main.html +++ b/templates/main.html @@ -433,6 +433,7 @@ {% endif %}
+