From 824f38c74671f0fe3bf9d3ec102c13003b39484e Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sun, 1 Nov 2020 08:05:53 -0600 Subject: [PATCH 1/3] hide settings buttons rather than disable for non Local monitors --- web/skins/classic/views/js/watch.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/skins/classic/views/js/watch.js b/web/skins/classic/views/js/watch.js index 176c85822..23629514e 100644 --- a/web/skins/classic/views/js/watch.js +++ b/web/skins/classic/views/js/watch.js @@ -946,7 +946,8 @@ function initPage() { }); // Only enable the settings button for local cameras - settingsBtn.prop('disabled', !(monitorType == 'Local' && canViewControl)); + settingsBtn.prop('disabled', !canViewControl); + if ( monitorType != 'Local' ) settingsBtn.hide(); } // initPage // Kick everything off From 3d795be8640be57c9ed545a39520dddddaa0715a Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sun, 1 Nov 2020 15:46:43 -0600 Subject: [PATCH 2/3] remove the thumbnail col if WEB_LIST_THUMBS is off --- web/skins/classic/views/js/events.js | 5 ++++- web/skins/classic/views/js/events.js.php | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/web/skins/classic/views/js/events.js b/web/skins/classic/views/js/events.js index f0bd0b3ac..20bf6b87f 100644 --- a/web/skins/classic/views/js/events.js +++ b/web/skins/classic/views/js/events.js @@ -68,7 +68,7 @@ function processRows(rows) { row.Frames = '' + row.Frames + ''; row.AlarmFrames = '' + row.AlarmFrames + ''; row.MaxScore = '' + row.MaxScore + ''; - row.Thumbnail = '' + row.imgHtml + ''; + if ( WEB_LIST_THUMBS ) row.Thumbnail = '' + row.imgHtml + ''; }); return rows; @@ -161,6 +161,9 @@ function getEventDetailModal(eid) { } function initPage() { + // Remove the thumbnail column from the DOM if thumbnails are off globally + if ( !WEB_LIST_THUMBS ) $j('th[data-field="Thumbnail"]').remove(); + // Load the delete confirmation modal into the DOM getDelConfirmModal(); diff --git a/web/skins/classic/views/js/events.js.php b/web/skins/classic/views/js/events.js.php index 48f405dd7..207a6745e 100644 --- a/web/skins/classic/views/js/events.js.php +++ b/web/skins/classic/views/js/events.js.php @@ -11,3 +11,4 @@ var archivedString = ""; var emailedString = ""; var yesString = ""; var noString = ""; +var WEB_LIST_THUMBS = ; From 6e3eb922e02287d9b190e1a28fb8e22fb550ccbd Mon Sep 17 00:00:00 2001 From: Matt N Date: Sun, 1 Nov 2020 14:55:08 -0800 Subject: [PATCH 3/3] Use relative symlinks for monitor event directories This way the link continues to work from backups and after the user moves ZM data to a new directory. --- web/includes/actions/monitor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/includes/actions/monitor.php b/web/includes/actions/monitor.php index 140957046..be17578cf 100644 --- a/web/includes/actions/monitor.php +++ b/web/includes/actions/monitor.php @@ -121,7 +121,8 @@ if ( $action == 'save' ) { } $saferNewName = basename($_REQUEST['newMonitor']['Name']); $link_path = $NewStorage->Path().'/'.$saferNewName; - if ( !symlink($NewStorage->Path().'/'.$mid, $link_path) ) { + // Use a relative path for the target so the link continues to work from backups or directory changes. + if ( !symlink($mid, $link_path) ) { if ( ! ( file_exists($link_path) and is_link($link_path) ) ) { ZM\Warning('Unable to symlink ' . $NewStorage->Path().'/'.$mid . ' to ' . $NewStorage->Path().'/'.$saferNewName); }