diff --git a/src/components/molecules/RunSettings.tsx b/src/components/molecules/RunSettings.tsx index a12c2e87..88502738 100644 --- a/src/components/molecules/RunSettings.tsx +++ b/src/components/molecules/RunSettings.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import { GenericModal } from "../atoms/GenericModal"; -import { MenuItem, TextField, Typography } from "@mui/material"; +import { MenuItem, TextField, Typography, Switch, FormControlLabel } from "@mui/material"; import { Dropdown } from "../atoms/DropdownMui"; import Button from "@mui/material/Button"; import { modalStyle } from "./AddWhereCondModal"; @@ -21,13 +21,14 @@ export interface RunSettings { } export const RunSettingsModal = ({ isOpen, handleStart, handleClose, isTask, params }: RunSettingsProps) => { - - const [settings, setSettings] = React.useState({ + const [settings, setSettings] = useState({ maxConcurrency: 1, maxRepeats: 1, debug: true, }); + const [showInterpreterSettings, setShowInterpreterSettings] = useState(false); + return ( - {isTask - ? - ( - - Recording parameters: - {params?.map((item, index) => { - return setSettings( - { - ...settings, - params: settings.params - ? { - ...settings.params, - [item]: e.target.value, - } - : { - [item]: e.target.value, - }, - })} - /> - })} - ) - : null - } - Interpreter settings: - setSettings( - { - ...settings, - maxConcurrency: parseInt(e.target.value), - })} - defaultValue={settings.maxConcurrency} + {isTask && ( + + Recording parameters: + {params?.map((item, index) => ( + + setSettings({ + ...settings, + params: settings.params + ? { ...settings.params, [item]: e.target.value } + : { [item]: e.target.value }, + }) + } + /> + ))} + + )} + + setShowInterpreterSettings(!showInterpreterSettings)} />} + label="Show Interpreter Settings" + sx={{ margin: '20px 0px' }} /> - setSettings( - { - ...settings, - maxRepeats: parseInt(e.target.value), - })} - defaultValue={settings.maxRepeats} - /> - setSettings( - { - ...settings, - debug: e.target.value === "true", - })} - > - true - false - - + + {showInterpreterSettings && ( + + Interpreter settings: + + setSettings({ + ...settings, + maxConcurrency: parseInt(e.target.value, 10), + }) + } + defaultValue={settings.maxConcurrency} + /> + + setSettings({ + ...settings, + maxRepeats: parseInt(e.target.value, 10), + }) + } + defaultValue={settings.maxRepeats} + /> + + setSettings({ + ...settings, + debug: e.target.value === "true", + }) + } + > + true + false + + + )} + + ); -} +}; diff --git a/src/components/molecules/UrlForm.tsx b/src/components/molecules/UrlForm.tsx index 487d5cf8..8426f333 100644 --- a/src/components/molecules/UrlForm.tsx +++ b/src/components/molecules/UrlForm.tsx @@ -39,7 +39,8 @@ export const UrlForm = ({ setCurrentAddress(url); lastSubmittedRef.current = url; // Update the last submitted URL } catch (e) { - alert(`ERROR: ${url} is not a valid url!`); + //alert(`ERROR: ${url} is not a valid url!`); + console.log(e) } }, [setCurrentAddress]);