Skip to content

Commit

Permalink
Add disabled prop to all mledge entities
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Sep 10, 2024
1 parent 1350d4e commit cb259c7
Showing 1 changed file with 40 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,68 +76,85 @@ const devices = [
type: 'x86',
site: 'TACC',
gpu: false,
disabled: false,
},
{
id: 2,
name: 'x86 (no GPU)',
type: 'compute_cascadelake',
site: 'CHAMELEON',
gpu: true,
disabled: false,
},
{
id: 3,
name: 'Jetson Nano',
type: 'Jetson',
site: 'TACC',
gpu: true,
disabled: false,
},
{
id: 4,
name: 'x86 (gpu_p100)',
type: 'gpu_p100',
gpu: true,
site: 'CHAMELEON',
disabled: false,
},
{
id: 5,
name: 'x86 (gpu_m40)',
type: 'gpu_m40',
gpu: true,
site: 'CHAMELEON',
disabled: false,
},
{
id: 6,
name: 'x86 (gpu_k80)',
type: 'gpu_k80',
gpu: true,
site: 'CHAMELEON',
disabled: false,
},
];

const models = [
{
model_id: 'megadetectorv5-ft-kudu',
name: 'MegaDetector v5 (FT Kudu)',
disabled: true,
},
{
model_id: 'megadetectorv5a',
name: 'MegaDetector v5a',
disabled: false,
},
{
model_id: 'megadetectorv5b',
name: 'MegaDetector v5b',
disabled: false,
},
{
model_id: 'megadetectorv5c',
name: 'MegaDetector v5c',
disabled: false,
},
{
model_id: '41d3ed40-b836-4a62-b3fb-67cee79f33d9-model',
name: 'MegaDetector v4.1',
disabled: true,
},
{
model_id: 'megadetectorv5-ft-ena',
name: 'MegaDetector v5 (FT ENA)',
disabled: true,
},
{
model_id: 'bioclip',
name: 'BioClip',
disabled: true,
},
];

Expand All @@ -146,21 +163,25 @@ const datasets = [
id: '15-image',
url: '',
name: '15 Image',
disabled: false,
},
{
id: 'ena',
url: 'https://storage.googleapis.com/public-datasets-lila/ena24/ena24.zip',
name: 'ENA',
disabled: true,
},
{
id: 'ohio-small-animals',
url: 'ohio-small-animals',
name: 'Ohio Small Animals',
disabled: true,
},
{
id: 'okavango-delta',
url: 'okavango-delta',
name: 'Okavango Delta',
disabled: true,
},
];

Expand Down Expand Up @@ -298,7 +319,7 @@ const AnalysisForm: React.FC = () => {
report: 'Download',
};
const dataset = datasets.filter(
(d) => d.id == values.dataset
(dataset) => dataset.id == values.dataset
)[0];
const device = devices.filter((d) => d.id == values.device)[0];
const envVariables = [
Expand Down Expand Up @@ -328,6 +349,8 @@ const AnalysisForm: React.FC = () => {
},
];

console.log({ envVariables });

// Add advnacedConfig to the envVariables to if defined
if (values.advancedConfig) {
envVariables.push({
Expand Down Expand Up @@ -420,7 +443,12 @@ const AnalysisForm: React.FC = () => {
<option value="" label="Select option" />
{models.map((model) => {
return (
<option value={model.model_id}>{model.name}</option>
<option
disabled={model.disabled}
value={model.model_id}
>
{model.name}
</option>
);
})}
<option value="url" label="-- provide model url --" />
Expand Down Expand Up @@ -496,7 +524,11 @@ const AnalysisForm: React.FC = () => {
<option value="" label="Select option" />
{datasets.map((dataset) => {
return (
<option value={dataset.id} label={dataset.name} />
<option
disabled={dataset.disabled}
value={dataset.id}
label={dataset.name}
/>
);
})}
<option value="url" label="-- provide dataset url --" />
Expand Down Expand Up @@ -607,7 +639,11 @@ const AnalysisForm: React.FC = () => {
{devices.map((device) => {
if (device.site === values.site) {
return (
<option value={device.id} label={device.name} />
<option
disabled={device.disabled}
value={device.id}
label={device.name}
/>
);
}
})}
Expand Down

0 comments on commit cb259c7

Please sign in to comment.