Fix Approximated DNS widget 404 and add stuck sync reset button #537
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes two issues with the Admin UI:
Changes
Fix #1: Approximated DNS Widget 404
Problem: The DNS widget was making fetch requests without the Flask
script_nameprefix, causing 404 errors in production where the Admin UI is accessed via/adminprefix.Solution: Updated
templates/tenant_settings.htmlto retrieve and use thescript_namefrom thesettings-configdata attribute when constructing the token endpoint URL, consistent with all other AJAX calls.Impact: DNS widget now loads correctly on all settings pages in both local and production environments.
Fix #2: Stuck Sync Reset UI
Problem: When GAM inventory syncs hang or get stuck (e.g., "Writing Placements to DB"), users had no way to recover without manual database intervention.
Solution:
/gam/reset-stuck-syncendpoint to mark hung syncs as failedImpact: Users can now recover from stuck syncs without needing database access or support intervention.
Testing
Files Changed
templates/tenant_settings.html- Added script_name to DNS widget fetch + reset button UIstatic/js/tenant_settings.js- AddedresetStuckSync()function