Merge branch 'ZoneMinder:master' into patch-6

pull/3843/head
IgorA100 2024-04-07 20:45:21 +03:00 committed by GitHub
commit a720292025
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 38 additions and 21 deletions

View File

@ -2,8 +2,8 @@ task:
name: freebsd-build
freebsd_instance:
matrix:
- image_family: freebsd-12-3
- image_family: freebsd-13-0
- image_family: freebsd-14-0
- image_family: freebsd-13-2
prepare_script:
- pkg install -yq git cmake pkgconf jpeg-turbo mysql80-client ffmpeg libvncserver libjwt catch p5-DBI p5-DBD-mysql p5-Date-Manip p5-Test-LWP-UserAgent p5-Sys-Mmap v4l_compat

View File

@ -128,14 +128,16 @@ set(ZM_CONTENTDIR "/var/lib/zoneminder" CACHE PATH
set(ZM_FONTDIR "${CMAKE_INSTALL_FULL_DATADIR}/zoneminder/fonts" CACHE PATH
"Location of the font files used for timestamping, default: <prefix>/${CMAKE_INSTALL_DATADIR}/zoneminder/fonts")
set(ZM_DB_TYPE "mysql" CACHE STRING
"Type of database where the ZoneMinder database located, default: mysql")
set(ZM_DB_HOST "localhost" CACHE STRING
"Hostname where ZoneMinder database located, default: localhost")
"Hostname where the ZoneMinder database located, default: localhost")
set(ZM_DB_NAME "zm" CACHE STRING
"Name of ZoneMinder database, default: zm")
"Name of the ZoneMinder database, default: zm")
set(ZM_DB_USER "zmuser" CACHE STRING
"Name of ZoneMinder database user, default: zmuser")
"Name of the ZoneMinder database user, default: zmuser")
set(ZM_DB_PASS "zmpass" CACHE STRING
"Password of ZoneMinder database user, default: zmpass")
"Password of the ZoneMinder database user, default: zmpass")
set(ZM_WEB_USER "" CACHE STRING
"The user apache or the local web server runs on. Leave empty for automatic detection.
If that fails, you can use this variable to force")
@ -745,7 +747,6 @@ set(WEB_PREFIX "${ZM_WEBDIR}")
set(CGI_PREFIX "${ZM_CGIDIR}")
set(WEB_USER "${ZM_WEB_USER}")
set(WEB_GROUP "${ZM_WEB_GROUP}")
set(ZM_DB_TYPE "mysql")
if(ZM_PERL_SEARCH_PATH)
set(EXTRA_PERL_LIB "use lib '${ZM_PERL_SEARCH_PATH}'; # Include custom perl install path")
else()

View File

@ -108,11 +108,11 @@ sub zmDbConnect {
eval {
$dbh = DBI->connect(
'DBI:mysql:database='.$ZoneMinder::Config::Config{ZM_DB_NAME}
'DBI:'.$ZoneMinder::Config::Config{ZM_DB_TYPE}.':database='.$ZoneMinder::Config::Config{ZM_DB_NAME}
.$socket . $sslOptions . ($options?join(';', '', map { $_.'='.$$options{$_} } keys %{$options} ) : '')
, $ZoneMinder::Config::Config{ZM_DB_USER}
, $ZoneMinder::Config::Config{ZM_DB_PASS}
, { mysql_enable_utf8mb4 => 1, }
, { ($ZoneMinder::Config::Config{ZM_DB_TYPE} eq 'mysql' ? (mysql_enable_utf8mb4 => 1) : ()) }
);
};
if ( !$dbh or $@ ) {

View File

@ -258,8 +258,8 @@ int FfmpegCamera::Capture(std::shared_ptr<ZMPacket> &zm_packet) {
// 32-bit wrap around?
Info("Suspected 32bit wraparound in input pts. %" PRId64, packet->pts);
return -1;
} else if (packet->pts - lastPTS < -40*stream->time_base.den) {
// -40 is for 40 seconds. Avigilon cameras seem to jump around by about 36 constantly
} else if (packet->pts - lastPTS < -20*stream->time_base.den) {
// -20 is for 20 seconds. Avigilon cameras seem to jump around by about 36 constantly
double pts_time = static_cast<double>(av_rescale_q(packet->pts, stream->time_base, AV_TIME_BASE_Q)) / AV_TIME_BASE;
double last_pts_time = static_cast<double>(av_rescale_q(lastPTS, stream->time_base, AV_TIME_BASE_Q)) / AV_TIME_BASE;
logPrintf(Logger::WARNING + monitor->Importance(), "Stream pts jumped back in time too far. pts %.2f - last pts %.2f = %.2f > 40seconds",

View File

@ -85,6 +85,7 @@ RETSIGTYPE zm_die_handler(int signal)
}
}
#endif // ( HAVE_SIGINFO_T && HAVE_UCONTEXT_T )
#endif // (defined(__i386__) || defined(__x86_64__)
// Print backtrace if enabled and available
@ -128,7 +129,6 @@ RETSIGTYPE zm_die_handler(int signal)
Error("%s", cmd);
}
#endif // ( !defined(ZM_NO_CRASHTRACE) && HAVE_DECL_BACKTRACE && HAVE_DECL_BACKTRACE_SYMBOLS )
#endif // (defined(__i386__) || defined(__x86_64__)
// Icon: Don't exit, setting zm_terminate should cause the exit to happen in a timely manner.
// The main reason not to here is to make valgrind traces quieter because logger gets free while other threads
// are still running and trying to log.

View File

@ -387,9 +387,9 @@ class FilterTerm {
} # end public function hiddens_fields
public function test($event=null) {
Debug("Testing " . $this->attr);
if ( !isset($event) ) {
# Is a Pre Condition
Debug("Testing " . $this->attr);
if ( $this->attr == 'DiskPercent' ) {
$storage_areas = $this->filter->get_StorageAreas();
# The logic on this when there are multiple storage areas breaks. We will just use the first.
@ -428,9 +428,9 @@ class FilterTerm {
# Is a Post Condition
if ( $this->attr == 'ExistsInFileSystem' ) {
if (
($this->op == 'IS' and $this->val == 'True')
($this->op == 'IS' and $this->val == 'true')
or
($this->op == 'IS NOT' and $this->val == 'False')
($this->op == 'IS NOT' and $this->val == 'false')
) {
return file_exists($event->Path());
} else {

View File

@ -770,6 +770,10 @@ ul.nav.nav-pills.flex-column {
float: left;
}
.chosen {
position: absolute !important; left: -999em !important;
}
.chosen-container-active .chosen-choices {
border-color:rgb(200,200,200);
}
@ -787,6 +791,14 @@ li.search-choice {
border-color:rgb(200,200,200);
}
.chosen-container-single .chosen-single-with-deselect span {
margin-right: 30px;
}
.chosen-container-single .chosen-single abbr {
right: 18px;
}
.reduced-text {
font-size:0.9em;
}

View File

@ -41,6 +41,9 @@ select {
text-align: center;
}
#sortTable {
justify-content: center;
}
#sortTable input[type=text] {
margin-right: 4px;
}

View File

@ -655,7 +655,7 @@ function getConsoleHTML() {
global $user;
$result = '';
if (count($user->viewableMonitorIds())) {
if (count($user->viewableMonitorIds()) or !ZM\Monitor::find_one()) {
$result .= '<li id="getConsoleHTML" class="nav-item"><a class="nav-link" href="?view=console">'.translate('Console').'</a></li>'.PHP_EOL;
}

View File

@ -1144,9 +1144,9 @@ function applyChosen() {
const limit_search_threshold = 10;
$j('.chosen').chosen('destroy');
$j('.chosen').not('.chosen-full-width, .chosen-auto-width').chosen({disable_search_threshold: limit_search_threshold, search_contains: true});
$j('.chosen.chosen-full-width').chosen({disable_search_threshold: limit_search_threshold, search_contains: true, width: "100%"});
$j('.chosen.chosen-auto-width').chosen({disable_search_threshold: limit_search_threshold, search_contains: true, width: "auto"});
$j('.chosen').not('.chosen-full-width, .chosen-auto-width').chosen({allow_single_deselect: true, disable_search_threshold: limit_search_threshold, search_contains: true});
$j('.chosen.chosen-full-width').chosen({allow_single_deselect: true, disable_search_threshold: limit_search_threshold, search_contains: true, width: "100%"});
$j('.chosen.chosen-auto-width').chosen({allow_single_deselect: true, disable_search_threshold: limit_search_threshold, search_contains: true, width: "auto"});
}
const font = new FontFaceObserver('Material Icons', {weight: 400});

View File

@ -180,6 +180,7 @@ function onDownloadClick(evt) {
// Manage the DELETE CONFIRMATION modal button
function manageDelConfirmModalBtns() {
document.getElementById('delConfirmBtn').addEventListener('click', function onDelConfirmClick(evt) {
document.getElementById('delConfirmBtn').disabled = true; // prevent double click
if (!canEdit.Events) {
enoperm();
return;

View File

@ -144,7 +144,7 @@ if (isset($_REQUEST['filter'])) {
$filter->addTerm(array('attr' => 'StartDateTime', 'op' => '<=', 'val' => $_REQUEST['maxTime'], 'cnj' => 'and', 'cbr' => '1'));
if (count($selected_monitor_ids)) {
$filter->addTerm(array('attr' => 'Monitor', 'op' => 'IN', 'val' => implode(',',$selected_monitor_ids), 'cnj' => 'and'));
} else if ( ( $group_id != 0 || isset($_SESSION['ServerFilter']) || isset($_SESSION['StorageFilter']) || isset($_SESSION['StatusFilter']) ) ) {
} else if ( isset($_SESSION['GroupId']) || isset($_SESSION['ServerFilter']) || isset($_SESSION['StorageFilter']) || isset($_SESSION['StatusFilter']) ) {
# this should be redundant
for ( $i = 0; $i < count($displayMonitors); $i++ ) {
if ( $i == '0' ) {
@ -170,7 +170,7 @@ if (!$liveMode) {
}
if (!$filter->has_term('Tags')) {
$filter->addTerm(array('attr' => 'Tags', 'op' => '=',
'val' => $num_terms ? '' : (isset($_COOKIE['eventsTags']) ? $_COOKIE['eventsTags'] : ''),
'val' => (isset($_COOKIE['eventsTags']) ? $_COOKIE['eventsTags'] : ''),
'cnj' => 'and', 'cookie'=>'eventsTags'));
}
if (!$filter->has_term('Notes')) {