]> www.vanbest.org Git - motioneye-debian/commitdiff
hell knows what other improvements
authorCalin Crisan <ccrisan@gmail.com>
Sun, 29 Sep 2013 20:11:51 +0000 (23:11 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sun, 29 Sep 2013 20:11:51 +0000 (23:11 +0300)
doc/todo.txt
motioneye.py
src/config.py
src/handlers.py
src/motionctl.py
static/css/main.css
static/js/main.js

index 0e36e92e39ebe5bfbce109c5df1b3fa90fdfceee..e4302cddadaa35011a0aef67b346a9d559d5a506 100644 (file)
@@ -1,11 +1,11 @@
 -> camera not available background and icon design
 -> remove current snapshot GET logs
--> a nice shadow behind the header
 -> add a motion running status indicator (and maybe a start/stop button)
-
+-> add a timeout checker to check the running status of motion
 -> group @config rules to top
 -> browser compatibility test
 -> requirements test
+-> style scroll bars
 -> hint text next to section titles
 -> clickable hints
 -> authentication
@@ -15,4 +15,5 @@
 -> click to zoom on cameras
 -> add a previewer for movies
 -> add a previewer for snapshots
--> other todos
\ No newline at end of file
+-> other todos
+-> use svg instead of pngs for icons
\ No newline at end of file
index 9eb0d0c73e99af9c2e8ed98524653e08de40e25f..b6a793874d0b1ba3a04e21b79ae38f943907fec7 100644 (file)
@@ -8,8 +8,10 @@ import sys
 import tornado.ioloop
 
 import settings
+
 sys.path.append(os.path.join(settings.PROJECT_PATH, 'src'))
 
+import config
 import server
 
 
@@ -46,7 +48,7 @@ def _start_server():
 
 
 def _start_motion():
-    if not motionctl.running():
+    if not motionctl.running() and len(config.get_enabled_cameras()) > 0:
         motionctl.start()
         logging.info('motion started')
 
index 262ec4ee5b9516e9d627e2608ef605560e70fc3a..4f2fbf670be56eabfaf53e68b38bf43776f3b205 100644 (file)
@@ -136,6 +136,12 @@ def get_camera_ids():
     return camera_ids
 
 
+def get_enabled_cameras():
+    camera_ids = get_camera_ids()
+    cameras = [get_camera(camera_id) for camera_id in camera_ids]
+    return [c for c in cameras if c['@enabled']]
+
+
 def get_camera(camera_id, as_lines=False):
     # TODO use a cache
     
@@ -489,7 +495,7 @@ def _set_default_motion_camera(data):
     
     data.setdefault('text_left', '')
     data.setdefault('text_right', '')
-    data.setdefault('text_double', True)
+    data.setdefault('text_double', False)
 
     data.setdefault('text_changes', False)
     data.setdefault('locate', False)
index c0cd5544c340167d6def394ffec86cc7eb71d8ad..baedcd785cf2975c4812bf400d5c945f51ff8a4d 100644 (file)
@@ -146,7 +146,8 @@ class ConfigHandler(BaseHandler):
         
         finally:
             if restart:
-                motionctl.start()
+                if len(config.get_enabled_cameras()) > 0:
+                    motionctl.start()
 
     def set_preview(self, camera_id):
         try:
@@ -271,6 +272,7 @@ class ConfigHandler(BaseHandler):
             # text overlay
             'text_left': '',
             'text_right': '',
+            'text_double': False,
             
             # streaming
             'webcam_localhost': not ui.get('video_streaming', True),
@@ -332,6 +334,9 @@ class ConfigHandler(BaseHandler):
                 
             else:
                 data['text_right'] = ui.get('custom_right_text', '')
+            
+            if data['width'] > 320:
+                data['text_double'] = True
         
         if not ui.get('video_streaming', True):
             data['webcam_maxrate'] = 5
@@ -344,7 +349,7 @@ class ConfigHandler(BaseHandler):
                 data['jpeg_filename'] = ui.get('image_file_name', '%Y-%m-%d-%H-%M-%S-%q')  
                 
             elif capture_mode == 'interval-snapshots':
-                data['snapshot_interval'] = int(ui.get('snapshot_interval'), 300)
+                data['snapshot_interval'] = int(ui.get('snapshot_interval', 300))
                 data['snapshot_filename'] = ui.get('image_file_name', '%Y-%m-%d-%H-%M-%S-%q')
                 
             elif capture_mode == 'all-frames':
@@ -413,11 +418,11 @@ class ConfigHandler(BaseHandler):
             'preserve_images': data['@preserve_images'],
             
             # motion movies
-            'motion_movies': False,
-            'movie_quality': 75,
-            'movie_file_name': '%Y-%m-%d-%H-%M-%S-%q',
+            'motion_movies': data['motion_movies'],
+            'movie_quality': int((max(2, data['ffmpeg_variable_bitrate']) - 2) / 0.29),
+            'movie_file_name': data['movie_filename'],
             'preserve_movies': data['@preserve_movies'],
-            
+
             # motion detection
             'show_frame_changes': data.get('text_changes') or data.get('locate'),
             'frame_change_threshold': data['threshold'],
@@ -493,12 +498,6 @@ class ConfigHandler(BaseHandler):
                 
             ui['image_quality'] = ui.get('quality', 75)
         
-        movie_filename = data.get('movie_filename')
-        if movie_filename:
-            ui['motion_movies'] = True
-            ui['movie_quality'] = int((max(2, data['ffmpeg_variable_bitrate']) - 2) / 0.29)
-            ui['movie_file_name'] = movie_filename
-            
         working_schedule = data.get('@working_schedule')
         if working_schedule:
             days = working_schedule.split('|')
index 6c7cce1a95371584cdd306c12c9e2b3c81d3107b..62b0e983f7306fbdaf145e8eb8aa6d5689962913 100644 (file)
@@ -19,7 +19,7 @@ def find_program():
 def start():
     if running():
         raise Exception('motion is already running')
-
     program = find_program()
     if not program:
         raise Exception('motion executable could not be found')
index d4b21e071aff8af3693979a2c4755cd0c24b1f3c..4d65e15c6d2ea135ece2ca97eae773004c115bef 100644 (file)
@@ -55,6 +55,7 @@ div.page {
 
 div.header {
     background-color: rgba(64, 64, 64, 0.5);
+    box-shadow: 0px 0px 5px rgba(0,0,0,0.3);
     top: 0px;
     width: 100%;
     height: 50px;
index 70e6ee5d2d323f215c4594178989a335ddf07462..526b9f8ba2c74ef47ec45fa4c94b9309dbe6bb85 100644 (file)
@@ -252,6 +252,8 @@ function openSettings(cameraId) {
 }
 
 function closeSettings() {
+    hideApply();
+    
     $('div.settings').removeClass('open');
     $('div.page-container').removeClass('stretched');
     $('div.settings-top-bar').removeClass('open');
@@ -889,7 +891,6 @@ function recreateCameraFrames(cameras) {
             else { /* existing, update params */
                 cameraFrame[0].framerate = camera.streaming_framerate;
             }
-            
         }
     }