X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/2fe940ec1e978bd9fea2f99e18f1e7aedaf6cf79..2a60ee742601aec7a0bc6ee832da39d834d82eb7:/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 fc67a8d7..30ff494c 100644
--- a/src/views/run-process-panel/run-process-advanced-form.tsx
+++ b/src/views/run-process-panel/run-process-advanced-form.tsx
@@ -12,6 +12,7 @@ import * as IntInput from './inputs/int-input';
 import { require } from '~/validators/require';
 import { min } from '~/validators/min';
 import { optional } from '~/validators/optional';
+import { SwitchField } from '~/components/switch-field/switch-field';
 
 export const RUN_PROCESS_ADVANCED_FORM = 'runProcessAdvancedForm';
 
@@ -20,6 +21,7 @@ export const RUNTIME_FIELD = 'runtime';
 export const RAM_FIELD = 'ram';
 export const VCPUS_FIELD = 'vcpus';
 export const KEEP_CACHE_RAM_FIELD = 'keepCacheRam';
+export const API_FIELD = 'api';
 
 export interface RunProcessAdvancedFormData {
     [OUTPUT_FIELD]?: string;
@@ -27,15 +29,12 @@ export interface RunProcessAdvancedFormData {
     [RAM_FIELD]: number;
     [VCPUS_FIELD]: number;
     [KEEP_CACHE_RAM_FIELD]?: number;
+    [API_FIELD]?: boolean;
 }
 
 export const RunProcessAdvancedForm =
     reduxForm<RunProcessAdvancedFormData>({
         form: RUN_PROCESS_ADVANCED_FORM,
-        initialValues: {
-            [RAM_FIELD]: 1073741824,
-            [VCPUS_FIELD]: 1,
-        },
     })(() =>
         <form>
             <ExpansionPanel elevation={0}>
@@ -54,7 +53,12 @@ export const RunProcessAdvancedForm =
                             <Field
                                 name={RUNTIME_FIELD}
                                 component={TextField}
-                                label="Runtime limit (hh)" />
+                                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} />
                         </Grid>
                         <Grid item xs={12} md={6}>
                             <Field
@@ -91,6 +95,16 @@ export const RunProcessAdvancedForm =
                                 type='number'
                                 validate={keepCacheRamValdation} />
                         </Grid>
+                        <Grid item xs={12} md={6}>
+                            <Field
+                                name={API_FIELD}
+                                component={SwitchField}
+                                switchProps={{
+                                    color: 'primary'
+                                }}
+                                label='API'
+                                helperText='When set, ARVADOS_API_HOST and ARVADOS_API_TOKEN will be set, and process will have networking enabled to access the Arvados API server.' />
+                        </Grid>
                     </Grid>
                 </ExpansionPanelDetails>
             </ExpansionPanel>
@@ -99,3 +113,4 @@ export const RunProcessAdvancedForm =
 const ramValidation = [min(0)];
 const vcpusValidation = [min(1)];
 const keepCacheRamValdation = [optional(min(0))];
+const runtimeValidation = [optional(min(1))];
