Skip to content

Fix: Managing the availability of the clear logs button on Log page#4836

Open
IgorA100 wants to merge 4 commits into
ZoneMinder:masterfrom
IgorA100:patch-248249
Open

Fix: Managing the availability of the clear logs button on Log page#4836
IgorA100 wants to merge 4 commits into
ZoneMinder:masterfrom
IgorA100:patch-248249

Conversation

@IgorA100
Copy link
Copy Markdown
Contributor

The delete logs button now remains active even after deleting logs (both successful and unsuccessful).
This PR allows for more accurate management of the button's availability.

  • After clicking the delete logs button, the button becomes unavailable to avoid repeated clicks, as the bootstrap table can take a long time to update, allowing time for another click of the delete logs button.
  • After each table update is complete, a check is made to determine whether rows are selected, and the availability of the clear logs button is determined based on this.
  • After clicking the "Cancel" button in the modal confirmation window, the selected rows in the table are checked, and the availability of the clear logs button is determined based on this.
  • If an error occurs executing the AJAX request to delete logs, the selected table rows are also analyzed, and the availability of the clear logs button is determined based on this.

@IgorA100 IgorA100 changed the title Managing the availability of the clear logs button (log.js) Fix: Managing the availability of the clear logs button on Log page May 16, 2026
@connortechnology connortechnology requested a review from Copilot May 16, 2026 23:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refines the Log page clear-logs button state so users cannot repeatedly trigger log deletion while the modal or table refresh is in progress.

Changes:

  • Disables the clear-logs button immediately after it is clicked.
  • Re-checks selected rows after table load success and AJAX modal-loading failures.
  • Extracts clear button enable/disable logic into manageClearButtonAvailability().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web/skins/classic/views/js/log.js Outdated
@IgorA100 IgorA100 marked this pull request as draft May 17, 2026 18:27
IgorA100 and others added 2 commits May 17, 2026 22:39
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
…ng the "#clearLogsConfirmBtn" button. The issue was related to an unnecessary call to manageClearButtonAvailability() (log.js)
@IgorA100 IgorA100 marked this pull request as ready for review May 17, 2026 21:16
@IgorA100
Copy link
Copy Markdown
Contributor Author

@connortechnology
I consider this PR complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants