Skip to content

feat(admin): add system logs tab and restrict platform tracking to logged-in users#193

Merged
Bogdan2005-19 merged 1 commit into
devfrom
feat/system-logs-dashboard
Jun 10, 2026
Merged

feat(admin): add system logs tab and restrict platform tracking to logged-in users#193
Bogdan2005-19 merged 1 commit into
devfrom
feat/system-logs-dashboard

Conversation

@Karu174

@Karu174 Karu174 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

📄 Description

As a Staff Admin,
I want to view the background synchronization logs directly from my dashboard,
so that I can monitor the health of the API updates without needing to access the default Django admin panel.

As a platform user (Guest),
I want to be redirected to the login page if I try to access a platform link,
so that I don't receive misleading "Added to history" notifications when I don't have an active session.

✅ Changes Made

  • Staff Admin Dashboard: Added a new "System Logs" tab displaying a paginated table of all SyncLog entries (Start Time, End Time, Status, and Summary).
  • Middleware Configuration: Exempted the system_logs route in AdminRedirectMiddleware to ensure Staff Admins can access it securely.
  • Global Pagination: Created a reusable paginator.html component that correctly handles URL parameters (like platform and date filters).
  • Guest UX (Frontend): Modified the JavaScript tracking script in details_base.html. Unauthenticated users are now redirected to the login view when clicking a platform button, preventing ghost API requests and false "success" toasts.

🛠️ Relevant Files Modified

  • users/middleware.py & users/urls.py (Routing and permissions)
  • web_app/views.py (Added system_logs view)
  • users/templates/users/parts/system_logs.html (New UI table)
  • Templates/paginator.html (New global component)
  • Templates/Details/details_base.html (JS authentication check)
  • Staff Admin Tab template (Added the new navigation link)

🔗 Related Issues

Closes: #191

📸 Testing Performed

  • Admin Test: Logged in as Staff Admin, navigated to the new tab, and verified the logs display correctly with pagination.
  • Guest Test: Opened an incognito window, navigated to a detail page, and clicked a platform button -> successfully redirected to the login page.
  • Consumer Test: Logged in as a standard user, clicked a platform button -> tracking toast appears correctly without redirecting.

@Bogdan2005-19
Bogdan2005-19 temporarily deployed to feat/system-logs-dashboard - JoinProject-dev PR #193 June 10, 2026 20:56 — with Render Destroyed

@Bogdan2005-19 Bogdan2005-19 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Seems good

@Bogdan2005-19
Bogdan2005-19 merged commit 64dcc5e into dev Jun 10, 2026
14 of 17 checks passed
@Bogdan2005-19
Bogdan2005-19 deleted the feat/system-logs-dashboard branch June 10, 2026 20:57
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