Skip to content
Snippets Groups Projects
Commit 9609a1c3 authored by ali asaria's avatar ali asaria
Browse files

improve new node modal

parent 16b694b9
No related branches found
No related tags found
No related merge requests found
...@@ -101,36 +101,53 @@ export default function NewNodeModal({ ...@@ -101,36 +101,53 @@ export default function NewNodeModal({
}} }}
> >
<Stack spacing={2}> <Stack spacing={2}>
<Select <FormControl>
labelId="mode-label" <FormLabel>Name</FormLabel>
id="mode-select" <Input autoFocus required name="name" />
value={mode} </FormControl>
onChange={handleModeChange} <FormControl>
> <FormLabel>Type</FormLabel>
<Option value="OTHER">OTHER</Option> <Select
<Option value="TRAIN">TRAIN</Option> labelId="mode-label"
<Option value="EVAL">EVAL</Option> id="mode-select"
</Select> value={mode}
<FormLabel>Name</FormLabel> onChange={handleModeChange}
<Textarea minRows={4} autoFocus required name="name" /> >
{mode == 'TRAIN' ? ( <Option value="OTHER">OTHER</Option>
<Select name="trainingTemplate"> <Option value="TRAIN">TRAIN</Option>
{trainingTemplatesData.map((template) => ( <Option value="EVAL">EVAL</Option>
<Option value={template[1]}>{template[1]}</Option>
))}
</Select> </Select>
) : mode == 'EVAL' ? ( </FormControl>
<Select name="evalTemplate">
{evaluationData.map((template) => ( <FormControl>
<Option value={template.name}>{template.name}</Option> {mode == 'TRAIN' && (
))} <>
</Select> <FormLabel>Training Template</FormLabel>
) : ( <Select name="trainingTemplate">
<FormControl> {trainingTemplatesData.map((template) => (
<FormLabel>Nodes</FormLabel> <Option value={template[1]}>{template[1]}</Option>
<Textarea minRows={4} autoFocus required name="node" /> ))}
</FormControl> </Select>
)} </>
)}
{mode == 'EVAL' && (
<>
<FormLabel>Eval Template</FormLabel>
<Select name="evalTemplate">
{evaluationData.map((template) => (
<Option value={template.name}>{template.name}</Option>
))}
</Select>
</>
)}
{mode == 'OTHER' && (
<>
<FormLabel>Nodes</FormLabel>
<Textarea minRows={4} autoFocus required name="node" />
</>
)}
</FormControl>
<Button type="submit">Submit</Button> <Button type="submit">Submit</Button>
</Stack> </Stack>
</form> </form>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment