]> www.vanbest.org Git - motioneye-debian/commitdiff
on_event_end post-merge minor fixes
authorCalin Crisan <ccrisan@gmail.com>
Sat, 5 Aug 2017 16:50:28 +0000 (19:50 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sat, 5 Aug 2017 16:50:28 +0000 (19:50 +0300)
motioneye/config.py
motioneye/static/js/main.js
motioneye/templates/main.html

index 9c36b9b8917427e442771b675d3b202a286aecda..254894803ec9fc1cf81c9a68f5409eed9300c7dd 100644 (file)
@@ -1045,8 +1045,8 @@ def motion_camera_ui_to_dict(ui, old_config=None):
     # event end
     on_event_end = ['%(script)s stop %%t' % {'script': meyectl.find_command('relayevent')}]
 
-    if ui['command_post_notifications_enabled']:
-        on_event_end += utils.split_semicolon(ui['command_post_notifications_exec'])
+    if ui['command_end_notifications_enabled']:
+        on_event_end += utils.split_semicolon(ui['command_end_notifications_exec'])
     
     data['on_event_end'] = '; '.join(on_event_end)
 
@@ -1193,7 +1193,7 @@ def motion_camera_dict_to_ui(data):
         'email_notifications_enabled': False,
         'web_hook_notifications_enabled': False,
         'command_notifications_enabled': False,
-        'command_post_notifications_enabled': False,
+        'command_end_notifications_enabled': False,
         
         # working schedule
         'working_schedule': False,
@@ -1472,18 +1472,17 @@ def motion_camera_dict_to_ui(data):
     if on_event_end:
         on_event_end = utils.split_semicolon(on_event_end)
 
-    command_post_notifications = []
+    command_end_notifications = []
     for e in on_event_end:
         if e.count('relayevent') or e.count('eventrelay.py'):
-            continue # ignore internal relay script
-
-        else: # custom command
-            command_post_notifications.append(e)
+            continue  # ignore internal relay script
 
-    if command_post_notifications:
-        ui['command_post_notifications_enabled'] = True
-        ui['command_post_notifications_exec'] = '; '.join(command_post_notifications)
+        else:  # custom command
+            command_end_notifications.append(e)
 
+    if command_end_notifications:
+        ui['command_end_notifications_enabled'] = True
+        ui['command_end_notifications_exec'] = '; '.join(command_end_notifications)
 
     # movie end
     on_movie_end = data.get('on_movie_end') or []
index fbfbeb9fe7267adce603ba4089ab447f61b9a627..56b01397df01374da64f4cee862b60262559b099 100644 (file)
@@ -1921,8 +1921,8 @@ function cameraUi2Dict() {
         'web_hook_notifications_http_method': $('#webHookNotificationsHttpMethodSelect').val(),
         'command_notifications_enabled': $('#commandNotificationsEnabledSwitch')[0].checked,
         'command_notifications_exec': $('#commandNotificationsEntry').val(),
-        'command_post_notifications_enabled': $('#commandPostNotificationsEnabledSwitch')[0].checked,
-        'command_post_notifications_exec': $('#commandPostNotificationsEntry').val(),
+        'command_end_notifications_enabled': $('#commandEndNotificationsEnabledSwitch')[0].checked,
+        'command_end_notifications_exec': $('#commandEndNotificationsEntry').val(),
         
         /* working schedule */
         'working_schedule': $('#workingScheduleEnabledSwitch')[0].checked,
@@ -2280,8 +2280,8 @@ function dict2CameraUi(dict) {
     
     $('#commandNotificationsEnabledSwitch')[0].checked = dict['command_notifications_enabled']; markHideIfNull('command_notifications_enabled', 'commandNotificationsEnabledSwitch');
     $('#commandNotificationsEntry').val(dict['command_notifications_exec']);
-    $('#commandPostNotificationsEnabledSwitch')[0].checked = dict['command_post_notifications_enabled']; markHideIfNull('command_post_notifications_enabled', 'commandPostNotificationsEnabledSwitch');
-    $('#commandPostNotificationsEntry').val(dict['command_post_notifications_exec']);
+    $('#commandEndNotificationsEnabledSwitch')[0].checked = dict['command_end_notifications_enabled']; markHideIfNull('command_end_notifications_enabled', 'commandEndNotificationsEnabledSwitch');
+    $('#commandEndNotificationsEntry').val(dict['command_end_notifications_exec']);
 
     /* working schedule */
     $('#workingScheduleEnabledSwitch')[0].checked = dict['working_schedule']; markHideIfNull('working_schedule', 'workingScheduleEnabledSwitch');
index 552a543cb240d0606763d363cee82a93a22d3201..27cc16a5f1e8396c1f2c82b0e4f49e64e3503bda 100644 (file)
                     <tr class="settings-item advanced-setting" required="true" depends="commandNotificationsEnabled motionDetectionEnabled" strip="true">
                         <td class="settings-item-label"><span class="settings-item-label">Command</span></td>
                         <td class="settings-item-value"><input type="text" class="styled notifications camera-config" id="commandNotificationsEntry" placeholder="command..."></td>
-                        <td><span class="help-mark" title="a command to be executed when motion is detected; multiple commands can be separated by a semicolon; don't use semilcolons inside commands; the following special tokens are accepted: %Y = year, %m = month, %d = day, %H = hour, %M = minute, %S = second, %q = frame number, %v = event number">?</span></td>
+                        <td><span class="help-mark" title="a command to be executed when motion is detected; multiple commands can be separated by a semicolon; don't use semicolons inside commands; the following special tokens are accepted: %Y = year, %m = month, %d = day, %H = hour, %M = minute, %S = second, %q = frame number, %v = event number">?</span></td>
                     </tr>
                     <tr class="settings-item advanced-setting" depends="motionDetectionEnabled">
                         <td colspan="100"><div class="settings-item-separator"></div></td>
                     </tr>
                     <tr class="settings-item advanced-setting" depends="motionDetectionEnabled">
-                        <td class="settings-item-label"><span class="settings-item-label">Run A Post Command</span></td>
-                        <td class="settings-item-value"><input type="checkbox" class="styled notifications camera-config" id="commandPostNotificationsEnabledSwitch"></td>
-                        <td><span class="help-mark" title="enable this if you want to execute a command whenever a motion event is finished">?</span></td>
+                        <td class="settings-item-label"><span class="settings-item-label">Run An End Command</span></td>
+                        <td class="settings-item-value"><input type="checkbox" class="styled notifications camera-config" id="commandEndNotificationsEnabledSwitch"></td>
+                        <td><span class="help-mark" title="enable this if you want to execute a command whenever a motion event ends">?</span></td>
                     </tr>
-                    <tr class="settings-item advanced-setting" required="true" depends="commandPostNotificationsEnabled motionDetectionEnabled" strip="true">
+                    <tr class="settings-item advanced-setting" required="true" depends="commandEndNotificationsEnabled motionDetectionEnabled" strip="true">
                         <td class="settings-item-label"><span class="settings-item-label">Command</span></td>
-                        <td class="settings-item-value"><input type="text" class="styled notifications camera-config" id="commandPostNotificationsEntry" placeholder="command..."></td>
-                        <td><span class="help-mark" title="a command to be executed when motion event is finished; multiple commands can be separated by a semicolon; don't use semilcolons inside commands; the following special tokens are accepted: %Y = year, %m = month, %d = date, %H = hour, %M = minute, %S = second, %q = frame number">?</span></td>
+                        <td class="settings-item-value"><input type="text" class="styled notifications camera-config" id="commandEndNotificationsEntry" placeholder="command..."></td>
+                        <td><span class="help-mark" title="a command to be executed when motion event ends; multiple commands can be separated by a semicolon; don't use semicolons inside commands; the following special tokens are accepted: %Y = year, %m = month, %d = date, %H = hour, %M = minute, %S = second, %q = frame number">?</span></td>
                     </tr>
                     {% for config in camera_sections.get('notifications', {}).get('configs', []) %}
                         {{config_item(config, "motionDetectionEnabled")}}