Dynamic form widget

For the following on version 2.0.28, the data-hide-node-type and data-max-bc-num-slots works great but the data-max-memory-per-node does not work. The max memory per node should change to 3000 when mem_node_type is ‘big’ and 360 when mem_node_type is standard but the max remains 3000 despite selecting ‘standard’

---
title: "VNC bigmem"
cluster: "grace"
form:
  - mem_node_type
  - mem_per_node
  - node_type
  - bc_num_slots
  - bc_vnc_resolution
attributes:
  bc_vnc_resolution:
    required: true
  mem_node_type:
    widget: select
    label: "Memory Node type"
    options:
      - [
           "Standard memory (max 360GB)", 'standard',
           data-max-mem-per-node: 360,
           data-max-bc-num-slots: 48,
        ]
      - [
           "Big memory (max 3TB)", 'big',
           data-max-mem-per-node: 3000,
           data-max-bc-num-slots: 80,
           data-hide-node-type: true,
        ]
  mem_per_node:
    label: "Total Memory per node (GB)"
    widget: "number_field"
    value: 7
    min: 7
    max: 3000
    step: 1
    help: |
        - Standard mem node (7 - 360GB)
        - Big mem node (37 - 3000GB)
  node_type:
    widget: select
    label: "Node type"
    options:
      - [ "RTX" ]
      - [ "T4" ]
      - [ "A100" ]
      - [ "ANY" ]
  bc_num_slots:
    label: "Number of cores:"
    value: 1
    min: 1
    max: 80
    step: 1

Hi and welcome! I hate to do this to you on your first topic with us, but that’s a bug on our side.

Thanks, we are able to get around this bug by adding a mem field for each node type and use data-hide which does allow multiple data-hide directives

  standard_mem:
    label: "Total GB memory (max 360)"
    widget: 'number_field'
    value: 1
    min: 1
    max: 360
    step: 1
  big_mem:
    label: "Total GB memory (max 3000)"
    widget: 'number_field'
    value: 7
    min: 7
    max: 3000
    step: 1
  mem_node_type:
    widget: 'select'
    label: "Memory Node type"
    options:
      - [
           "Standard memory (max 360GB)", 'standard',
           data-max-bc-num-slots: 48,
           data-hide-big-mem: true,
        ]
      - [
           "Big memory (max 3TB)", 'big',
           data-max-bc-num-slots: 80,
           data-hide-node-type: true,
           data-hide-standard-mem: true,
        ]

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.