]> www.vanbest.org Git - motioneye-debian/commitdiff
improved remote camera adding ui
authorCalin Crisan <ccrisan@gmail.com>
Sat, 19 Oct 2013 12:06:09 +0000 (15:06 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sat, 19 Oct 2013 12:06:09 +0000 (15:06 +0300)
doc/todo.txt
static/js/main.js

index 79244325691223fa6b242dc07c41b93fb28313bf..e7ad0eaf16cdc6def4d262ce882a845098920157 100644 (file)
@@ -1,7 +1,4 @@
--> add/remove camera: apply button still there
-
 -> http clients don't die: max_clients limit reached, request queued. 10 active, 217 queued requests. 
--> remote adding ui could be improved (cleanup fields on ok/on load, no error message until everything is ok)
 
 -> add an autoupdate mechanism
 
index 6277bd9418f3ceb95720021008c27d4b9f92a483..2c041ef771577fff55556483f4bea21000fa999b 100644 (file)
@@ -668,6 +668,8 @@ function showApply() {
 }
 
 function showProgress() {
+    refreshDisabled++;
+    
     if (!$('div.settings-container').is(':visible')) {
         return; /* settings panel is not open */
     }
@@ -684,8 +686,6 @@ function showProgress() {
     applyButton.addClass('progress');   
     
     $('div.camera-progress').css('opacity', '0.5');
-    
-    refreshDisabled++;
 }
 
 function hideApply() {
@@ -702,6 +702,8 @@ function hideApply() {
 }
 
 function endProgress() {
+    refreshDisabled--;
+    
     if (Object.keys(pushConfigs).length === 0) {
         hideApply();
     }
@@ -710,8 +712,6 @@ function endProgress() {
     }
     
     $('div.camera-progress').css('opacity', '0');
-    
-    refreshDisabled--;
 }
 
 function isProgress() {
@@ -994,7 +994,7 @@ function runAddCameraDialog() {
             this.validate();
         });
         
-        if (uiValid() && deviceSelect.val() == 'remote') {
+        if (content.is(':visible') && uiValid() && deviceSelect.val() == 'remote') {
             fetchRemoteCameras();
         }
     }
@@ -1037,7 +1037,10 @@ function runAddCameraDialog() {
         ajax('GET', '/config/list/', data, function (data) {
             if (data == null || data.error) {
                 progress.remove();
-                showErrorMessage(data && data.error);
+                if (passwordEntry.val()) { /* only show an error message when a password is supplied */
+                    showErrorMessage(data && data.error);
+                }
+                
                 return;
             }
             
@@ -1064,7 +1067,7 @@ function runAddCameraDialog() {
     updateUi();
     
     showModalDialog('<div class="modal-progress"></div>');
-
+    
     /* fetch the available devices */
     ajax('GET', '/config/list_devices/', null, function (data) {
         if (data == null || data.error) {