diff --git a/src/components/tool/guide/Config/AlertHelper.js b/src/components/tool/guide/Config/AlertHelper.js index 81f2cb2f..64fc7e3b 100644 --- a/src/components/tool/guide/Config/AlertHelper.js +++ b/src/components/tool/guide/Config/AlertHelper.js @@ -1,10 +1,12 @@ import { Alert, AlertIcon, Box, CloseButton, Flex } from "@chakra-ui/react"; +import React from "react"; + export default function AlertHelper({ alertDismissible = true, alertType = "info", - alertMsg = null, onClose = {}, + children = null, }) { return ( <> @@ -13,9 +15,9 @@ export default function AlertHelper({ - {alertMsg && typeof alertMsg === "function" - ? alertMsg() - : `${alertMsg}`} + {children && typeof children === "string" + ? `${children}` + : React.isValidElement(children) && children} {alertDismissible && ( + > + {alertMsg} + )} ); diff --git a/src/components/tool/guide/Config/ConfigPicker.js b/src/components/tool/guide/Config/ConfigPicker.js index c7aa4bf4..e073c7c3 100644 --- a/src/components/tool/guide/Config/ConfigPicker.js +++ b/src/components/tool/guide/Config/ConfigPicker.js @@ -34,9 +34,10 @@ export default function ConfigPicker({ + > + {alertMsg} + )} ); diff --git a/src/components/tool/guide/Config/ConfigSlider.js b/src/components/tool/guide/Config/ConfigSlider.js index b22c5618..e63383ae 100644 --- a/src/components/tool/guide/Config/ConfigSlider.js +++ b/src/components/tool/guide/Config/ConfigSlider.js @@ -34,9 +34,10 @@ export default function ConfigSlider({ + > + {alertMsg} + )} ); diff --git a/src/components/tool/guide/EresearchJob/EresearchJob.js b/src/components/tool/guide/EresearchJob/EresearchJob.js index fe713bde..af4f070d 100644 --- a/src/components/tool/guide/EresearchJob/EresearchJob.js +++ b/src/components/tool/guide/EresearchJob/EresearchJob.js @@ -78,20 +78,6 @@ const getConfigGroups = (config, onConfigChange = () => {}) => { }; }, nodes: () => { - const mpiAlertMsg = () => { - return ( - - ); - }; return { element: (key, selected) => ( {}) => { }} showAlert={config?.nodes > 1} alertType="warning" - alertMsg={mpiAlertMsg} + alertMsg={ + + } /> ), show: (config) => @@ -211,20 +208,6 @@ const getConfigGroups = (config, onConfigChange = () => {}) => { ["GPU", "Accelerated GPU"], ]; } - const customAlertMsg = () => { - return ( - - ); - }; return { element: (key, selected) => ( {}) => { }} showAlert={config?.hardware === "IPU"} alertType="warning" - alertMsg={customAlertMsg} + alertMsg={ + + } /> ), show: (config) => config?.service, diff --git a/src/components/tool/guide/HuggingFacePipeline/Model.js b/src/components/tool/guide/HuggingFacePipeline/Model.js index d6c5ca32..d1a422bf 100644 --- a/src/components/tool/guide/HuggingFacePipeline/Model.js +++ b/src/components/tool/guide/HuggingFacePipeline/Model.js @@ -1,6 +1,5 @@ import { CloseIcon, ExternalLinkIcon } from "@chakra-ui/icons"; import { - Alert, Box, Button, Flex, @@ -26,6 +25,7 @@ import { } from "@choc-ui/chakra-autocomplete"; import useData from "../../../hooks/useData"; +import AlertHelper from "../Config/AlertHelper"; function ModelAutoComplete({ model, onModelChange, models }) { return ( @@ -238,9 +238,9 @@ export function Model({ model, onModelChange, task }) { if (modelsError) { return ( - - Error retrieving models: {modelsError.message} - + + {`Error retrieving models: ${modelsError.message}`} + ); } else if (modelsLoading) { return ; diff --git a/src/components/tool/guide/Instructions/AccessInstructions.js b/src/components/tool/guide/Instructions/AccessInstructions.js index 96813660..40373e98 100644 --- a/src/components/tool/guide/Instructions/AccessInstructions.js +++ b/src/components/tool/guide/Instructions/AccessInstructions.js @@ -1,5 +1,6 @@ -import { Code, Link } from "@chakra-ui/react"; +import { Code } from "@chakra-ui/react"; +import TextWithLink from "../../../navigation/TextWithLink"; import CopyBox from "../../../output/CopyBox"; import InstructionHeading from "./components/InstructionHeading"; import InstructionText from "./components/InstructionText"; @@ -37,10 +38,17 @@ export function AccessInstructions({ service, port, node, username }) { )} Access the tool - In your web browser, navigate to the following address:{" "} - - http://localhost:{port} - + http://localhost:{port} diff --git a/src/components/tool/guide/Instructions/ConnectInstructions.js b/src/components/tool/guide/Instructions/ConnectInstructions.js index 3bbdb31d..98b53c83 100644 --- a/src/components/tool/guide/Instructions/ConnectInstructions.js +++ b/src/components/tool/guide/Instructions/ConnectInstructions.js @@ -1,6 +1,8 @@ -import { Alert, AlertIcon, Box, Code, Link, Text } from "@chakra-ui/react"; +import { Box, Code, Flex } from "@chakra-ui/react"; +import TextWithLink from "../../../navigation/TextWithLink"; import CopyBox from "../../../output/CopyBox"; +import AlertHelper from "../Config/AlertHelper"; import InstructionHeading from "./components/InstructionHeading"; import InstructionText from "./components/InstructionText"; import { OperatingSystemTabs } from "./components/OperatingSystemTabs"; @@ -9,48 +11,62 @@ function LyraInstructions({ username }) { return ( <> Connect to Lyra - - - If you are off-campus, you will first need to connect to the QUT network - using the VPN. - + + { + "If you are off-campus, you will first need to connect to the QUT network using the VPN." + } + - See the instructions{" "} - - here - {" "} - for more information about how to use Lyra. + - - - - You may need to enable the{" "} - - ssh feature - {" "} - in Windows. - - + + + - In{" "} - - Windows Terminal - - , Powershell,{" "} - - PuTTY - - , or cmd.exe, run the following command to connect to Lyra: + + + + @@ -83,15 +99,16 @@ function JupyterHubInstructions() { <> Connect to JupyterHub - Visit{" "} - - https://jupyterhub.eres.qut.edu.au - {" "} - and log in with your QUT username and password. + ); @@ -102,30 +119,42 @@ function RvdiInstructions() { <> Connect to rVDI - See the instructions{" "} - - here - {" "} - for more information. + - If you have not already, download and install the VMware Horizon client - from{" "} - - https://rvdi.qut.edu.au - - . + - In the VMware Horizon client, connect to{" "} - - rvdi.qut.edu.au - {" "} - and log in with your QUT username and password. + ); diff --git a/src/components/tool/guide/Instructions/InstallInstructions.js b/src/components/tool/guide/Instructions/InstallInstructions.js index 983afb20..b8864309 100644 --- a/src/components/tool/guide/Instructions/InstallInstructions.js +++ b/src/components/tool/guide/Instructions/InstallInstructions.js @@ -1,15 +1,8 @@ -import { - Alert, - AlertIcon, - Link, - Tab, - TabList, - TabPanel, - TabPanels, - Tabs, -} from "@chakra-ui/react"; +import { Tab, TabList, TabPanel, TabPanels, Tabs } from "@chakra-ui/react"; +import TextWithLink from "../../../navigation/TextWithLink"; import CopyBox from "../../../output/CopyBox"; +import AlertHelper from "../Config/AlertHelper"; import InstructionHeading from "./components/InstructionHeading"; import InstructionText from "./components/InstructionText"; import { singularityContainerName } from "./utils"; @@ -77,15 +70,16 @@ export function InstallInstructions({ Install Singularity (if it has not been installed) - Follow the instructions{" "} - - here - {" "} - to install singularity. + Set up the container Build the container: @@ -144,11 +138,11 @@ export function InstallInstructions({ source ~/.bashrc - - - Packages take a long time to install with conda. We - recommend using mamba instead. - + + { + "Packages take a long time to install with conda. We recommend using mamba instead." + } + Download the latest version of miniconda: @@ -201,15 +195,16 @@ export function InstallInstructions({ Install Python (if it has not been installed) - Follow the instructions{" "} - - here - {" "} - to install python. + )} diff --git a/src/components/tool/guide/Instructions/StartInstructions.js b/src/components/tool/guide/Instructions/StartInstructions.js index 27a9b9d3..edd79358 100644 --- a/src/components/tool/guide/Instructions/StartInstructions.js +++ b/src/components/tool/guide/Instructions/StartInstructions.js @@ -1,8 +1,8 @@ -import { ExternalLinkIcon } from "@chakra-ui/icons"; -import { Box, Checkbox, Code, Flex, Input, Link } from "@chakra-ui/react"; +import { Box, Checkbox, Code, Flex, Input } from "@chakra-ui/react"; import { useState } from "react"; +import TextWithLink from "../../../navigation/TextWithLink"; import CopyBox from "../../../output/CopyBox"; import InstructionHeading from "./components/InstructionHeading"; import InstructionText from "./components/InstructionText"; @@ -100,18 +100,23 @@ export function LyraStartInstructions({ command-line argument. - Pick your favourite text editor (e.g.: nano,{" "} - vim or gedit). If you do not know how to - use text editors, please{" "} - - refer here - - - . + + Pick your favourite text editor (e.g.: nano,{" "} + vim or gedit). + + )} @@ -186,17 +191,19 @@ export function JupyterHubStartInstructions({ jobProfile }) { Wait for the to be redirected. - It may take up to 10 minutes for your job to be queued and for the - server to start. If it fails to start, please raise an incident in the{" "} - - eResearch help centre - - - . + ); diff --git a/src/components/tool/guide/Instructions/TeardownInstructions.js b/src/components/tool/guide/Instructions/TeardownInstructions.js index f643516f..1d6f9333 100644 --- a/src/components/tool/guide/Instructions/TeardownInstructions.js +++ b/src/components/tool/guide/Instructions/TeardownInstructions.js @@ -1,6 +1,7 @@ -import { Alert, AlertIcon, Code, Kbd } from "@chakra-ui/react"; +import { Code, Kbd } from "@chakra-ui/react"; import CopyBox from "../../../output/CopyBox"; +import AlertHelper from "../Config/AlertHelper"; import InstructionHeading from "./components/InstructionHeading"; import InstructionText from "./components/InstructionText"; @@ -14,10 +15,9 @@ export function TeardownInstructions({ <> {service === "Lyra" && ( <> - - - Lyra is a shared resource, only request the resources you need. - + + {"Lyra is a shared resource, only request the resources you need."} + )} {usingTool && (