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/ephemeral.tsx
Views: 687
import { Alert, Checkbox, Switch } from "antd";1import { useState } from "react";2import { Icon } from "@cocalc/frontend/components/icon";34export default function Ephemeral({ setConfig, configuration, loading }) {5const [ephemeral, setEphemeral] = useState<boolean>(configuration.ephemeral);6const [help, setHelp] = useState<boolean>(false);7return (8<div>9<div style={{ color: "#666", marginBottom: "5px" }}>10<div>11<b>12<Switch13size="small"14checkedChildren={"Help"}15unCheckedChildren={"Help"}16style={{ float: "right" }}17checked={help}18onChange={(val) => setHelp(val)}19/>20<Icon name="disk-snapshot" /> Ephemeral Compute Server21</b>22</div>23{help && (24<Alert25showIcon26style={{ margin: "15px 0" }}27type="info"28message={"Treat Compute Server as Ephemeral"}29description={30<div>31<p>32Use this setting if you will use this server only for{" "}33<i>temporary computations</i> and want{" "}34<i>maximum flexibility and minimal cost</i>.{" "}35<b>This setting only modifies the user interface</b>; in36particular, the default way to "turn off" the server will37delete its disk.38</p>39<p>40Do you plan to use data on this compute server that you want41to preserve only on the compute server? The HOME directory is42sync'd, except hidden folders and directories explicitly43excluded above. Other files, e.g., in /tmp and systemwide44changes, exist only on the compute server's local disk{" "}45<i>without any automatic backups</i>. (Backup functionality46for local data will be implementd in the future.)47</p>48<p>49If you don't need to preserve data that is not sync'd, this50setting is likely to be convenient.51</p>52</div>53}54/>55)}56<Checkbox57style={{ marginTop: "5px" }}58disabled={loading}59checked={ephemeral}60onChange={() => {61setConfig({ ephemeral: !ephemeral });62setEphemeral(!ephemeral);63}}64>65Ephemeral: I do not need to store data on this compute server between66sessions67</Checkbox>68</div>69</div>70);71}727374