Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/next/components/statistics/active-projects.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Table } from "antd";67import { HistoricCounts } from "@cocalc/util/db-schema/stats";8import { Paragraph, Title } from "components/misc";9import { ZEROS } from "./misc";1011interface Props {12active: HistoricCounts;13created: HistoricCounts;14running: { free: number; member: number };15style?: React.CSSProperties;16}1718const columns = [19{ title: "Projects", dataIndex: "type", key: "type" },20{ title: "Now", dataIndex: "5min", key: "5m" },21{ title: "Hour", dataIndex: "1h", key: "1h" },22{ title: "Day", dataIndex: "1d", key: "1d" },23{ title: "Week", dataIndex: "7d", key: "7d" },24{ title: "Month", dataIndex: "30d", key: "30d" },25];2627export default function ActiveProject({28created,29active,30running,31style,32}: Props) {33const rows = [34{ type: "Actively being used", ...ZEROS, ...active },35{ type: "Created", ...ZEROS, "5min": "-", ...created },36];37return (38<div style={style}>39<Title level={2}>Running Projects: {running.free + running.member}</Title>40<Paragraph>41There are {running.free + running.member} projects running right now.42Track the number of projects that were actively being used and the43number that were created below.44</Paragraph>45<Table46dataSource={rows}47columns={columns}48bordered49pagination={false}50rowKey={"type"}51/>52</div>53);54}555657