unclesp1d3r/CipherSwarm

View on GitHub
app/views/agents/_form.html.erb

Summary

Maintainability
Test Coverage
<%= simple_form_for @agent do |f| %>
  <%= render Railsboot::ErrorsComponent.new(@agent) %>


  <%= f.input :custom_label, hint: "A custom label for the agent" %>
  <% if @agent.new_record? %>
    <small class="text-muted">A random host name will be generated until the agent checks in for the first time</small>
  <% end %>
  <%= f.input :enabled, hint: "Permitted to request jobs and cracker updates" %>
  <%= f.association :user, hint: "The user that the agent is associated with" if current_user.has_role?(:admin) %>
  <%= f.association :projects, as: :check_boxes,
                               hint: "Specifies which projects the agent can process tasks for. If none are selected, only non-sensitive tasks can be handled" %>

  <fieldset>
    <legend>Advanced Configuration</legend>
    <%= f.simple_fields_for :advanced_configuration do |a| %>
      <%= a.input :agent_update_interval,
                  hint: "Specifies the frequency, in seconds, that the agent calls in to request a new task" %>
      <%= a.input :use_native_hashcat,
                  hint: "Use the hashcat already installed on the system" %>
      <%= 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" %>
    <% end %>
  </fieldset>

  <%= f.button :submit, class: "btn btn-primary" %>
  <%= render Railsboot::ButtonComponent.new(tag: "a", href: agents_path, variant: "danger", text: "Cancel") %>
<% end %>