Hide non-backup 3CX informational jobs from Run Checks
This commit is contained in:
parent
c6ff104767
commit
ea244193e0
@ -44,6 +44,13 @@ from ..ticketing_utils import link_open_internal_tickets_to_run
|
|||||||
AUTOTASK_TERMINAL_STATUS_IDS = {5}
|
AUTOTASK_TERMINAL_STATUS_IDS = {5}
|
||||||
|
|
||||||
|
|
||||||
|
def _is_hidden_3cx_non_backup(backup_software: str | None, backup_type: str | None) -> bool:
|
||||||
|
"""Hide non-backup 3CX informational jobs from Run Checks."""
|
||||||
|
bs = (backup_software or "").strip().lower()
|
||||||
|
bt = (backup_type or "").strip().lower()
|
||||||
|
return bs == "3cx" and bt in {"update", "ssl certificate"}
|
||||||
|
|
||||||
|
|
||||||
def _ensure_internal_ticket_for_autotask(
|
def _ensure_internal_ticket_for_autotask(
|
||||||
*,
|
*,
|
||||||
ticket_number: str,
|
ticket_number: str,
|
||||||
@ -870,6 +877,8 @@ def run_checks_page():
|
|||||||
today_local = _to_amsterdam_date(datetime.utcnow()) or datetime.utcnow().date()
|
today_local = _to_amsterdam_date(datetime.utcnow()) or datetime.utcnow().date()
|
||||||
|
|
||||||
for job in jobs:
|
for job in jobs:
|
||||||
|
if _is_hidden_3cx_non_backup(getattr(job, "backup_software", None), getattr(job, "backup_type", None)):
|
||||||
|
continue
|
||||||
last_rev = last_reviewed_map.get(int(job.id))
|
last_rev = last_reviewed_map.get(int(job.id))
|
||||||
if last_rev:
|
if last_rev:
|
||||||
start_date = _to_amsterdam_date(last_rev) or settings_start
|
start_date = _to_amsterdam_date(last_rev) or settings_start
|
||||||
@ -984,7 +993,7 @@ def run_checks_page():
|
|||||||
Job.id.asc(),
|
Job.id.asc(),
|
||||||
)
|
)
|
||||||
|
|
||||||
rows = q.limit(2000).all()
|
rows = [r for r in q.limit(2000).all() if not _is_hidden_3cx_non_backup(r.backup_software, r.backup_type)]
|
||||||
|
|
||||||
# Ensure override flags are up-to-date for the runs shown in this overview.
|
# Ensure override flags are up-to-date for the runs shown in this overview.
|
||||||
# The Run Checks modal computes override status on-the-fly, but the overview
|
# The Run Checks modal computes override status on-the-fly, but the overview
|
||||||
@ -1180,6 +1189,15 @@ def run_checks_details():
|
|||||||
include_reviewed = request.args.get("include_reviewed", "0") in ("1", "true", "yes", "on")
|
include_reviewed = request.args.get("include_reviewed", "0") in ("1", "true", "yes", "on")
|
||||||
|
|
||||||
job = Job.query.get_or_404(job_id)
|
job = Job.query.get_or_404(job_id)
|
||||||
|
if _is_hidden_3cx_non_backup(getattr(job, "backup_software", None), getattr(job, "backup_type", None)):
|
||||||
|
job_payload = {
|
||||||
|
"id": job.id,
|
||||||
|
"customer_name": job.customer.name if job.customer else "",
|
||||||
|
"backup_software": job.backup_software or "",
|
||||||
|
"backup_type": job.backup_type or "",
|
||||||
|
"job_name": job.job_name or "",
|
||||||
|
}
|
||||||
|
return jsonify({"status": "ok", "job": job_payload, "runs": [], "message": "This 3CX informational type is hidden from Run Checks."})
|
||||||
|
|
||||||
q = JobRun.query.filter(JobRun.job_id == job.id)
|
q = JobRun.query.filter(JobRun.job_id == job.id)
|
||||||
if not include_reviewed:
|
if not include_reviewed:
|
||||||
|
|||||||
@ -681,6 +681,8 @@ def _infer_schedule_map_from_runs(job_id: int):
|
|||||||
return schedule
|
return schedule
|
||||||
if bs == '3cx' and bt == 'update':
|
if bs == '3cx' and bt == 'update':
|
||||||
return schedule
|
return schedule
|
||||||
|
if bs == '3cx' and bt == 'ssl certificate':
|
||||||
|
return schedule
|
||||||
if bs == 'syncovery' and bt == 'syncovery':
|
if bs == 'syncovery' and bt == 'syncovery':
|
||||||
return schedule
|
return schedule
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
@ -13,6 +13,7 @@ This file documents all changes made to this project via Claude Code.
|
|||||||
- Customers CSV import now only applies Autotask mapping fields when the import option is checked
|
- Customers CSV import now only applies Autotask mapping fields when the import option is checked
|
||||||
- Import success and audit output now includes whether Autotask IDs were imported
|
- Import success and audit output now includes whether Autotask IDs were imported
|
||||||
- 3CX parser now recognizes `3CX Notification: Update Successful - <host>` as an informational run with `backup_software: 3CX`, `backup_type: Update`, and `overall_status: Success`, and excludes this type from schedule inference (no Expected/Missed generation)
|
- 3CX parser now recognizes `3CX Notification: Update Successful - <host>` as an informational run with `backup_software: 3CX`, `backup_type: Update`, and `overall_status: Success`, and excludes this type from schedule inference (no Expected/Missed generation)
|
||||||
|
- Run Checks now hides only non-backup 3CX informational types (`Update`, `SSL Certificate`), while other backup software/types remain visible
|
||||||
|
|
||||||
## [2026-02-16]
|
## [2026-02-16]
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user