From a12422b6771c39f05e9aed4e0eaa3ffea142e2c0 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sat, 12 Oct 2013 19:03:28 +0300 Subject: [PATCH] various logging & error reporting improvements --- doc/todo.txt | 2 -- src/handlers.py | 12 +++++++++--- static/css/ui.css | 2 +- templates/main.html | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/doc/todo.txt b/doc/todo.txt index 79e2361..e5c0277 100644 --- a/doc/todo.txt +++ b/doc/todo.txt @@ -1,6 +1,4 @@ --> cache configuration - -> prevent Request closed errors by stopping mjpg clients before stopping motion -> style scroll bars diff --git a/src/handlers.py b/src/handlers.py index 2343c03..574125f 100644 --- a/src/handlers.py +++ b/src/handlers.py @@ -142,7 +142,7 @@ class ConfigHandler(BaseHandler): if camera_config['@proto'] != 'v4l2': def on_response(remote_ui_config): if remote_ui_config is None: - return self.finish_json({'error': True}) + return self.finish_json({'error': 'Failed to get remote camera configuration.'}) tmp_config = self._camera_ui_to_dict(remote_ui_config) tmp_config.update(camera_config) @@ -312,7 +312,7 @@ class ConfigHandler(BaseHandler): if host: # remote listing def on_response(cameras): if cameras is None: - self.finish_json({'error': True}) + self.finish_json({'error': 'Failed to list remote cameras.'}) else: self.finish_json({'cameras': cameras}) @@ -333,7 +333,13 @@ class ConfigHandler(BaseHandler): def on_response_builder(camera_id, camera_config): def on_response(remote_ui_config): if remote_ui_config is None: - length[0] -= 1 + #length[0] -= 1 + cameras.append({ + 'id': camera_id, + 'name': '<error>', + 'enabled': False, + 'streaming_framerate': 1 + }) else: remote_ui_config['id'] = camera_id diff --git a/static/css/ui.css b/static/css/ui.css index f54b56c..4bcbb17 100644 --- a/static/css/ui.css +++ b/static/css/ui.css @@ -367,7 +367,7 @@ span.dialog-item-label { div.popup-message-container { position: fixed; display: none; - z-index: 9999; + z-index: 10002; background-color: #313131; border-radius: 3px; opacity: 0; diff --git a/templates/main.html b/templates/main.html index e8e6894..6dc0b00 100644 --- a/templates/main.html +++ b/templates/main.html @@ -424,7 +424,7 @@ copyright © Calin Crisan 2013 - + {% endblock %} -- 2.39.5