-
Notifications
You must be signed in to change notification settings - Fork 528
feat: Add "last active" tracking and sorting to admin dashboard #995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
backend/airweave/api/deps.py
Outdated
# Update last login timestamp | ||
user.last_login_at = datetime.utcnow() | ||
await db.commit() | ||
await db.refresh(user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best to use crud module for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you too fast man. checking now, BTW i'm renaming this to last_active_at.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW what's the gain in using the crud layer here rather than the direct approach? every request is gonna go through this and as far as i'm concerned the crud layer has permission checks that don't necessarily apply to this use case?
TBF the overhead is minimal so idc, just wanted to check if there's a reason other than consistency.
2bcb4a6
to
f4f307e
Compare
f4f307e
to
2fc852e
Compare
lgtm! |
Adds "Last Seen" tracking for users and displays it in the admin dashboard with sorting capability. Shows the most recent login timestamp across all users in each organization.
Backend
models/user.py
): Addedlast_active_at
timestamp fieldschemas/user.py
): Addedlast_active_at
to schemalast_active_at
column touser
tableapi/deps.py
): Updateslast_active_at
on every Auth0 loginapi/v1/endpoints/admin.py
):last_active_at
per organizationlast_active_at
last_active_at
inOrganizationMetrics
responseschemas/admin.py
): Addedlast_active_at
field toOrganizationMetrics
Frontend
pages/AdminDashboard.tsx
):last_active_at
to TypeScript typesNotes
NULL
last_active_at until they log in again. Shows up on dashboard as "-"Summary by cubic
Adds last login tracking and a sortable “Last Login” column to the admin dashboard to surface recent activity per organization. Admins can now quickly see and sort by the most recent user login across orgs.
New Features
Migration