Merge branch 'master' of github.com:ZoneMinder/zoneminder
This commit is contained in:
commit
b4fbe84f6b
|
@ -21,7 +21,7 @@ endif(ZM_TARGET_DISTRO MATCHES "^el")
|
|||
# Configure the common zoneminder files
|
||||
configure_file(common/zoneminder.logrotate.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.logrotate @ONLY)
|
||||
configure_file(common/zoneminder.service.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY)
|
||||
file(MAKE_DIRECTORY sock swap zoneminder zoneminder-upload events temp)
|
||||
file(MAKE_DIRECTORY sock swap zoneminder events temp)
|
||||
|
||||
# Configure the Apache zoneminder files
|
||||
configure_file(httpd/zm-httpd.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zm-httpd.conf @ONLY)
|
||||
|
@ -51,7 +51,6 @@ install(DIRECTORY sock swap DESTINATION /var/lib/zoneminder DIRECTORY_PERMISSION
|
|||
install(DIRECTORY zoneminder DESTINATION /var/log DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
install(DIRECTORY zoneminder DESTINATION /var/run DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
install(DIRECTORY zoneminder DESTINATION /var/cache DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
install(DIRECTORY zoneminder-upload DESTINATION /var/spool DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
install(DIRECTORY events temp DESTINATION /var/lib/zoneminder DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
|
||||
# Install the Apache zoneminder files
|
||||
|
|
|
@ -107,7 +107,7 @@ void zmLoadConfig() {
|
|||
snprintf(staticConfig.video_file_format, sizeof(staticConfig.video_file_format), "%%s/%%s");
|
||||
}
|
||||
|
||||
void process_configfile(char* configFile) {
|
||||
void process_configfile(char const *configFile) {
|
||||
FILE *cfg;
|
||||
char line[512];
|
||||
if ( (cfg = fopen(configFile, "r")) == NULL ) {
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
|
||||
extern void zmLoadConfig();
|
||||
|
||||
extern void process_configfile( char* configFile );
|
||||
extern void process_configfile(char const *configFile);
|
||||
|
||||
struct StaticConfig {
|
||||
std::string DB_HOST;
|
||||
|
|
|
@ -244,7 +244,7 @@ echo $table_head;
|
|||
for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
|
||||
$monitor = $displayMonitors[$monitor_i];
|
||||
$Monitor = new ZM\Monitor($monitor);
|
||||
|
||||
include('function.php');
|
||||
if ( $monitor_i and ( $monitor_i % 100 == 0 ) ) {
|
||||
echo '</table>';
|
||||
echo $table_head;
|
||||
|
@ -325,7 +325,7 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
|
|||
?>
|
||||
</div></td>
|
||||
<td class="colFunction">
|
||||
<?php echo makePopupLink( '?view=function&mid='.$monitor['Id'], 'zmFunction', 'function', '<span class="'.$function_class.'">'.translate('Fn'.$monitor['Function']).( empty($monitor['Enabled']) ? ', <span class="disabledText">disabled</span>' : '' ) .'</span>', canEdit('Monitors') ) ?><br/>
|
||||
<a class="functionLnk <?php echo $function_class ?>" data-mid="<?php echo $monitor['Id'] ?>" id="functionLnk-<?php echo $monitor['Id'] ?>" href="#"><?php echo translate('Fn'.$monitor['Function']) ?></a><br/>
|
||||
<?php echo translate('Status'.$monitor['Status']) ?><br/>
|
||||
<div class="small text-nowrap text-muted">
|
||||
<?php
|
||||
|
@ -348,7 +348,7 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
|
|||
<td class="colServer"><?php $Server = isset($ServersById[$monitor['ServerId']]) ? $ServersById[$monitor['ServerId']] : new ZM\Server($monitor['ServerId']); echo validHtmlStr($Server->Name()); ?></td>
|
||||
<?php
|
||||
}
|
||||
echo '<td class="colSource">'. makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', '<span class="'.$source_class.'">'.validHtmlStr($Monitor->Source()).'</span>', canEdit('Monitors') ).'</td>';
|
||||
echo '<td class="colSource">'. makeLink( '?view=monitor&mid='.$monitor['Id'], '<span class="'.$source_class.'">'.validHtmlStr($Monitor->Source()).'</span>', canEdit('Monitors') ).'</td>';
|
||||
if ( $show_storage_areas ) {
|
||||
?>
|
||||
<td class="colStorage"><?php echo isset($StorageById[$monitor['StorageId']]) ? validHtmlStr($StorageById[$monitor['StorageId']]->Name()) : ($monitor['StorageId']?'<span class="error">Deleted '.$monitor['StorageId'].'</span>' : '') ?></td>
|
||||
|
|
|
@ -22,42 +22,35 @@ if ( !canEdit('Monitors') ) {
|
|||
$view = 'error';
|
||||
return;
|
||||
}
|
||||
|
||||
$monitor = ZM\Monitor::find_one(array('Id'=>$_REQUEST['mid']));
|
||||
|
||||
$focusWindow = true;
|
||||
|
||||
xhtmlHeaders(__FILE__, translate('Function').' - '.validHtmlStr($monitor->Name()));
|
||||
?>
|
||||
<body>
|
||||
<div id="page">
|
||||
<div id="header">
|
||||
<h2><?php echo translate('Function').' - '.validHtmlStr($monitor->Name()) ?></h2>
|
||||
|
||||
<div id="modalFunction-<?php echo $Monitor->Id() ?>" class="modal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><?php echo translate('Function').' - '.validHtmlStr($Monitor->Name()) ?></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div id="content">
|
||||
<form name="contentForm" id="contentForm" method="post" action="?">
|
||||
<input type="hidden" name="view" value="function"/>
|
||||
<input type="hidden" name="action" value="function"/>
|
||||
<input type="hidden" name="mid" value="<?php echo $monitor->Id() ?>"/>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
<select name="newFunction">
|
||||
<?php
|
||||
foreach ( getEnumValues('Monitors', 'Function') as $optFunction ) {
|
||||
?>
|
||||
<option value="<?php echo $optFunction ?>"<?php if ( $optFunction == $monitor->Function() ) { ?> selected="selected"<?php } ?>><?php echo translate('Fn'.$optFunction) ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<select name="newFunction" id="funcSelect-<?php echo $monitor['Id'] ?>">
|
||||
<?php
|
||||
foreach ( getEnumValues('Monitors', 'Function') as $optFunction ) {
|
||||
$selected = ( $optFunction == $Monitor->Function() ) ? ' selected="selected"' : '';
|
||||
echo '<option value="' .$optFunction. '"'. $selected. '>' .translate('Fn'.$optFunction). '</option>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<label for="newEnabled"><?php echo translate('Enabled') ?></label>
|
||||
<input type="checkbox" name="newEnabled" id="newEnabled" value="1"<?php echo $monitor->Enabled() ?' checked="checked"' : '' ?>/>
|
||||
<input type="checkbox" name="newEnabled" id="newEnabled-<?php echo $monitor['Id'] ?>" value="1"<?php echo $Monitor->Enabled() ?' checked="checked"' : '' ?>/>
|
||||
</p>
|
||||
<div id="contentButtons">
|
||||
<button type="submit" value="Save"><?php echo translate('Save') ?></button>
|
||||
<button type="button" data-on-click="closeWindow"><?php echo translate('Cancel') ?></button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="modal-footer">
|
||||
<button data-mid="<?php echo $monitor['Id'] ?>" type="button" class="funcSaveBtn btn btn-primary"><?php echo translate('Save') ?></button>
|
||||
<button data-mid="<?php echo $monitor['Id'] ?>" type="button" class="funcCancelBtn btn btn-secondary" data-dismiss="modal"><?php echo translate('Cancel') ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -135,6 +135,18 @@ function reloadWindow() {
|
|||
}
|
||||
|
||||
function initPage() {
|
||||
|
||||
$j('.functionLnk').click(function(evt) {
|
||||
if ( ! canEditEvents ) {
|
||||
alert("You do not have permission to change monitor function.");
|
||||
return;
|
||||
}
|
||||
var mid = evt.currentTarget.getAttribute("data-mid");
|
||||
|
||||
evt.preventDefault();
|
||||
$j('#modalFunction-'+mid).modal('show');
|
||||
});
|
||||
|
||||
reloadWindow.periodical(consoleRefreshTimeout);
|
||||
if ( showVersionPopup ) {
|
||||
createPopup('?view=version', 'zmVersion', 'version');
|
||||
|
@ -154,6 +166,26 @@ function initPage() {
|
|||
|
||||
// Setup the thumbnail video animation
|
||||
initThumbAnimation();
|
||||
|
||||
// Manage the CANCEL modal buttons
|
||||
$j('.funcCancelBtn').click(function(evt) {
|
||||
var mid = evt.currentTarget.getAttribute("data-mid");
|
||||
|
||||
evt.preventDefault();
|
||||
$j('#modalFunction-'+mid).modal('hide');
|
||||
});
|
||||
|
||||
// Manage the SAVE modal buttons
|
||||
$j('.funcSaveBtn').click(function(evt) {
|
||||
var mid = evt.currentTarget.getAttribute("data-mid");
|
||||
var newFunc = $j("#funcSelect-"+mid).val();
|
||||
var newEnabled = $j('#newEnabled-'+mid).is(':checked') ? 1 : 0;
|
||||
|
||||
evt.preventDefault();
|
||||
$j.getJSON(thisUrl + '?view=function&action=function&mid='+mid+'&newFunction='+newFunc+'&newEnabled='+newEnabled);
|
||||
window.location.reload(true);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function applySort(event, ui) {
|
||||
|
|
Loading…
Reference in New Issue