mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
Show anonymous user count on dashboard (#1000)
This commit is contained in:
parent
1e36f0e83b
commit
dfd1fb7831
@ -12,9 +12,21 @@ import { useAdminApp } from "../use-admin-app";
|
||||
|
||||
function TotalUsersDisplay() {
|
||||
const stackAdminApp = useAdminApp();
|
||||
const data = (stackAdminApp as any)[stackAppInternalsSymbol].useMetrics();
|
||||
const metrics = (stackAdminApp as any)[stackAppInternalsSymbol].useMetrics(false);
|
||||
const metricsIncludingAnonymous = (stackAdminApp as any)[stackAppInternalsSymbol].useMetrics(true);
|
||||
|
||||
return <>{data.total_users}</>;
|
||||
const anonymousUsersCount = metricsIncludingAnonymous.total_users - metrics.total_users;
|
||||
|
||||
return (
|
||||
<>
|
||||
{metrics.total_users}
|
||||
{anonymousUsersCount > 0 ? (
|
||||
<>
|
||||
{" "}(+ {anonymousUsersCount} anonymous)
|
||||
</>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default function PageClient() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user