Skip to content

Commit d6f77ca

Browse files
docs
1 parent d914df1 commit d6f77ca

File tree

3 files changed

+58
-4
lines changed

3 files changed

+58
-4
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import React from 'react';
2+
3+
export default function CopyToClipboardButton({
4+
content,
5+
label = 'Copy',
6+
copiedLabel = 'Copied!',
7+
className = '',
8+
style = {},
9+
}) {
10+
const [copied, setCopied] = React.useState(false);
11+
12+
const handleCopyClick = async () => {
13+
if (!content || typeof navigator === 'undefined' || !navigator.clipboard) {
14+
return;
15+
}
16+
17+
try {
18+
await navigator.clipboard.writeText(content);
19+
setCopied(true);
20+
setTimeout(() => setCopied(false), 2000);
21+
} catch (error) {
22+
console.error('Unable to copy content to clipboard', error);
23+
}
24+
};
25+
26+
const successStyles = copied
27+
? { backgroundColor: '#2c8b43', borderColor: '#2c8b43', color: '#ffffff' }
28+
: {};
29+
30+
const buttonClassName = ['button button--sm', className]
31+
.filter(Boolean)
32+
.join(' ');
33+
34+
const baseStyle = {
35+
backgroundColor: '#e3e4e6',
36+
border: '1px solid #b7b9bd',
37+
borderColor: '#b7b9bd',
38+
color: '#1b1b1d',
39+
};
40+
41+
return (
42+
<button
43+
type="button"
44+
className={buttonClassName}
45+
onClick={handleCopyClick}
46+
style={{ ...baseStyle, ...style, ...successStyles }}
47+
>
48+
{copied ? copiedLabel : label}
49+
</button>
50+
);
51+
}

user-guide/01-getting-started/02-software-set-up.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ slug: /software-set-up
66
sidebar_class_name: sidebar-item--updated
77
---
88

9-
import TOCInline from '@theme/TOCInline';
10-
import ButtonDownloadVersionedImage from '@site/src/components/ButtonDownloadVersionedImage';
9+
import CopyToClipboardButton from '@site/src/components/CopyToClipboardButton';
1110

1211

1312
### Before you begin
@@ -34,7 +33,7 @@ We'll start with your blank microSD card.
3433
![Click "App options"](/img/user-guide/01-getting-started/02-software-set-up/app_options.png)
3534
4. Click **Edit** next to _Content Repository_.
3635
![Click "Edit" to choose repository](/img/user-guide/01-getting-started/02-software-set-up/content_repo.png)
37-
5. Choose **Use Custom URL**, and paste the value: `https://pioreactor.com/imager/os-list.json`
36+
5. Choose **Use Custom URL**, and paste the value: `https://pioreactor.com/imager/os-list.json` <CopyToClipboardButton content="https://pioreactor.com/imager/os-list.json" label="Copy" style={{ marginLeft: '0.5rem' }} />
3837

3938
![Add our repo URL](/img/user-guide/01-getting-started/02-software-set-up/edit_repo.png)
4039
6. Click **Apply & restart**.

user-guide/30-Advanced/07-remote-access/03-tailscale.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ slug: /tailscale-remote-access
44
hide_table_of_contents: true
55
---
66

7+
import CopyToClipboardButton from '@site/src/components/CopyToClipboardButton';
78

89
To access the UI remotely, you can join an authenticated VPN using Tailscale. This greatly improves security, but adds a bit of additional work for users.
910

@@ -15,7 +16,10 @@ Tailscale is a really cool service! You may find yourself using it for other pro
1516
1. Sign up for an account at [Tailscale](https://tailscale.com/). The free account is fine for now.
1617
2. Once signed up and logged in, visit the [Tailscale admin](https://login.tailscale.com/admin/machines).
1718
3. Install [Tailscale on your computer](https://tailscale.com/download).
18-
4. [SSH into your leader Pioreactor](/user-guide/accessing-raspberry-pi). Install Tailscale for Raspberry Pi with the following: `curl -fsSL https://tailscale.com/install.sh | sh`. Don't miss that you also need to run `sudo tailscale up`. _You don't need to install anything on the workers_.
19+
4. [SSH into your leader Pioreactor](/user-guide/accessing-raspberry-pi).
20+
1. Install Tailscale for Raspberry Pi with the following: `curl -fsSL https://tailscale.com/install.sh | sh` <CopyToClipboardButton content="curl -fsSL https://tailscale.com/install.sh | sh" label="Copy" style={{ marginLeft: '0.5rem' }} />
21+
2. Don't miss that you also need to run `sudo tailscale up` <CopyToClipboardButton content="sudo tailscale up" label="Copy" style={{ marginLeft: '0.5rem' }} />
22+
3. _You don't need to install anything on the workers_.
1923
5. Back in your [Tailscale admin](https://login.tailscale.com/admin/machines), you should see two machines: your computer and the leader Pioreactor. Make note of the ipv4 address for the leader - we will use it below.
2024
6. You should still be able to access `http://pioreactor.local` without any problems.
2125
8. 1. In your **shared config.ini**, add your ipv4 address to the `[mqtt]` section:

0 commit comments

Comments
 (0)