-
Notifications
You must be signed in to change notification settings - Fork 22
Adds new tile on the admin home page with system data. #301
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
base: develop
Are you sure you want to change the base?
Adds new tile on the admin home page with system data. #301
Conversation
… active users bug in the pie chart
| return; | ||
| } | ||
|
|
||
| const acls = await aclManager.fetchAllACLs(h3); |
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.
I don't think we need this redundant check here for this endpoint. Did you copy it from the task listen endpoint?
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.
I copied it from the notification wg.get.ts. I can remove it.
| @@ -0,0 +1,81 @@ | |||
| /* | |||
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.
Just remember to remove this comment when you're finished the PR
| this.listeners.get(userId)?.delete(id); | ||
| } | ||
|
|
||
| private async catchupListener(userId: string, id: string) { |
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.
What is this catchupListener function? I don't get what it's trying to do with the setTimeout at the end.
In the original notification system, it's used to send old notifications to newly connected websockets.
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.
The function was copied from the notification file as well. I just added a recursive call so that it will be triggered periodically. If you have a better way of dealing with this, let me know and i'll adjust the code.
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.
I think setInterval is the right thing to use
| const activeSessions = | ||
| ( | ||
| await prisma.client.groupBy({ | ||
| await prisma.session.groupBy({ |
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.
This is okay-ish (works for now but isn't how it's supposed to be). The session store supports multiple backends (database, RAM, KV, etc), this implementation will only work if it's using the DB backend.
To do it properly, we'd need to update the session interface. I can do that if you'd like, or you can take a crack at it.
| @@ -0,0 +1,7 @@ | |||
| export const getPercentage = (value: number, total: number) => { | |||
| const percentage = ((total - value) * 100) / total; | |||
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.
Isn't this backwards? Shouldn't it be (value / total) * 100?
|
Just threw up a review of this PR, got some questions about it. |
|
How's this PR going? |
|
Sorry, hadn't had time lately. I will get back to it at some point during
next week.
…On Fri 19 Dec 2025, 13:30 DecDuck, ***@***.***> wrote:
*DecDuck* left a comment (Drop-OSS/drop#301)
<#301 (comment)>
How's this PR going?
—
Reply to this email directly, view it on GitHub
<#301 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGO6D2LEDME43KTXEVXFDT4CP4XNAVCNFSM6AAAAACODJXK2SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMNZVGA4TQNBWGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
Any updates? |
Also fixes the active users bug in the pie chart.
Two things to note here:
pnpm dev, the progress bars for cpu and ram usage don't load properly at first, but work fine after a few seconds.Here's a screenshot the update: