From 39061038fb331369c12e984a08011a9fc7933a67 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 29 Oct 2018 14:40:05 -0400 Subject: [PATCH 1/7] Don't include related models in Storage index --- web/api/app/Controller/StorageController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/api/app/Controller/StorageController.php b/web/api/app/Controller/StorageController.php index 325dea4dd..16791788c 100644 --- a/web/api/app/Controller/StorageController.php +++ b/web/api/app/Controller/StorageController.php @@ -31,7 +31,7 @@ class StorageController extends AppController { * @return void */ public function index() { - $this->Storage->recursive = 0; + $this->Storage->recursive = -1; $options = ''; $storage_areas = $this->Storage->find('all',$options); From f95379742b325bfc5d9d8c28df46068a7b8400f3 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 30 Oct 2018 12:04:05 -0400 Subject: [PATCH 2/7] Use a warning colour when motion detection is disabled. --- web/skins/classic/css/base/skin.css | 12 ++++++------ web/skins/classic/views/console.php | 20 ++++++++++++-------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/web/skins/classic/css/base/skin.css b/web/skins/classic/css/base/skin.css index 3fdd5a12f..f95c0003e 100644 --- a/web/skins/classic/css/base/skin.css +++ b/web/skins/classic/css/base/skin.css @@ -341,17 +341,17 @@ fieldset > legend { /* * Behavior classes */ -.alarm, .errorText, .error { - color: #ff3f34; -} -.alert, .warnText, .warning { - color: #ffa801; -} .ok, .infoText { color: #0fb9b1; } +.alert, .warnText, .warning, .disabledText { + color: #ffa801; +} +.alarm, .errorText, .error { + color: #ff3f34; +} .fakelink { color: #7f7fb2; diff --git a/web/skins/classic/views/console.php b/web/skins/classic/views/console.php index 46575ffa0..6de978a6c 100644 --- a/web/skins/classic/views/console.php +++ b/web/skins/classic/views/console.php @@ -251,15 +251,19 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) { } } if ( $monitor['Function'] == 'None' ) - $fclass = 'errorText'; + $function_class = 'errorText'; else - $fclass = 'infoText'; - if ( !$monitor['Enabled'] ) - $fclass .= ' disabledText'; + $function_class = 'infoText'; + + $scale = max(reScale(SCALE_BASE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE), SCALE_BASE); $stream_available = canView('Stream') and $monitor['Type']=='WebSite' or ($monitor['CaptureFPS'] && $monitor['Function'] != 'None'); - $dot_class=$source_class; - if ( $fclass != 'infoText' ) $dot_class=$fclass; + $dot_class = $source_class; + if ( $function_class != 'infoText' ) { + $dot_class = $function_class; + } else if ( !$monitor['Enabled'] ) { + $dot_class .= ' warnText'; + } if ( ZM_WEB_ID_ON_CONSOLE ) { ?> @@ -268,7 +272,7 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) { } ?> - ' : '>') . $monitor['Name'] ?>
+ ' : '>') . $monitor['Name'] ?>
', array_map(function($group_id){ $Group = Group::find_one(array('Id'=>$group_id)); @@ -281,7 +285,7 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) { ?>
- '.translate('Fn'.$monitor['Function']).( empty($monitor['Enabled']) ? ', disabled' : '' ) .'', canEdit( 'Monitors' ) ) ?>
+ '.translate('Fn'.$monitor['Function']).( empty($monitor['Enabled']) ? ', disabled' : '' ) .'', canEdit('Monitors') ) ?>

Date: Tue, 30 Oct 2018 18:35:50 -0400 Subject: [PATCH 3/7] Fixes for a couple issues in the Ubuntu guide (#2285) * Xenial needs the ppa:iconnor/zoneminder repo Otherwise, trying to install the zoneminder package fails with an unmet dependency on php-apc. See https://forums.zoneminder.com/viewtopic.php?t=27638 for details. * Add necessary modules before configuring Apache When you add the zoneminder configuration before enabling mod_rewrite, subsequent commands (like the one to enable mod_cgi) give you an error like: AH00526: Syntax error on line 37 of /etc/apache2/conf-enabled/zoneminder.conf: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration --- docs/installationguide/ubuntu.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/installationguide/ubuntu.rst b/docs/installationguide/ubuntu.rst index 3df065264..6c686d7ed 100644 --- a/docs/installationguide/ubuntu.rst +++ b/docs/installationguide/ubuntu.rst @@ -49,7 +49,7 @@ guide you with a quick search. add-apt-repository ppa:iconnor/zoneminder-1.32 - If you are on trusty, you may want to add both, as there are some packages for dependencies included in the old ppa. + If you are on Trusty or Xenial, you may want to add both, as there are some packages for dependencies included in the old ppa. Update repo and upgrade. @@ -138,9 +138,9 @@ Set /etc/zm/zm.conf to root:www-data 740 and www-data access to content :: - a2enconf zoneminder a2enmod cgi a2enmod rewrite + a2enconf zoneminder You may also want to enable to following modules to improve caching performance From e87ded35f1b7f530abb013bcf351431ad4a03a92 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 31 Oct 2018 11:08:44 -0400 Subject: [PATCH 4/7] rough in adding Monitor_Status to Monitors --- web/api/app/Model/Monitor.php | 9 ++++- web/api/app/Model/Monitor_Status.php | 59 ++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 web/api/app/Model/Monitor_Status.php diff --git a/web/api/app/Model/Monitor.php b/web/api/app/Model/Monitor.php index 5c0f62641..2e6584794 100644 --- a/web/api/app/Model/Monitor.php +++ b/web/api/app/Model/Monitor.php @@ -116,8 +116,15 @@ class Monitor extends AppModel { 'OutputCodec' => array('h264','mjpeg','mpeg1','mpeg2'), 'OutputContainer' => array('auto','mp4','mkv'), 'DefaultView' => array('Events','Control'), - 'Status' => array('Unknown','NotRunning','Running','NoSignal','Signal'), + #'Status' => array('Unknown','NotRunning','Running','NoSignal','Signal'), ) ); + public $hasOne = array( + 'Monitor_Status' => array( + 'className' => 'Monitor_Status', + 'foreignKey' => 'MonitorId', + 'joinTable' => 'Monitor_Status', + ) + ); } diff --git a/web/api/app/Model/Monitor_Status.php b/web/api/app/Model/Monitor_Status.php new file mode 100644 index 000000000..40f4aa2c2 --- /dev/null +++ b/web/api/app/Model/Monitor_Status.php @@ -0,0 +1,59 @@ + array( + 'numeric' => array( + 'rule' => array('numeric'), + //'message' => 'Your custom message here', + //'allowEmpty' => false, + //'required' => false, + //'last' => false, // Stop validation after this rule + //'on' => 'create', // Limit validation to 'create' or 'update' operations + ), + ), + ); + + public $actsAs = array( + 'CakePHP-Enum-Behavior.Enum' => array( + 'Status' => array('Unknown','NotRunning','Running','NoSignal','Signal'), + ) + ); + + //The Associations below have been created with all possible keys, those that are not needed can be removed +} From 69f7d367296d16e11f3d6833bdbb6cca84444704 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 31 Oct 2018 11:34:30 -0400 Subject: [PATCH 5/7] Make it clear that audio recording is only for ffmpeg input type --- web/skins/classic/views/monitor.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index fa2ebd44f..979d4f34e 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -937,7 +937,15 @@ if ( $monitor->Type() == 'Local' ) { ?> - RecordAudio() ) { ?> checked="checked"/> + +Type() == 'Ffmpeg' ) { ?> + RecordAudio() ) { ?> checked="checked"/> + + Audio recording only available with FFMPEG + + + + Date: Wed, 31 Oct 2018 11:35:06 -0400 Subject: [PATCH 6/7] add further note about needing h264 passthrough --- web/skins/classic/views/monitor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index 979d4f34e..5142e4a96 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -941,7 +941,7 @@ if ( $monitor->Type() == 'Local' ) { Type() == 'Ffmpeg' ) { ?> RecordAudio() ) { ?> checked="checked"/> - Audio recording only available with FFMPEG + Audio recording only available with FFMPEG using H264 Passthrough From bdb50567df2787e52bca8bbb5f306a71c6871263 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 31 Oct 2018 11:56:08 -0400 Subject: [PATCH 7/7] fix disk_event_space to event_disk_space --- web/includes/Storage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/includes/Storage.php b/web/includes/Storage.php index 0744889f9..95f1dab84 100644 --- a/web/includes/Storage.php +++ b/web/includes/Storage.php @@ -189,7 +189,7 @@ class Storage { # This isn't a function like this in php, so we have to add up the space used in each event. if ( ( !array_key_exists('disk_used_space', $this)) or !$this->{'disk_used_space'} ) { if ( $this->{'Type'} == 's3fs' ) { - $this->{'disk_used_space'} = $this->disk_event_space(); + $this->{'disk_used_space'} = $this->event_disk_space(); } else { $path = $this->Path(); if ( file_exists($path) ) {