CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/components/statistics/index.tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Stats } from "@cocalc/util/db-schema/stats";
7
import OpenedFiles from "./opened-files";
8
import ActiveUsers from "./active-users";
9
import ActiveProjects from "./active-projects";
10
import A from "components/misc/A";
11
import { CSS, Paragraph } from "components/misc";
12
13
const STYLE: CSS = {
14
marginBottom: "40px",
15
} as const;
16
17
interface Props {
18
stats: Stats;
19
}
20
21
export default function Statistics({ stats }: Props) {
22
return (
23
<div style={{ maxWidth: "100%", overflowX: "auto" }}>
24
<Paragraph style={STYLE}>
25
Last Updated: {new Date(stats.time).toLocaleString()}{" "}
26
<A href="/info/status">(update)</A>
27
</Paragraph>
28
<ActiveUsers
29
created={stats.accounts_created}
30
active={stats.accounts_active}
31
hubServers={stats.hub_servers}
32
style={STYLE}
33
/>
34
<ActiveProjects
35
style={STYLE}
36
created={stats.projects_created}
37
active={stats.projects_edited}
38
running={stats.running_projects}
39
/>
40
<OpenedFiles style={STYLE} filesOpened={stats.files_opened} />
41
</div>
42
);
43
}
44
45