From e9f59d5bce01471e0c98bbbda2485c1b8346b1b5 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 4 Oct 2015 19:08:39 +0300 Subject: [PATCH] fixed motion running setup mode --- motioneye/config.py | 2 +- motioneye/motionctl.py | 4 ++-- motioneye/static/js/main.js | 48 +++++++++++++++++++------------------ 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/motioneye/config.py b/motioneye/config.py index e8c0690..a050da2 100644 --- a/motioneye/config.py +++ b/motioneye/config.py @@ -817,7 +817,7 @@ def motion_camera_ui_to_dict(ui, old_config=None): data['ffmpeg_output_movies'] = True recording_mode = ui['recording_mode'] if recording_mode == 'motion-triggered': - data['emulate_motion'] = False + data['emulate_motion'] = False elif recording_mode == 'continuous': data['emulate_motion'] = True diff --git a/motioneye/motionctl.py b/motioneye/motionctl.py index 7cdffe1..bd79cbc 100644 --- a/motioneye/motionctl.py +++ b/motioneye/motionctl.py @@ -109,9 +109,9 @@ def start(deferred=False): motion_pid_path = os.path.join(settings.RUN_PATH, 'motion.pid') args = [program, - '-c', motion_config_path, '-n', - '-d'] + '-d', + '-c', motion_config_path] if settings.LOG_LEVEL == logging.DEBUG: args.append('9') diff --git a/motioneye/static/js/main.js b/motioneye/static/js/main.js index 540f25b..532787d 100644 --- a/motioneye/static/js/main.js +++ b/motioneye/static/js/main.js @@ -635,6 +635,8 @@ function initUI() { }); }); + /* various change handlers */ + $('#storageDeviceSelect').change(function () { $('#rootDirectoryEntry').val('/'); }); @@ -649,29 +651,6 @@ function initUI() { } }); - /* fetch & push handlers */ - $('#cameraSelect').focus(function () { - /* remember the previously selected index */ - this._prevSelectedIndex = this.selectedIndex; - - }).change(function () { - if ($('#cameraSelect').val() === 'add') { - runAddCameraDialog(); - this.selectedIndex = this._prevSelectedIndex; - } - else { - this._prevSelectedIndex = this.selectedIndex; - beginProgress([$(this).val()]); - fetchCurrentCameraConfig(endProgress); - } - }); - $('input.main-config, select.main-config, textarea.main-config').change(function () { - pushMainConfig($(this).parents('tr:eq(0)').attr('reboot') == 'true'); - }); - $('input.camera-config, select.camera-config, textarea.camera-config').change(function () { - pushCameraConfig($(this).parents('tr:eq(0)').attr('reboot') == 'true'); - }); - /* streaming framerate must be >= device framerate */ $('#framerateSlider').change(function () { var value = Number($('#framerateSlider').val()); @@ -709,6 +688,29 @@ function initUI() { updateConfigUI(); }); + /* fetch & push handlers */ + $('#cameraSelect').focus(function () { + /* remember the previously selected index */ + this._prevSelectedIndex = this.selectedIndex; + + }).change(function () { + if ($('#cameraSelect').val() === 'add') { + runAddCameraDialog(); + this.selectedIndex = this._prevSelectedIndex; + } + else { + this._prevSelectedIndex = this.selectedIndex; + beginProgress([$(this).val()]); + fetchCurrentCameraConfig(endProgress); + } + }); + $('input.main-config, select.main-config, textarea.main-config').change(function () { + pushMainConfig($(this).parents('tr:eq(0)').attr('reboot') == 'true'); + }); + $('input.camera-config, select.camera-config, textarea.camera-config').change(function () { + pushCameraConfig($(this).parents('tr:eq(0)').attr('reboot') == 'true'); + }); + /* preview controls */ $('#brightnessSlider').change(function () {pushPreview('brightness');}); $('#contrastSlider').change(function () {pushPreview('contrast');}); -- 2.39.5