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-filesystem/mount-button.tsx
Views: 687
import { Button, Spin, Popconfirm, Switch } from "antd";1import { Icon } from "@cocalc/frontend/components/icon";2import { A } from "@cocalc/frontend/components/A";34interface Props {5cloudFilesystem;6setShowMount?;7}89export default function MountButton({ cloudFilesystem, setShowMount }: Props) {10if (cloudFilesystem.deleting) {11return (12<Popconfirm13title={14<div style={{ maxWidth: "400px" }}>15The Google Cloud Storage bucket is currently being deleted.16Depending on how much data you have, this can take a long time. It17is managed entirely on the backend using the{" "}18<A href="https://cloud.google.com/storage-transfer-service">19Storage Transfer Service20</A>21, so you do not need to keep your browser open.22</div>23}24>25<Button26danger27style={{28fontWeight: 600,29fontSize: "16px",30}}31type="text"32>33Deleting... <Spin style={{ marginLeft: "15px" }} />34</Button>35</Popconfirm>36);37}3839// return (40// <Button41// style={{42// fontWeight: 600,43// fontSize: "16px",44// color: cloudFilesystem.mount ? "#389E0D" : "#FF4B00",45// }}46// type="text"47// onClick={() => {48// setShowMount(true);49// }}50// >51// <Icon52// name={cloudFilesystem.mount ? "run" : "stop"}53// style={{ marginRight: "5px" }}54// />55// {cloudFilesystem.mount ? (56// <Tooltip57// title={`Will attempt to mount at /home/user/${cloudFilesystem.mountpoint} on any running compute server in this project.`}58// >59// Automount60// </Tooltip>61// ) : (62// "Not Mounted"63// )}64// </Button>65// );66return (67<Switch68disabled={setShowMount == null}69onClick={() => {70setShowMount?.(true);71}}72checkedChildren={73<>74<Icon name="run" /> Automount75</>76}77unCheckedChildren={<>Not Mounted</>}78checked={cloudFilesystem.mount}79/>80);81}828384