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/frontend/compute/cloud/hyperstack/specs.tsx
Views: 687
import NVIDIA from "@cocalc/frontend/compute/nvidia";1import { capitalize, commas, plural } from "@cocalc/util/misc";2import { toGPU } from "./util";3import { humanFlavor } from "@cocalc/util/compute/cloud/hyperstack/flavor";4import { optionKey } from "@cocalc/util/compute/cloud/hyperstack/pricing";5import { DEFAULT_DISK } from "@cocalc/util/compute/cloud/hyperstack/api-types";6import { Tooltip } from "antd";78export default function Specs({9diskSizeGb,10flavor_name,11region_name,12priceData,13}) {14const data = priceData?.options[optionKey({ flavor_name, region_name })];1516if (data == null) {17return (18<div>19{flavor_name} in {region_name}20</div>21);22}23return (24<span>25Standard {humanFlavor(flavor_name)} with{" "}26{data.gpu ? (27<>28<NVIDIA gpu={toGPU(data.gpu)} count={data.gpu_count} />,{" "}29</>30) : (31""32)}33{data.cpu} {plural(data.cpu, "vCPU")}, {commas(data.ram)} GB RAM,{" "}34{commas(diskSizeGb ?? DEFAULT_DISK)} GB persistent SSD disk35{data.ephemeral ? (36<Tooltip37title={`The ephemeral disk is mounted at /ephemeral, and is deleted when the compute server is shutdown or rebooted. Part of this disk is also used for caching.`}38>39{" "}40and {commas(data.ephemeral)} GB ephemeral disk41</Tooltip>42) : undefined}{" "}43in {capitalize(region_name.toLowerCase().split("-")[0])}.44</span>45);46}474849