Merge branch 'storageareas' of github.com:ConnorTechnology/ZoneMinder into storageareas

This commit is contained in:
Isaac Connor 2017-01-30 21:16:26 -05:00
commit 89022fff0c
7 changed files with 16648 additions and 18 deletions

View File

@ -342,7 +342,7 @@ CREATE TABLE `Monitors` (
`Host` varchar(64),
`Port` varchar(8) NOT NULL default '',
`SubPath` varchar(64) NOT NULL default '',
`Path` varchar(255) NOT NULL default '',
`Path` varchar(255),
`Options` varchar(255),
`User` varchar(64),
`Pass` varchar(64),
@ -398,7 +398,6 @@ CREATE TABLE `Monitors` (
`WebColour` varchar(32) NOT NULL default 'red',
`Exif` tinyint(1) unsigned NOT NULL default '0',
`Sequence` smallint(5) unsigned default NULL,
`Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0',
PRIMARY KEY (`Id`)
) ENGINE=@ZM_MYSQL_ENGINE@;

7
db/zm_update-1.30.13.sql Normal file
View File

@ -0,0 +1,7 @@
--
-- This updates a 1.30.10 database to 1.30.11
--
-- Add StateId Column to Events.
--
ALTER TABLE Monitors MODIFY Path VARCHAR(255);

View File

@ -1 +1 @@
1.30.12
1.30.13

View File

@ -65,6 +65,14 @@ class Storage {
}
public function disk_usage_percent() {
$path = $this->Path();
if ( ! $path ) {
Warning("Storage::disk_usage_percent: path is empty");
return 0;
} else if ( ! file_exists( $path ) ) {
Warning("Storage::disk_usage_percent: path $path does not exist");
return 0;
}
$total = disk_total_space( $path );
if ( ! $total ) {
Error("disk_total_space returned false for " . $path );

View File

@ -440,6 +440,10 @@ if ( !empty($action) ) {
if ( count( $changes ) ) {
if ( $mid ) {
# If we change anything that changes the shared mem size, zma can complain. So let's stop first.
zmaControl( $monitor, 'stop' );
zmcControl( $monitor, 'stop' );
dbQuery( 'UPDATE Monitors SET '.implode( ", ", $changes ).' WHERE Id =?', array($mid) );
if ( isset($changes['Name']) ) {
$saferOldName = basename( $monitor['Name'] );
@ -522,17 +526,15 @@ if ( !empty($action) ) {
//fixDevices();
//if ( $cookies )
//session_write_close();
if ( daemonCheck() ) {
zmaControl( $monitor, 'stop' );
zmcControl( $monitor, 'stop' );
zmcControl( $new_monitor, 'start' );
zmaControl( $new_monitor, 'start' );
}
zmcControl( $new_monitor, 'start' );
zmaControl( $new_monitor, 'start' );
if ( $monitor['Controllable'] ) {
require_once( 'control_functions.php' );
sendControlCommand( $mid, 'quit' );
}
// really should thump zmwatch and maybe zmtrigger too.
//daemonControl( 'restart', 'zmwatch.pl' );
$refreshParent = true;
} // end if restart
@ -567,12 +569,12 @@ if ( !empty($action) ) {
deletePath( ZM_DIR_EVENTS.'/'.basename($monitor['Name']) );
deletePath( ZM_DIR_EVENTS.'/'.$monitor['Id'] ); // I'm trusting the Id.
}
}
}
}
}
}
} // end if ZM_OPT_FAST_DELETE
} // end if found the monitor in the db
} // end if canedit this monitor
} // end foreach monitor in MarkMid
} // markMids is set and we aren't limited to specific monitors
} // end if action == Delete
}
// Device view actions

View File

@ -80,9 +80,9 @@ function xhtmlHeaders( $file, $title )
<?php if ( !in_array($basename, $bad_views) ) { ?>
<!--<script type="text/javascript" src="js/overlay.js"></script>-->
<script type="text/javascript" src="skins/<?php echo $skin; ?>/js/jquery-1.11.3.js"></script>
<script src="https://code.jquery.com/ui/1.11.3/jquery-ui.js"></script>
<script type="text/javascript" src="skins/<?php echo $skin; ?>/js/jquery-ui.js"></script>
<script type="text/javascript" src="skins/<?php echo $skin; ?>/js/bootstrap.min.js"></script>
<script type="text/javascript">
<script type="text/javascript">
//<![CDATA[
<!--
var $j = jQuery.noConflict();
@ -266,7 +266,13 @@ if ( canView( 'Stream' ) && $cycleCount > 1 ) {
<li><?php echo translate('Storage') ?>: <?php
$storage_areas = Storage::find_all();
array_push( $storage_areas, new Storage() );
$storage_paths = null;
foreach ( $storage_areas as $area ) {
$storage_paths[$area->Path()] = $area;
}
if ( ! isset($storage_paths[ZM_DIR_EVENTS]) ) {
array_push( $storage_areas, new Storage() );
}
$func = function($S){ return $S->Name() . ': ' . $S->disk_usage_percent().'%'; };
echo implode( ', ', array_map ( $func, $storage_areas ) );

16608
web/skins/classic/js/jquery-ui-1.11.3.js vendored Normal file

File diff suppressed because it is too large Load Diff