X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/e79b7364ea28b6f0719c9adf409ba1217b9ccac8..da5e144c103d5abb2bca727f40a14e5da052264e:/src/views/run-process-panel/run-process-advanced-form.tsx diff --git a/src/views/run-process-panel/run-process-advanced-form.tsx b/src/views/run-process-panel/run-process-advanced-form.tsx index 19beab6b..52abfe80 100644 --- a/src/views/run-process-panel/run-process-advanced-form.tsx +++ b/src/views/run-process-panel/run-process-advanced-form.tsx @@ -2,23 +2,37 @@ // // SPDX-License-Identifier: AGPL-3.0 -import * as React from 'react'; +import React from 'react'; import { ExpansionPanel, ExpansionPanelDetails, ExpansionPanelSummary } from '@material-ui/core'; import { reduxForm, Field } from 'redux-form'; import { Grid } from '@material-ui/core'; -import { TextField } from '~/components/text-field/text-field'; -import { ExpandIcon } from '~/components/icon/icon'; +import { TextField } from 'components/text-field/text-field'; +import { ExpandIcon } from 'components/icon/icon'; +import * as IntInput from './inputs/int-input'; +import { min } from 'validators/min'; +import { optional } from 'validators/optional'; export const RUN_PROCESS_ADVANCED_FORM = 'runProcessAdvancedForm'; +export const OUTPUT_FIELD = 'output'; +export const RUNTIME_FIELD = 'runtime'; +export const RAM_FIELD = 'ram'; +export const VCPUS_FIELD = 'vcpus'; +export const KEEP_CACHE_RAM_FIELD = 'keep_cache_ram'; +export const RUNNER_IMAGE_FIELD = 'acr_container_image'; + export interface RunProcessAdvancedFormData { - output: string; - runtime: string; + [OUTPUT_FIELD]?: string; + [RUNTIME_FIELD]?: number; + [RAM_FIELD]: number; + [VCPUS_FIELD]: number; + [KEEP_CACHE_RAM_FIELD]: number; + [RUNNER_IMAGE_FIELD]: string; } export const RunProcessAdvancedForm = reduxForm({ - form: RUN_PROCESS_ADVANCED_FORM + form: RUN_PROCESS_ADVANCED_FORM, })(() =>
@@ -29,17 +43,70 @@ export const RunProcessAdvancedForm = + name={RUNTIME_FIELD} + component={TextField as any} + helperText="Maximum running time (in seconds) that this container will be allowed to run before being cancelled." + label="Runtime limit" + parse={IntInput.parse} + format={IntInput.format} + type='number' + validate={runtimeValidation} /> + + + + + + + + + + + +
); + +const ramValidation = [min(0)]; +const vcpusValidation = [min(1)]; +const keepCacheRamValidation = [optional(min(0))]; +const runtimeValidation = [optional(min(1))];