Problem
Currently, the Agent creation/edit form uses plain text inputs for advanced hashcat configuration options like opencl_devices and backend_device. This approach has several issues:
- Poor UX: Users must manually enter comma-separated integers without guidance
- Error-prone: No validation of valid values at input time
- Lack of discoverability: Users don't know what values are valid without consulting hashcat documentation
- Inconsistent with best practices: Modern forms should use appropriate input types for constrained value sets
Current Implementation
File: app/views/agents/_form.html.erb
The form currently uses:
<%= a.input :backend_device,
hint: "Backend devices to use, separated with commas, leave blank to let hashcat decide" %>
<%= a.input :opencl_devices,
hint: "OpenCL device types to use, integers separated with commas, leave blank to let hashcat decide" %>
Model: app/models/advanced_configuration.rb
- Both fields are stored as strings
- Values are comma-separated lists of integers
Proposed Solution
1. OpenCL Devices Field
Replace the text input with a multi-select checkbox group or dropdown multi-select.
Valid options (per hashcat documentation):
1 - CPU
2 - GPU
3 - FPGA, DSP, Co-Processor
Implementation:
- Use
collection_check_boxes or similar to render checkboxes for each device type
- Convert selected values to comma-separated string on save
- Parse comma-separated string to checked values on load
2. Backend Device Field
This field is context-dependent - it should show devices that the agent has reported during initial configuration.
Proposed approach:
- For new agents: Keep as text input (agent hasn't configured yet) OR hide the field entirely until first check-in
- For existing agents: Display a checkbox list of all devices known for that specific agent (from the
devices array attribute)
- Convert selections to comma-separated list of device indices
- Add helper text explaining that device indices correspond to the order in the Capabilities tab
3. Additional Improvements
- Add form validation to ensure only valid integers are submitted
- Consider adding a "Let hashcat decide" checkbox that clears the field when checked
- Update form hints to be more descriptive
- Add visual indicators showing which devices are selected
Implementation Checklist
Related Files
app/views/agents/_form.html.erb - Main form view
app/models/advanced_configuration.rb - Configuration model
app/models/agent.rb - Agent model with devices array
spec/system/agents/create_agent_spec.rb - System tests
spec/support/page_objects/agent_form_page.rb - Test helpers
References
Hashcat OpenCL device types documentation showing the valid enumeration values.
Problem
Currently, the Agent creation/edit form uses plain text inputs for advanced hashcat configuration options like
opencl_devicesandbackend_device. This approach has several issues:Current Implementation
File:
app/views/agents/_form.html.erbThe form currently uses:
Model:
app/models/advanced_configuration.rbProposed Solution
1. OpenCL Devices Field
Replace the text input with a multi-select checkbox group or dropdown multi-select.
Valid options (per hashcat documentation):
1- CPU2- GPU3- FPGA, DSP, Co-ProcessorImplementation:
collection_check_boxesor similar to render checkboxes for each device type2. Backend Device Field
This field is context-dependent - it should show devices that the agent has reported during initial configuration.
Proposed approach:
devicesarray attribute)3. Additional Improvements
Implementation Checklist
app/views/agents/_form.html.erbwith new input typesspec/system/agents/create_agent_spec.rbspec/support/page_objects/agent_form_page.rbAdvancedConfigurationmodel if neededspec/swagger_helper.rbif format changesRelated Files
app/views/agents/_form.html.erb- Main form viewapp/models/advanced_configuration.rb- Configuration modelapp/models/agent.rb- Agent model withdevicesarrayspec/system/agents/create_agent_spec.rb- System testsspec/support/page_objects/agent_form_page.rb- Test helpersReferences
Hashcat OpenCL device types documentation showing the valid enumeration values.