Skip to content

feat: enhanced admin dashboard#1457

Open
mrjoshuap wants to merge 9 commits intomediacms-io:mainfrom
mrjoshuap:feat-enhanced-admin-dashboard
Open

feat: enhanced admin dashboard#1457
mrjoshuap wants to merge 9 commits intomediacms-io:mainfrom
mrjoshuap:feat-enhanced-admin-dashboard

Conversation

@mrjoshuap
Copy link
Copy Markdown
Contributor

Description

This PR introduces an enhanced admin dashboard with comprehensive statistics and metrics for MediaCMS administrators. The dashboard provides real-time insights into media content, user activity, engagement metrics, content moderation, and system health.

A picture is worth a thousand words.

Screenshot 2025-12-23 at 15 46 04

Key Features:

  • Media Overview: Total media count, encoding status breakdown, media by type (video/audio/image/pdf), upload trends (7/30 days), and items requiring review
  • Content Moderation: Reported media tracking, recent reports (7 days), unreviewed content, and urgent review alerts
  • Engagement Metrics: Total comments, likes/dislikes, most liked/viewed media, and recent comment activity
  • User Statistics: Total users, recent registrations (7/30 days), top uploaders, active users, and pending approvals
  • System Health: Encoding queue status, encoding failures, total channels/categories/playlists

Technical Changes:

  • Custom admin index template (templates/admin/index.html) with statistics dashboard
  • Statistics calculation module (admin_customizations/admin.py) with time-based metrics
  • Registered MediaAction model in admin for viewing user actions (likes, reports, etc.)
  • Enhanced admin app list customization with improved organization and filtering
  • Incudes new manage.py option to generate fake data -- useful for testing, see python manage.py populate_fake_media

Steps

Pre-deploy

  • Review admin dashboard statistics calculations for performance impact
  • Verify MediaAction admin interface is accessible and functional
  • Test admin dashboard loads correctly with various data scenarios

Post-deploy

  • Verify admin dashboard displays correctly at /admin/
  • Confirm all statistics are calculating accurately
  • Test navigation links from dashboard statistics to filtered admin views
  • Monitor performance impact of statistics calculations on admin page load

Here's a video that shows the update in action:

mediacms-admin-dashboard-smaller.mp4

mrjoshuap and others added 7 commits December 22, 2025 20:52
- Implement custom admin index view with statistics calculation
- Display media, moderation, engagement, user, and system metrics
- Add clickable links to filtered admin views
- Fix reverse relation name bug (use media_set instead of media)
@khwolf
Copy link
Copy Markdown

khwolf commented Dec 26, 2025

Haven't had time to test myself, but the video looks like it is something really helpful!
Great work! Thank you!

@mrjoshuap
Copy link
Copy Markdown
Contributor Author

I'd be very interested in what other things might be useful for the dashboard. I'm sort of out of ideas. I was also trying not to add any model changes or things that might break existing installs.

Let me know if there is something interesting to consider.

@mrjoshuap
Copy link
Copy Markdown
Contributor Author

In case the video doesn't render here...

https://mrjoshuap.com/mediacms/mediacms-admin-dashboard-smaller.mp4

@mrjoshuap
Copy link
Copy Markdown
Contributor Author

Alright, since I needed a simple instance to do some testing with the mobile app, I decided to stand up a MediaCMS instance dedicated to it and figured I'd put the videos there. The link above should still work, but now it's in an instance so you won't have to download it.

https://demo.mediacms.app/view?m=G3TuFuVnu

@Ariec9000
Copy link
Copy Markdown

After making the changes, my mediacms instance broke down. When I try to access the main page, I get a 502 Bad Gateway response. The admin panel doesn't work either. Am I doing something wrong? Do you have any recommendations on how to deploy correctly?

@mrjoshuap
Copy link
Copy Markdown
Contributor Author

What deployment option are you using? Can you post any relevant logs and screenshots (preferably of the deploy, nginx, web components as the 502 is pretty self-explanatory). Deployments should follow the normal settings with the caveat that I've not attempted the "single server" installation.

@mrjoshuap
Copy link
Copy Markdown
Contributor Author

@Ariec9000 thoughts? Still having problems?

@Ariec9000
Copy link
Copy Markdown

@Ariec9000? Все еще не можете решить проблему?

I returned everything to its original state in order to make other settings and work with the translation. I'll try again this weekend.

@miko007
Copy link
Copy Markdown

miko007 commented Feb 18, 2026

how likely is it that this is gonna be merged? would be a very useful feature.

@mrjoshuap
Copy link
Copy Markdown
Contributor Author

Of course I'm biased and I can't answer that question, but I run this branch on a couple of my instances without issue. I periodically sync it with main to keep it conflict-free.

@mrjoshuap mrjoshuap changed the title Feat enhanced admin dashboard feat: enhanced admin dashboard Feb 18, 2026
@Ariec9000
Copy link
Copy Markdown

@mrjoshuap It works. Previously, I made changes to each file individually, which caused the problem. Now, I just replaced the files with the necessary ones, and it started working right away.
image

@Ariec9000
Copy link
Copy Markdown

It is possible to make the links in these cards functional, rather than just opening a general list. I mean, if it's a card with files uploaded in the past 7 days, the link should lead to a section where only those uploaded files are displayed.
image

And in the user statistic the same
image

@mrjoshuap
Copy link
Copy Markdown
Contributor Author

That's great, @Ariec9000!

I have the same thoughts and desire to make functional links, however, they require additional modifications to the portal for each section and I didn't want to make too big of a change for the first iteration, so I settled on a "View All" approach. The changes are easy enough, as I've done similar though I would like to see this merged before I started work on them.

I also thought about making the timeframe configurable (like 1d, 7d, 1mo, 3mo, 12mo). In addition, making a new front end page that would show similar data points might be useful.

@Ariec9000
Copy link
Copy Markdown

@mrjoshuap how do you look at that to add to the administration panel, the ability to flexibly change the pop-up sidebar, on the portal, namely, add and remove the items?
image

@mrjoshuap
Copy link
Copy Markdown
Contributor Author

Those are all managed in the front end node.js code, which is separate from the admin portal.

They can be rearranged and more though it requires some code changes. There is a way to add custom pages to the sidebar which is documented that does not require code changes.

The trouble is making them optionally hidden or configurable because the backend configuration in Python is not available to node.js without some state management code...

@miko007
Copy link
Copy Markdown

miko007 commented Feb 24, 2026

@mrjoshuap wouldn't it be beneficial in general to integrate the whole admin portal into the frontend long-term? is there a specific reason for that distinction?

@mrjoshuap
Copy link
Copy Markdown
Contributor Author

@miko007 well, the admin portal is a Django artifact and is relatively low code from a UI perspective. Think data model rendering. There are many of the features I would love to see in the front end though it would be a considerable amount of new node.js code to write and maintain. I don't know it is the best idea to have all of it the front end from a security perspective. Some of the fields shouldn't be messed with.

Maybe @mgogoulos can elaborate more?

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.

4 participants