diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 934e77bdb..0e215bae9 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -701,7 +701,7 @@ CREATE TABLE `Storage` ( -- -- Create a default storage location -- -insert into Storage VALUES (NULL, '/var/cache/zoneminder/events', 'Default', 'local', NULL ); +insert into Storage VALUES (NULL, '/var/cache/zoneminder/events', 'Default', 'local', NULL, 'Medium', 0 ); /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -723,22 +723,6 @@ insert into Users VALUES (NULL,'admin',password('admin'),'',1,'View','Edit','Edi -- -- Add a sample filter to purge the oldest 100 events when the disk is 95% full -- - `Id` int(10) unsigned NOT NULL auto_increment, - `Name` varchar(64) NOT NULL default '', - `Query` text NOT NULL, - `AutoArchive` tinyint(3) unsigned NOT NULL default '0', - `AutoVideo` tinyint(3) unsigned NOT NULL default '0', - `AutoUpload` tinyint(3) unsigned NOT NULL default '0', - `AutoEmail` tinyint(3) unsigned NOT NULL default '0', - `AutoMessage` tinyint(3) unsigned NOT NULL default '0', - `AutoExecute` tinyint(3) unsigned NOT NULL default '0', - `AutoExecuteCmd` tinytext, - `AutoDelete` tinyint(3) unsigned NOT NULL default '0', - `AutoMove` tinyint(3) unsigned NOT NULL default '0', - `AutoMoveTo` smallint(5) unsigned NOT NULL default 0, - `UpdateDiskSpace` tinyint(3) unsigned NOT NULL default '0', - `Background` tinyint(1) unsigned NOT NULL default '0', - `Concurrent` tinyint(1) unsigned NOT NULL default '0', insert into Filters values (NULL,'PurgeWhenFull','{"sort_field":"Id","terms":[{"val":0,"attr":"Archived","op":"="},{"cnj":"and","val":95,"attr":"DiskPercent","op":">="}],"limit":100,"sort_asc":1}',0/*AutoArchive*/,0/*AutoVideo*/,0/*AutoUpload*/,0/*AutoEmail*/,0/*AutoMessage*/,0/*AutoExecute*/,'',1/*AutoDelete*/,0/*AutoMove*/,0/*MoveTo*/,0/*UpdateDiskSpace*/,1/*Background*/,0/*Concurrent*/); insert into Filters values (NULL,'Update DiskSpace','{"terms":[{"attr":"DiskSpace","op":"IS","val":"NULL"}]}',0,0,0,0,0,0,'',0,0,0,1,1,0); diff --git a/db/zm_update-1.31.20.sql b/db/zm_update-1.31.20.sql index 4f0d9ee47..358f15093 100644 --- a/db/zm_update-1.31.20.sql +++ b/db/zm_update-1.31.20.sql @@ -244,3 +244,32 @@ SET @s = (SELECT IF( PREPARE stmt FROM @s; EXECUTE stmt; + +UPDATE Monitors INNER JOIN ( + SELECT MonitorId, + COUNT(Id) AS TotalEvents, + SUM(DiskSpace) AS TotalEventDiskSpace, + SUM(IF(Archived,1,0)) AS ArchivedEvents, + SUM(IF(Archived,DiskSpace,0)) AS ArchivedEventDiskSpace, + SUM(IF(StartTime > DATE_SUB(NOW(), INTERVAL 1 hour),1,0)) AS HourEvents, + SUM(IF(StartTime > DATE_SUB(NOW(), INTERVAL 1 hour),DiskSpace,0)) AS HourEventDiskSpace, + SUM(IF(StartTime > DATE_SUB(NOW(), INTERVAL 1 day),1,0)) AS DayEvents, + SUM(IF(StartTime > DATE_SUB(NOW(), INTERVAL 1 day),DiskSpace,0)) AS DayEventDiskSpace, + SUM(IF(StartTime > DATE_SUB(NOW(), INTERVAL 1 week),1,0)) AS WeekEvents, + SUM(IF(StartTime > DATE_SUB(NOW(), INTERVAL 1 week),DiskSpace,0)) AS WeekEventDiskSpace, + SUM(IF(StartTime > DATE_SUB(NOW(), INTERVAL 1 month),1,0)) AS MonthEvents, + SUM(IF(StartTime > DATE_SUB(NOW(), INTERVAL 1 month),DiskSpace,0)) AS MonthEventDiskSpace + FROM Events GROUP BY MonitorId + ) AS E ON E.MonitorId=Monitors.Id SET + Monitors.TotalEvents = E.TotalEvents, + Monitors.TotalEventDiskSpace = E.TotalEventDiskSpace, + Monitors.ArchivedEvents = E.ArchivedEvents, + Monitors.ArchivedEventDiskSpace = E.ArchivedEventDiskSpace, + Monitors.HourEvents = E.HourEvents, + Monitors.HourEventDiskSpace = E.HourEventDiskSpace, + Monitors.DayEvents = E.DayEvents, + Monitors.DayEventDiskSpace = E.DayEventDiskSpace, + Monitors.WeekEvents = E.WeekEvents, + Monitors.WeekEventDiskSpace = E.WeekEventDiskSpace, + Monitors.MonthEvents = E.MonthEvents, + Monitors.MonthEventDiskSpace = E.MonthEventDiskSpace; diff --git a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in index 923654b31..00015ae24 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in @@ -1451,6 +1451,17 @@ our @options = ( type => $types{boolean}, category => 'logging', }, + { + name => 'ZM_WEB_TITLE', + default => 'ZoneMinder', + description => 'The title displayed wherever the site references itself.', + help => q` + If you want the site to identify as something other than ZoneMinder, change this here. + It can be used to more accurately identify this installation from others. + `, + type => $types{string}, + category => 'web', + }, { name => 'ZM_WEB_TITLE_PREFIX', default => 'ZM', @@ -1464,6 +1475,27 @@ our @options = ( type => $types{string}, category => 'web', }, + { + name => 'ZM_HOME_URL', + default => 'http://zoneminder.com', + description => 'The url used in the home/logo area of the navigation bar.', + help => q` + By default this takes you to the zoneminder.com website, + but perhaps you would prefer it to take you somewhere else. + `, + type => $types{string}, + category => 'web', + }, + { + name => 'ZM_HOME_CONTENT', + default => 'ZoneMinder', + description => 'The content of the home button.', + help => q` + You may wish to set this to empty if you are using css to put a background image on it. + `, + type => $types{string}, + category => 'web', + }, { name => 'ZM_WEB_CONSOLE_BANNER', default => '', diff --git a/web/includes/functions.php b/web/includes/functions.php index 97c0f1919..2a00e6d2c 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -2145,7 +2145,8 @@ function cache_bust( $file ) { # To defeat caching. Should probably use md5 hash $parts = pathinfo($file); global $css; - $cacheFile = 'cache/'.$parts['filename'].'-'.$css.'-'.filemtime($file).'.'.$parts['extension']; + $dirname = preg_replace( '/\//', '_', $parts['dirname'] ); + $cacheFile = 'cache/'.$dirname.'_'.$parts['filename'].'-'.$css.'-'.filemtime($file).'.'.$parts['extension']; if ( file_exists( ZM_PATH_WEB.'/'.$cacheFile ) or symlink( ZM_PATH_WEB.'/'.$file, ZM_PATH_WEB.'/'.$cacheFile ) ) { return $cacheFile; } else { diff --git a/web/skins/classic/css/classic/views/options.css b/web/skins/classic/css/classic/views/options.css index f7123086c..9d5b5ea94 100644 --- a/web/skins/classic/css/classic/views/options.css +++ b/web/skins/classic/css/classic/views/options.css @@ -1,3 +1,7 @@ +#options { + padding-top: 10px; + +} input.small { width: 6em; } diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index e6a0e1fe4..d5207b99b 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -19,14 +19,14 @@ // -// Don't load in additional JS to these views -$bad_views = array('monitor', 'log'); - function xhtmlHeaders( $file, $title ) { global $css; global $skin; - $skinCssFile = getSkinFile( 'css/'.$css.'/skin.css' ); - $skinCssFilejquery = getSkinFile( 'css/'.$css.'/jquery-ui-theme.css' ); + + # This idea is that we always include the classic css files, + # and then any different skin only needs to contain things that are different. + $baseCssPhpFile = getSkinFile( 'css/classic/skin.css.php' ); + $skinCssPhpFile = getSkinFile( 'css/'.$css.'/skin.css.php' ); $skinJsFile = getSkinFile( 'js/skin.js' ); @@ -34,7 +34,7 @@ function xhtmlHeaders( $file, $title ) { $cssJsFile = getSkinFile( 'js/'.$css.'.js' ); $basename = basename( $file, '.php' ); - $viewCssFile = getSkinFile( '/css/'.$css.'/views/'.$basename.'.css' ); + if ($basename == 'watch') { $viewCssFileExtra = getSkinFile( '/css/'.$css.'/views/control.css' ); } @@ -43,6 +43,16 @@ function xhtmlHeaders( $file, $title ) { $viewJsPhpFile = getSkinFile( 'views/js/'.$basename.'.js.php' ); extract( $GLOBALS, EXTR_OVERWRITE ); + function output_link_if_exists( $files ) { + global $skin; + $html = array(); + foreach ( $files as $file ) { + if ( getSkinFile( $file ) ) { + $html[] = ''; + } + } + return implode("\n", $html); + } ?> @@ -66,15 +76,20 @@ if ( file_exists( "skins/$skin/css/$css/graphics/favicon.ico" ) ) { - - - - - @@ -92,6 +107,7 @@ if ( file_exists( "skins/$skin/css/$css/graphics/favicon.ico" ) ) { + @@ -101,9 +117,6 @@ if ( file_exists( "skins/$skin/css/$css/graphics/favicon.ico" ) ) { - - -