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/purchases.tsx
Views: 687
import type {1ComputeServer,2ComputeServerNetworkUsage,3ComputeServerStorage,4} from "@cocalc/util/db-schema/purchases";5import Description from "./description";6import State, { DisplayNetworkUsage } from "./state";7import InlineComputeServer from "./inline";8import Cost from "@cocalc/frontend/purchases/pay-as-you-go/cost";9import InlineCloudFilesystem from "./cloud-filesystem/inline";10import { WhenKnown } from "@cocalc/frontend/compute/state";1112export function ComputeServerDescription({13description,14period_end,15}: {16description: ComputeServer;17period_end?: Date;18}) {19const { state, configuration, compute_server_id: id } = description;2021return (22<div>23<InlineComputeServer id={id} /> that {period_end ? "was" : "is"}{" "}24<State25id={id}26configuration={configuration}27state={state}28style={{ display: "inline-block" }}29/>30.31<Description configuration={configuration} state={state} short />32</div>33);34}3536export function ComputeServerNetworkUsageDescription({37description,38period_end,39}: {40description: ComputeServerNetworkUsage;41period_end?: Date;42}) {43const { amount, compute_server_id: id } = description;4445return (46<div>47<DisplayNetworkUsage48amount={amount}49style={{ display: "inline-block" }}50period_end={period_end}51cost={description.cost}52/>{" "}53Network used by <InlineComputeServer id={id} />.{" "}54{period_end == null && (55<div>56<Cost service="compute-server-network-usage" inline /> Usage is57updated hourly.58</div>59)}60</div>61);62}6364export function ComputeServerStorageDescription({65description,66period_end,67}: {68description: ComputeServerStorage;69period_end?: Date;70}) {71const { cloud_filesystem_id } = description;7273return (74<div>75Cloud Storage used by{" "}76<InlineCloudFilesystem77cloud_filesystem_id={cloud_filesystem_id}78showProject79/>80. {period_end == null && <Cost service="compute-server-storage" inline />}{" "}81{description.cost == null && <WhenKnown period_end={period_end} />}82</div>83);84}858687