From: Calin Crisan <ccrisan@gmail.com> Date: Sat, 23 May 2015 07:25:16 +0000 (+0300) Subject: added a settings option to disable adding/removing cameras X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=53d665a92fe78f869ea10773c2bbc3e176010ee2;p=motioneye-debian added a settings option to disable adding/removing cameras --- diff --git a/settings_default.py b/settings_default.py index 69b3b27..0c14b80 100644 --- a/settings_default.py +++ b/settings_default.py @@ -79,3 +79,6 @@ SMTP_TIMEOUT = 60 # the time to wait for zip file creation ZIP_TIMEOUT = 500 + +# enable adding and removing cameras from UI +ADD_REMOVE_CAMERAS = True diff --git a/src/handlers.py b/src/handlers.py index 382fd86..e33c635 100644 --- a/src/handlers.py +++ b/src/handlers.py @@ -152,6 +152,7 @@ class MainHandler(BaseHandler): version=motioneye.VERSION, enable_update=False, enable_reboot=settings.ENABLE_REBOOT, + add_remove_cameras=settings.ADD_REMOVE_CAMERAS, main_sections=main_sections, camera_sections=camera_sections, hostname=socket.gethostname(), diff --git a/templates/main.html b/templates/main.html index 968a70b..71bddee 100644 --- a/templates/main.html +++ b/templates/main.html @@ -78,8 +78,8 @@ <div class="settings-top-bar closed"> <div class="button settings-button mouse-effect" title="settings"></div> <div class="button logout-button mouse-effect" title="switch user"></div> - <select class="styled" id="cameraSelect"></select> - <div class="button rem-camera-button mouse-effect" id="remCameraButton" title="remove camera"></div> + <select class="styled" id="cameraSelect" {% if not add_remove_cameras %}style="display: none;"{% endif %}></select> + <div class="button rem-camera-button mouse-effect" id="remCameraButton" title="remove camera" {% if not add_remove_cameras %}style="display: none;"{% endif %}></div> <div class="button apply-button" id="applyButton">Apply</div> {% if hostname %}<div class="hostname">{{hostname}}</div>{% endif %} </div>