From f7a110a01873adb89ac1a12e656a998afed0a5b2 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 29 Sep 2013 12:56:03 +0300 Subject: [PATCH] got rid of base-site --- motioneye.py | 11 +- src/config.py | 2 +- src/motionctl.py | 2 +- static/css/base-site.css | 295 ------------------- static/css/main.css | 295 +++++++++++++++++++ static/js/{base-site.js => main.js} | 0 templates/base-site.html | 425 ---------------------------- templates/main.html | 425 +++++++++++++++++++++++++++- 8 files changed, 719 insertions(+), 736 deletions(-) delete mode 100644 static/css/base-site.css rename static/js/{base-site.js => main.js} (100%) delete mode 100644 templates/base-site.html diff --git a/motioneye.py b/motioneye.py index f62efd4..bd5e1ed 100644 --- a/motioneye.py +++ b/motioneye.py @@ -41,9 +41,9 @@ def _start_server(): if __name__ == '__main__': -# _configure_signals() -# _configure_logging() -# _start_server() + _configure_signals() + _configure_logging() + _start_server() # import config # main_config = config.get_main() @@ -53,6 +53,5 @@ if __name__ == '__main__': # #config.set_camera(1, data) # config.rem_camera(1) - import motionctl - - motionctl.start() +# import motionctl +# motionctl.start() diff --git a/src/config.py b/src/config.py index 86273d0..a87b4c4 100644 --- a/src/config.py +++ b/src/config.py @@ -477,7 +477,7 @@ def _set_default_motion_camera(data): data.setdefault('@network_share_name', '') data.setdefault('@network_username', '') data.setdefault('@network_password', '') - data.setdefault('target_dir', '.') + data.setdefault('target_dir', settings.RUN_PATH) data.setdefault('webcam_localhost', False) data.setdefault('webcam_port', 8080) diff --git a/src/motionctl.py b/src/motionctl.py index 507f584..6c7cce1 100644 --- a/src/motionctl.py +++ b/src/motionctl.py @@ -35,7 +35,7 @@ def start(): log_file = open(motion_log_path, 'w') process = subprocess.Popen(args, stdout=log_file, stderr=log_file, close_fds=True, - cwd=settings.RUN_PATH) + cwd=settings.CONF_PATH) # wait 2 seconds to see that the process has successfully started for i in xrange(20): # @UnusedVariable diff --git a/static/css/base-site.css b/static/css/base-site.css deleted file mode 100644 index c104b06..0000000 --- a/static/css/base-site.css +++ /dev/null @@ -1,295 +0,0 @@ - - - /* fonts */ - -@font-face { - font-family: 'Maven Pro'; - src: url('../fnt/mavenpro-regular-webfont.eot'); - src: url('../fnt/mavenpro-regular-webfont.eot?#iefix') format('embedded-opentype'), - url('../fnt/mavenpro-regular-webfont.woff') format('woff'), - url('../fnt/mavenpro-regular-webfont.ttf') format('truetype'), - url('../fnt/mavenpro-regular-webfont.svg#maven_proregular') format('svg'); - font-weight: normal; - font-style: normal; -} - -@font-face { - font-family: 'Maven Pro'; - src: url('../fnt/mavenpro-bold-webfont.eot'); - src: url('../fnt/mavenpro-bold-webfont.eot?#iefix') format('embedded-opentype'), - url('../fnt/mavenpro-bold-webfont.woff') format('woff'), - url('../fnt/mavenpro-bold-webfont.ttf') format('truetype'), - url('../fnt/mavenpro-bold-webfont.svg#maven_probold') format('svg'); - font-weight: bold; - font-style: normal; -} - - - /* layout */ - -html { - font-family: 'Maven Pro'; -} - -div.page, -div.header-container { - position: relative; - min-width: 320px; - width: 100%; -} - -div.page { - margin-top: 50px; - padding-bottom: 20px; - font-size: 1em; - transition: all 0.5s linear; -} - -div.header { - background-color: rgba(64, 64, 64, 0.5); - top: 0px; - width: 100%; - height: 50px; - position: fixed; - overflow: hidden; - z-index: 10000; -} - -div.header-container { - transition: all 0.5s linear; -} - -div.footer { - position: absolute; - bottom: 0px; - width: 100%; - height: 20px; - font-size: 0.5em; - color: #aaa; - text-align: center; -} - -div.page-container { - transition: all 0.2s linear; - padding: 5px; -} - -div.page-container.stretched { - margin-left: 40%; -} - - - /* settings */ - -div.settings { - background-color: #313131; - position: fixed; - z-index: 1; - top: 50px; - left: 0px; - width: 0px; - height: 100%; - transition: all 0.2s linear; - overflow: auto; -} - -div.settings.open { - width: 40%; - min-width: 320px; -} - -div.settings-container { - padding-top: 10px; - padding-bottom: 60px; - display: none; - white-space: nowrap; -} - -div.settings.open div.settings-container { - display: block; -} - -div.settings-top-bar { - position: relative; - display: inline-block; - width: 40%; - height: 50px; -} - -div.settings-top-bar.open { - background-color: #414141; - min-width: 320px; -} - -div.settings-section-title { - position: relative; - text-align: right; - background-color: rgba(100, 100, 100, 0.3); - padding: 5px; -} - -table.settings { - width: 100%; - padding: 0.5em 0.5em 1em 0.5em; -} - -td.settings-item-label { - width: 50%; - text-align: right; - padding-right: 5px; -} - -td.settings-item-value { - width: 50%; - text-align: left; - padding-left: 5px; -} - -span.settings-item-label { - font-size: 0.9em; -} - -span.settings-item-unit { - font-size: 0.6em; - padding: 0px 0.2em; -} - -div.settings-item-separator { - height: 1px; - border-top: 1px solid #414141; - margin: 5px 0px; -} - -select.video-device { - display: none; - padding: 4px 1.5em 4px 4px; - vertical-align: middle; - font-size: 20px; - width: auto; - max-width: 40%; -} - -div.apply-button { - position: relative; - display: none; - opacity: 0; - float: right; - width: 80px; - height: 30px; - line-height: 30px; - text-align: center; - margin: 10px; - color: white; - font-weight: bold; - font-size: 17px; - background-color: #FF6F00; - border-radius: 3px; - transition: all 0.1s linear; -} - -div.apply-button:HOVER { - background-color: #FF7D19; -} - -div.apply-button:ACTIVE { - background-color: #F06800; -} - -div.apply-button.progress { - background-color: #FF6F00; -} - -img.apply-progress { - margin-top: 3px; -} - -div.settings-top-bar.open select.video-device { - display: inline; -} - -div.check-box.section { - margin: 0px; - float: left; -} - -div.check-box.section div.check-box-button { - background-color: #515151; -} - -div.check-box.on.section div.check-box-button { - background-color: #3498db; -} - -input[type=text].working-schedule.number { - width: 50px; -} - - - /* media queries */ - -@media all and (max-width: 1440px) { - /* smaller screens */ - - body { - font-size: 17px; - } -} - -@media all and (max-width: 1000px) { - /* small screens (mobile devices) */ - - div.page-container.stretched { - margin-left: 0px; - } - - div.settings.open { - box-shadow: 0px 0px 10px rgba(0,0,0,0.5); - background-color: rgba(40, 40, 40, 0.9); - } -} - -@media all and (max-width: 400px) { - /* very small screens */ - - body { - font-size: 13px; - } -} - - - /* links */ - -a { - color: inherit; - text-decoration: inherit; -} - - - /* icons */ - -img.settings-button { - margin: 2px; - cursor: pointer; - vertical-align: middle; -} - -div.logo { - float: right; - display: inline-block; - white-space: nowrap; - opacity: 0.86; -} - -span.logo { - vertical-align: middle; - font-size: 27px; - font-weight: bold; - position: relative; - top: 3px; -} - -img.logo { - width: 48px; - height: 48px; - vertical-align: middle; -} diff --git a/static/css/main.css b/static/css/main.css index 6214374..a4994e2 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -1,4 +1,232 @@ + + /* fonts */ + +@font-face { + font-family: 'Maven Pro'; + src: url('../fnt/mavenpro-regular-webfont.eot'); + src: url('../fnt/mavenpro-regular-webfont.eot?#iefix') format('embedded-opentype'), + url('../fnt/mavenpro-regular-webfont.woff') format('woff'), + url('../fnt/mavenpro-regular-webfont.ttf') format('truetype'), + url('../fnt/mavenpro-regular-webfont.svg#maven_proregular') format('svg'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: 'Maven Pro'; + src: url('../fnt/mavenpro-bold-webfont.eot'); + src: url('../fnt/mavenpro-bold-webfont.eot?#iefix') format('embedded-opentype'), + url('../fnt/mavenpro-bold-webfont.woff') format('woff'), + url('../fnt/mavenpro-bold-webfont.ttf') format('truetype'), + url('../fnt/mavenpro-bold-webfont.svg#maven_probold') format('svg'); + font-weight: bold; + font-style: normal; +} + + + /* layout */ + +html { + font-family: 'Maven Pro'; +} + +div.page, +div.header-container { + position: relative; + min-width: 320px; + width: 100%; +} + +div.page { + margin-top: 50px; + padding-bottom: 20px; + font-size: 1em; + transition: all 0.5s linear; +} + +div.header { + background-color: rgba(64, 64, 64, 0.5); + top: 0px; + width: 100%; + height: 50px; + position: fixed; + overflow: hidden; + z-index: 10000; +} + +div.header-container { + transition: all 0.5s linear; +} + +div.footer { + position: absolute; + bottom: 0px; + width: 100%; + height: 20px; + font-size: 0.5em; + color: #aaa; + text-align: center; +} + +div.page-container { + transition: all 0.2s linear; + padding: 5px; +} + +div.page-container.stretched { + margin-left: 40%; +} + + + /* settings */ + +div.settings { + background-color: #313131; + position: fixed; + z-index: 1; + top: 50px; + left: 0px; + width: 0px; + height: 100%; + transition: all 0.2s linear; + overflow: auto; +} + +div.settings.open { + width: 40%; + min-width: 320px; +} + +div.settings-container { + padding-top: 10px; + padding-bottom: 60px; + display: none; + white-space: nowrap; +} + +div.settings.open div.settings-container { + display: block; +} + +div.settings-top-bar { + position: relative; + display: inline-block; + width: 40%; + height: 50px; +} + +div.settings-top-bar.open { + background-color: #414141; + min-width: 320px; +} + +div.settings-section-title { + position: relative; + text-align: right; + background-color: rgba(100, 100, 100, 0.3); + padding: 5px; +} + +table.settings { + width: 100%; + padding: 0.5em 0.5em 1em 0.5em; +} + +td.settings-item-label { + width: 50%; + text-align: right; + padding-right: 5px; +} + +td.settings-item-value { + width: 50%; + text-align: left; + padding-left: 5px; +} + +span.settings-item-label { + font-size: 0.9em; +} + +span.settings-item-unit { + font-size: 0.6em; + padding: 0px 0.2em; +} + +div.settings-item-separator { + height: 1px; + border-top: 1px solid #414141; + margin: 5px 0px; +} + +select.video-device { + display: none; + padding: 4px 1.5em 4px 4px; + vertical-align: middle; + font-size: 20px; + width: auto; + max-width: 40%; +} + +div.apply-button { + position: relative; + display: none; + opacity: 0; + float: right; + width: 80px; + height: 30px; + line-height: 30px; + text-align: center; + margin: 10px; + color: white; + font-weight: bold; + font-size: 17px; + background-color: #FF6F00; + border-radius: 3px; + transition: all 0.1s linear; +} + +div.apply-button:HOVER { + background-color: #FF7D19; +} + +div.apply-button:ACTIVE { + background-color: #F06800; +} + +div.apply-button.progress { + background-color: #FF6F00; +} + +img.apply-progress { + margin-top: 3px; +} + +div.settings-top-bar.open select.video-device { + display: inline; +} + +div.check-box.section { + margin: 0px; + float: left; +} + +div.check-box.section div.check-box-button { + background-color: #515151; +} + +div.check-box.on.section div.check-box-button { + background-color: #3498db; +} + +input[type=text].working-schedule.number { + width: 50px; +} + + + /* camera frames */ + div.video-list { text-align: center; } @@ -71,6 +299,35 @@ img.video { /* media queries */ +@media all and (max-width: 1440px) { + /* smaller screens */ + + body { + font-size: 17px; + } +} + +@media all and (max-width: 1000px) { + /* small screens (mobile devices) */ + + div.page-container.stretched { + margin-left: 0px; + } + + div.settings.open { + box-shadow: 0px 0px 10px rgba(0,0,0,0.5); + background-color: rgba(40, 40, 40, 0.9); + } +} + +@media all and (max-width: 400px) { + /* very small screens */ + + body { + font-size: 13px; + } +} + @media all and (max-width: 1900px) { /* a bit smaller screens */ @@ -86,3 +343,41 @@ img.video { width: 98%; } } + + + /* links */ + +a { + color: inherit; + text-decoration: inherit; +} + + + /* icons */ + +img.settings-button { + margin: 2px; + cursor: pointer; + vertical-align: middle; +} + +div.logo { + float: right; + display: inline-block; + white-space: nowrap; + opacity: 0.86; +} + +span.logo { + vertical-align: middle; + font-size: 27px; + font-weight: bold; + position: relative; + top: 3px; +} + +img.logo { + width: 48px; + height: 48px; + vertical-align: middle; +} diff --git a/static/js/base-site.js b/static/js/main.js similarity index 100% rename from static/js/base-site.js rename to static/js/main.js diff --git a/templates/base-site.html b/templates/base-site.html deleted file mode 100644 index 6ac6e03..0000000 --- a/templates/base-site.html +++ /dev/null @@ -1,425 +0,0 @@ -{% extends "base.html" %} - -{% block style %} - {{super()}} - - -{% endblock %} - -{% block script %} - {{super()}} - - -{% endblock %} - -{% block body %} -
-
-
- - -
Apply
-
- -
-
-
-
-
-
General Settings
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Show Advanced Settings?
Administrator Username?
Administrator Password?
Surveillance Username?
Surveillance Password?
- -
Video Device
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Camera Name?
Camera Device
Light Switch Detection?
Automatic Brightness?
Brightness?
Contrast?
Saturation?
Hue?
Video Resolution - - ?
Video Rotation - - ?
Frame Rate?
- -
File Storage
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Storage Device - - ?
Network Server?
Share Name?
Share Username?
Share Password?
Root Directory?
- -
Text Overlay
- - - - - - - - - - - - - - - - - - - - - -
Left Text - - ?
?
Right Text - - ?
?
- -
Video Streaming
- - - - - - - - - - - - - - - - - - - - - -
Streaming Frame Rate?
Streaming Quality?
Streaming Port?
Motion Optimization?
- -
Still Images
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Image File Name?
Image Quality?
Capture Mode - - ?
Snapshot Intervalseconds?
Preserve Images - - ?
- -
Motion Movies
- - - - - - - - - - - - - - - - -
Movie File Name?
Movie Quality?
Preserve Movies - - ?
- -
Motion Detection
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Show Frame Changes?
Frame Change Threshold?
Automatic Noise Detection?
Noise Level?
Motion Gapseconds?
Captured Beforeframes?
Captured Afterframes?
- -
Motion Notifications
- - - - - - -
Email Addresses?
- -
Working Schedule
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Monday - from - to - ?
Tuesday - from - to - ?
Wednesday - from - to - ?
Thursday - from - to - ?
Friday - from - to - ?
Saturday - from - to - ?
Sunday - from - to - ?
-
-
-
- {% block page_content %}{% endblock %} -
- -
-{% endblock %} diff --git a/templates/main.html b/templates/main.html index fd8a865..afba521 100644 --- a/templates/main.html +++ b/templates/main.html @@ -1,16 +1,425 @@ -{% extends "base-site.html" %} -{% import "macros.html" as macros %} +{% extends "base.html" %} {% block style %} {{super()}} + {% endblock %} -{% block page_content %} -
- {{macros.video("/static/img/video1.jpg")}} - {{macros.video("/static/img/video2.jpg")}} - {{macros.video("/static/img/video1.jpg")}} - {{macros.video("/static/img/video2.jpg")}} +{% block script %} + {{super()}} + + +{% endblock %} + +{% block body %} +
+
+
+ + +
Apply
+
+ +
+
+
+
+
+
General Settings
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Show Advanced Settings?
Administrator Username?
Administrator Password?
Surveillance Username?
Surveillance Password?
+ +
Video Device
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Camera Name?
Camera Device
Light Switch Detection?
Automatic Brightness?
Brightness?
Contrast?
Saturation?
Hue?
Video Resolution + + ?
Video Rotation + + ?
Frame Rate?
+ +
File Storage
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Storage Device + + ?
Network Server?
Share Name?
Share Username?
Share Password?
Root Directory?
+ +
Text Overlay
+ + + + + + + + + + + + + + + + + + + + + +
Left Text + + ?
?
Right Text + + ?
?
+ +
Video Streaming
+ + + + + + + + + + + + + + + + + + + + + +
Streaming Frame Rate?
Streaming Quality?
Streaming Port?
Motion Optimization?
+ +
Still Images
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Image File Name?
Image Quality?
Capture Mode + + ?
Snapshot Intervalseconds?
Preserve Images + + ?
+ +
Motion Movies
+ + + + + + + + + + + + + + + + +
Movie File Name?
Movie Quality?
Preserve Movies + + ?
+ +
Motion Detection
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Show Frame Changes?
Frame Change Threshold?
Automatic Noise Detection?
Noise Level?
Motion Gapseconds?
Captured Beforeframes?
Captured Afterframes?
+ +
Motion Notifications
+ + + + + + +
Email Addresses?
+ +
Working Schedule
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Monday + from + to + ?
Tuesday + from + to + ?
Wednesday + from + to + ?
Thursday + from + to + ?
Friday + from + to + ?
Saturday + from + to + ?
Sunday + from + to + ?
+
+
+
+ {% block page_content %}{% endblock %} +
+
{% endblock %} -- 2.39.5