{% extends 'base.html' %} {% load static %} {% block title %}System Activity Analysis{% endblock %} {% block extra_css %} {% endblock %} {% block content %}

📈 System Activity Analysis

Analyze Individual User
{{ active_users|length }}
Active Users
{{ module_activity|length }}
Active Modules
{{ after_hours|length }}
After-Hours Users
{{ bulk_operations|length }}
Bulk Operations
đŸ‘Ĩ Most Active Users (Last {{ days }} Days)
{% for user in active_users %} {% empty %} {% endfor %}
User Role Total Activities Security Events Activity Level Action
{{ user.user__first_name }} {{ user.user__last_name }} {{ user.user__role|title }} {{ user.activity_count }} {% if user.security_events > 0 %} {{ user.security_events }} {% else %} 0 {% endif %} {% if user.activity_count > 100 %} High {% elif user.activity_count > 50 %} Medium {% else %} Low {% endif %} 📈 Analyze
No user activity data available
📊 Activity Distribution
đŸ“Ļ Module Activity Overview
{% for module in module_activity %}
{{ module.module|title }} {{ module.unique_users }} users
{% with max_count=module_activity.0.count %}
{% endwith %}
{{ module.count }} activities
{% empty %}

No module activity data available

{% endfor %}
📊 Activity Trends
🌙 After-Hours Activity
{% if after_hours %}
âš ī¸ {{ after_hours|length }} users have been active outside normal business hours.
{% endif %} {% for activity in after_hours %}
{{ activity.user__first_name }} {{ activity.user__last_name }}
Outside business hours activity
{{ activity.count }} activities
Analyze
{% empty %}
✓

No after-hours activity detected

{% endfor %}
Bulk Operations
{% if bulk_operations %}
â„šī¸ {{ bulk_operations|length }} users have performed bulk operations.
{% endif %} {% for operation in bulk_operations %}
{{ operation.user__first_name }} {{ operation.user__last_name }}
{{ operation.action|title }}
{{ operation.count }} operations
Analyze
{% empty %}
â„šī¸

No bulk operations detected

{% endfor %}
System Health Indicators

{% if active_users %} {% with total_activities=0 %} {% for user in active_users %} {% with total_activities=total_activities|add:user.activity_count %} {% endwith %} {% endfor %} {% widthratio total_activities active_users|length 1 %} {% endwith %} {% else %} 0 {% endif %}

Avg Activities per User

{{ after_hours|length }}

After-Hours Users

{{ module_activity|length }}

Active Modules

{{ bulk_operations|length }}

Bulk Operations
System Recommendations:
    {% if after_hours|length > 5 %}
  • âš ī¸ Consider reviewing after-hours access policies - {{ after_hours|length }} users active outside business hours
  • {% endif %} {% if bulk_operations|length > 10 %}
  • â„šī¸ High bulk operation activity detected - ensure proper authorization controls
  • {% endif %} {% if active_users|length < 5 %}
  • ❓ Low user activity - consider user engagement strategies
  • {% endif %}
  • ✓ Regular monitoring of user activity patterns is recommended
{% endblock %} {% block extra_js %} {% endblock %}