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/allow-collaborator-control.tsx
Views: 687
import { Alert, Checkbox, Switch } from "antd";1import { useState } from "react";2import { Icon } from "@cocalc/frontend/components/icon";34export default function AllowCollaboratorControl({5setConfig,6configuration,7loading,8}) {9const [allowCollaboratorControl, setAllowCollaboratorControl] =10useState<boolean>(!!configuration.allowCollaboratorControl);11const [help, setHelp] = useState<boolean>(false);12return (13<div>14<div style={{ color: "#666", marginBottom: "5px" }}>15<div>16<b>17<Switch18size="small"19checkedChildren={"Help"}20unCheckedChildren={"Help"}21style={{ float: "right" }}22checked={help}23onChange={(val) => setHelp(val)}24/>25<Icon name="users" /> Allow Collaborator Control26</b>27</div>28{help && (29<Alert30showIcon31style={{ margin: "15px 0" }}32type="info"33message={"Allow Collaborators to Control this Compute Server"}34description={35<div>36Any collaborator on this project will be allowed to start, stop,37suspend or resume this compute server. You will be charged for38usage (not them).39</div>40}41/>42)}43<Checkbox44style={{ marginTop: "5px" }}45disabled={loading}46checked={allowCollaboratorControl}47onChange={() => {48setConfig({ allowCollaboratorControl: !allowCollaboratorControl });49setAllowCollaboratorControl(!allowCollaboratorControl);50}}51>52Allow Collaborator Control: allow project collaborators to start,53stop, suspend and resume this compute server (you pay)54</Checkbox>55</div>56</div>57);58}596061