]> www.vanbest.org Git - motioneye-debian/commitdiff
fixed camera/instance association when applying settings
authorCalin Crisan <ccrisan@gmail.com>
Sat, 23 Aug 2014 17:47:17 +0000 (20:47 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sat, 23 Aug 2014 17:47:17 +0000 (20:47 +0300)
src/handlers.py
static/js/main.js

index 36a5928c0c7f65594eba4dd31d00583f9e6af673..f2952187cc763038083632ef46aff7069d6b69fc 100644 (file)
@@ -483,6 +483,7 @@ class ConfigHandler(BaseHandler):
                     
                     else:
                         remote_ui_config['id'] = camera_id
+                        
                         if not remote_ui_config['enabled'] and local_config['@enabled']:
                             # if a remote camera is disabled, make sure it's disabled locally as well
                             local_config['@enabled'] = False
@@ -492,6 +493,9 @@ class ConfigHandler(BaseHandler):
                             # if a remote camera is locally disabled, make sure the remote config says the same thing
                             remote_ui_config['enabled'] = False
                             
+                        for key, value in local_config.items():
+                            remote_ui_config[key.replace('@', '')] = value
+
                         cameras.append(remote_ui_config)
                         
                     check_finished()
index 9f43849a908e626ea982944bb9356ae096c49688..ab77d63421f0094cdd67d844d44febb5a429ce22 100644 (file)
@@ -1035,9 +1035,15 @@ function doApply() {
             return;
         }
         
-        var instance = config.host || '';
-        if (config.port) {
-            instance += ':' + config.port;
+        var instance;
+        if (config.proto == 'http' || config.proto == 'v4l2') {
+            instance = '';
+        }
+        else { /* motioneye */
+            instance = config.host || '';
+            if (config.port) {
+                instance += ':' + config.port;
+            }
         }
         
         affectedInstances[instance] = true;
@@ -1367,9 +1373,15 @@ function getCameraIdsByInstance() {
     
     var cameraIdsByInstance = {};
     $('div.camera-frame').each(function () {
-        var instance = this.config.host || '';
-        if (this.config.port) {
-            instance += ':' + this.config.port;
+        var instance;
+        if (this.config.proto == 'http' || this.config.proto == 'v4l2') {
+            instance = '';
+        }
+        else { /* motioneye */
+            instance = this.config.host || '';
+            if (this.config.port) {
+                instance += ':' + this.config.port;
+            }
         }
         
         (cameraIdsByInstance[instance] = cameraIdsByInstance[instance] || []).push(this.config.id);