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/pages/info/status.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 { Layout } from "antd";
7
8
import { Icon } from "@cocalc/frontend/components/icon";
9
import Footer from "components/landing/footer";
10
import Head from "components/landing/head";
11
import Header from "components/landing/header";
12
import Statistics from "components/statistics";
13
import { MAX_WIDTH } from "lib/config";
14
import { Customize } from "lib/customize";
15
import getStats from "lib/landing/stats";
16
import withCustomize from "lib/with-customize";
17
import { Paragraph, Title } from "components/misc";
18
19
export default function Stats({ customize, stats }) {
20
const { siteName } = customize;
21
22
return (
23
<Customize value={customize}>
24
<Head title="System Activity Monitor" />
25
<Layout>
26
<Header page="info" subPage="status" />
27
<Layout.Content
28
style={{
29
backgroundColor: "white",
30
}}
31
>
32
<div
33
style={{
34
maxWidth: MAX_WIDTH,
35
margin: "15px auto",
36
padding: "15px",
37
backgroundColor: "white",
38
}}
39
>
40
<div style={{ textAlign: "center" }}>
41
<Title level={1}>
42
<Icon name="dashboard" style={{ marginRight: "30px" }} />
43
{siteName} - System Activity Monitor
44
</Title>
45
<Paragraph>See how much {siteName} is being used right now.</Paragraph>
46
</div>
47
{stats != null ? <Statistics stats={stats} /> : "(not available)"}
48
</div>
49
<Footer />
50
</Layout.Content>
51
</Layout>
52
</Customize>
53
);
54
}
55
56
export async function getServerSideProps(context) {
57
const stats = await getStats();
58
return await withCustomize({ context, props: { stats } });
59
}
60
61