devices.sensor.community
devices.sensor.community copied to clipboard
Dynamic hardware configuration form
Internally Hardware configuration part of sensor registration/settings form supports arbitrary number of sensors, but right now only 2 sets of fields are rendered. This needs a couple of lines of javascript to handle special button that'd dynamically clone one of the rows and replace -0-
part of all name
, id
and for
attributes of <input>
fields with consecutive numbers.
Related code: https://github.com/opendata-stuttgart/meine-luftdaten-info/blob/c92728bfa7e91c6803b3ad3f88969b24bc20bcda/webapp/templates/sensor-settings-form.html#L29-L36