From b1deeda285445f321e6c9f6d2e259936d39967d0 Mon Sep 17 00:00:00 2001 From: Proudlock <270015376@geaerospace.com> Date: Wed, 9 Sep 2026 09:34:59 -0400 Subject: [PATCH] Fix operator report email to link to frontend page and include asset number - Change device URL from API endpoint (/api/assets/{id}) to frontend page (/shopdb/pcs/{id}) - Add asset number to email subject line: "Operator Issue Report: {name} ({number})" - Bump agent to 1.13.5 and tray to 1.6.6 for coordinated release --- .../ShopDbEndpointAgent.Tray.csproj | 4 +++- .../ShopDbEndpointAgent/ShopDbEndpointAgent.csproj | 4 +++- plugins/endpoints/api/routes.py | 13 ++++++------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/agent/ShopDbEndpointAgent.Tray/ShopDbEndpointAgent.Tray.csproj b/agent/ShopDbEndpointAgent.Tray/ShopDbEndpointAgent.Tray.csproj index c9223298..51812fa2 100644 --- a/agent/ShopDbEndpointAgent.Tray/ShopDbEndpointAgent.Tray.csproj +++ b/agent/ShopDbEndpointAgent.Tray/ShopDbEndpointAgent.Tray.csproj @@ -86,7 +86,9 @@ Font objects tracked and disposed, worker thread joined before client disposal, Screen.PrimaryScreen null dereference prevented, status check cancellation token propagated to prevent orphaned HTTP requests. --> - 1.6.5 + + 1.6.6 true win-x64 true diff --git a/agent/ShopDbEndpointAgent/ShopDbEndpointAgent.csproj b/agent/ShopDbEndpointAgent/ShopDbEndpointAgent.csproj index bf4f7924..85f4bd1c 100644 --- a/agent/ShopDbEndpointAgent/ShopDbEndpointAgent.csproj +++ b/agent/ShopDbEndpointAgent/ShopDbEndpointAgent.csproj @@ -179,7 +179,9 @@ No agent code changes, but deployed together for version consistency. --> - 1.13.4 + + 1.13.5 true win-x64 true diff --git a/plugins/endpoints/api/routes.py b/plugins/endpoints/api/routes.py index 9cb24db2..2b7dbbc3 100644 --- a/plugins/endpoints/api/routes.py +++ b/plugins/endpoints/api/routes.py @@ -2960,15 +2960,14 @@ def _send_operator_report_alert(report, asset_id, hostname): current_app.logger.warning('Cannot send operator report alert: asset %d not found', asset_id) return - # Generate absolute URLs + # Generate absolute URL to frontend page (not API endpoint) try: - device_url = url_for('assets.get_asset', asset_id=asset_id, _external=True) - except Exception as e: - current_app.logger.error('Failed to generate device URL: %s', e) - # Build absolute URL manually using request context scheme = request.scheme if request else 'https' host = request.host if request else 'localhost' - device_url = f'{scheme}://{host}/shopdb/assets/{asset_id}' + device_url = f'{scheme}://{host}/shopdb/pcs/{asset_id}' + except Exception as e: + current_app.logger.error('Failed to generate device URL: %s', e) + device_url = f'https://localhost/shopdb/pcs/{asset_id}' reported_at = report.createdat.strftime('%Y-%m-%d %H:%M:%S UTC') if report.createdat else 'Unknown' @@ -3009,7 +3008,7 @@ def _send_operator_report_alert(report, asset_id, hostname): ''' - subject = f'Operator Issue Report: {safe_name}' + subject = f'Operator Issue Report: {safe_name} ({safe_assetnumber})' current_app.logger.info('Sending operator report alert for %s (report %d)', hostname, report.operatorreportid)