diff --git a/public/locales/en/app.json b/public/locales/en/app.json index ecf1143ad..9f5d38712 100644 --- a/public/locales/en/app.json +++ b/public/locales/en/app.json @@ -30,8 +30,7 @@ "unselectAll": "Unselect all" }, "cliModal": { - "description": "Paste the following into your terminal to do this task in IPFS via the command line. Remember that you'll need to replace placeholders with your specific parameters.", - "extraNotes": "If you've made changes to the config in this page's code editor that you'd like to save, click the download icon next to the copy button to download it as a JSON file." + "description": "Paste the following into your terminal to do this task in IPFS via the command line. Remember that you'll need to replace placeholders with your specific parameters." }, "nav": { "bugsLink": "Report a bug", diff --git a/public/locales/en/files.json b/public/locales/en/files.json index afd7a4631..5f0e69105 100644 --- a/public/locales/en/files.json +++ b/public/locales/en/files.json @@ -19,6 +19,9 @@ "copyHash": "Copy CID", "share": "Share link" }, + "cliModal": { + "extraNotesPinning": "This command is only for local pinning/unpinning. If you want to use a remote pinning service, consult that service's documentation to learn how to pin/unpin from the command line." + }, "shareModal": { "title": "Share files", "description": "Copy the link below and share it with your friends." diff --git a/public/locales/en/settings.json b/public/locales/en/settings.json index 9bfb50642..0b383a774 100644 --- a/public/locales/en/settings.json +++ b/public/locales/en/settings.json @@ -19,6 +19,9 @@ }, "apiDescription": "<0>If your node is configured with a <1>custom API address, including a port other than the default 5001, enter it here.", "cliDescription": "<0>Enable this option to display a \"view code\" <1> icon next to common IPFS commands. Clicking it opens a modal with that command's CLI code, so you can paste it into the IPFS command-line interface in your terminal.", + "cliModal": { + "extraNotesJsonConfig": "If you've made changes to the config in this page's code editor that you'd like to save, click the download icon next to the copy button to download it as a JSON file." + }, "pinningModal": { "title": "Select a pinning service provider.", "description": "Don’t see your pinning service provider? <1>Add a custom one.<1>" diff --git a/src/bundles/files/consts.js b/src/bundles/files/consts.js index 47a2fda4e..20fdc1ccf 100644 --- a/src/bundles/files/consts.js +++ b/src/bundles/files/consts.js @@ -85,6 +85,10 @@ export const cliCmdKeys = { ADD_NEW_PEER: 'addNewPeer' } +export const cliCmdPrefixes = { + PIN_OBJECT: 'ipfs pin' +} + export const cliCommandList = { [cliCmdKeys.UPDATE_IPFS_CONFIG]: () => 'ipfs config replace ', /** @@ -99,7 +103,7 @@ export const cliCommandList = { * @param {string} cid * @param {string} op */ - [cliCmdKeys.PIN_OBJECT]: (cid, op) => `ipfs pin ${op} ${cid}`, + [cliCmdKeys.PIN_OBJECT]: (cid, op) => `${cliCmdPrefixes.PIN_OBJECT} ${op} ${cid}`, /** * @param {string} filePath * @param {string} fileName diff --git a/src/components/cli-tutor-mode/CliTutorMode.js b/src/components/cli-tutor-mode/CliTutorMode.js index a3671a842..f65e32165 100644 --- a/src/components/cli-tutor-mode/CliTutorMode.js +++ b/src/components/cli-tutor-mode/CliTutorMode.js @@ -9,7 +9,7 @@ import Button from '../button/Button' import Overlay from '../overlay/Overlay' import Shell from '../shell/Shell' import StrokeDownload from '../../icons/StrokeDownload' -import { cliCmdKeys, cliCommandList } from '../../bundles/files/consts' +import { cliCmdKeys, cliCommandList, cliCmdPrefixes } from '../../bundles/files/consts' export const CliTutorialModal = ({ command, t, onLeave, className, downloadConfig, ...props }) => { const onClickCopyToClipboard = (cmd) => { @@ -25,7 +25,8 @@ export const CliTutorialModal = ({ command, t, onLeave, className, downloadConfi {t('app:cliModal.description')}

- { command && command === cliCommandList[cliCmdKeys.UPDATE_IPFS_CONFIG]() ? t('app:cliModal.extraNotes') : ''} + { command && command === cliCommandList[cliCmdKeys.UPDATE_IPFS_CONFIG]() ? t('settings:cliModal.extraNotesJsonConfig') : ''} + { command && command.startsWith(cliCmdPrefixes.PIN_OBJECT) ? t('files:cliModal.extraNotesPinning') : ''}