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/account/ssh-keys/global-ssh-keys.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { FormattedMessage } from "react-intl";67import { Col, Row } from "@cocalc/frontend/antd-bootstrap";8import { redux, useRedux } from "@cocalc/frontend/app-framework";9import { A, Paragraph, Text } from "@cocalc/frontend/components";10import { Footer } from "@cocalc/frontend/customize";11import { COLORS } from "@cocalc/util/theme";1213import { SSHKeyAdder } from "./ssh-key-adder";14import { SSHKeyList } from "./ssh-key-list";1516export const SSHKeysPage: React.FC = () => {17const ssh_keys = useRedux("account", "ssh_keys");1819function render_pre_list_message() {20return (21<Paragraph style={{ color: COLORS.GRAY_M }}>22<FormattedMessage23id="account.global-ssh-keys.info"24defaultMessage={`The global SSH keys listed here allow you to connect from your computer via SSH25to <strong><i>all projects</i> and <i>compute servers</i></strong>26on which you are an owner or collaborator.27Alternatively, set SSH keys that grant access only to a project in the settings for that project.28See <A>the docs</A>29or the SSH part of the settings page in a project for further instructions.`}30values={{31strong: (c) => <Text strong>{c}</Text>,32i: (c) => <i>{c}</i>,33A: (c) => <A href="https://doc.cocalc.com/account/ssh.html">{c}</A>,34}}35/>36</Paragraph>37);38}3940function help() {41return (42<Paragraph>43<FormattedMessage44id="account.global-ssh-keys.help"45defaultMessage={`To SSH into a project, use the following46<code>username@host: [project-id-without-dashes]@ssh.cocalc.com</code>47The project id without dashes can be found in the part of project settings about SSH keys.48To SSH between projects, use <code>[project-id-without-dashes]@ssh</code>`}49values={{ code: (c) => <Paragraph code>{c}</Paragraph> }}50/>51</Paragraph>52);53}5455return (56<div style={{ marginTop: "1em" }}>57<Row>58<Col md={10}>{render_pre_list_message()}</Col>59<Col md={2}>60<div style={{ marginTop: "10px", fontSize: "12pt" }}>61<A href="https://doc.cocalc.com/account/ssh.html">Docs...</A>62</div>63</Col>64<Col md={12}>65<SSHKeyList help={help()} ssh_keys={ssh_keys} />66<SSHKeyAdder67add_ssh_key={(opts) =>68redux.getActions("account").add_ssh_key(opts)69}70style={{ marginBottom: "0px" }}71/>72</Col>73</Row>74<Footer />75</div>76);77};787980