<.header> {@page_title} <:subtitle> {if @live_action == :new, do: "Add new equipment to monitor", else: "Update equipment details"}
<.form for={@form} id="equipment-form" phx-change="validate" phx-submit="save"> <.input field={@form[:name]} type="text" label="Equipment Name" required /> <.input field={@form[:ip_address]} type="text" label="IP Address" required /> <.input field={@form[:site_id]} type="select" label="Site" required prompt="Select a site" options={Enum.map(@available_sites, &{&1.name, &1.id})} /> <.input field={@form[:description]} type="textarea" label="Description" /> <.input field={@form[:check_interval_seconds]} type="number" label="Check Interval (seconds)" min="30" max="3600" /> <.input field={@form[:monitoring_enabled]} type="checkbox" label="Enable Monitoring" />

SNMP Configuration

Enable SNMP to discover device details, monitor sensors, and track interface statistics.

<.input field={@form[:snmp_enabled]} type="checkbox" label="Enable SNMP Monitoring" />
<.input field={@form[:snmp_version]} type="select" label="SNMP Version" required value={@form[:snmp_version].value || "2c"} options={[{"SNMPv1", "1"}, {"SNMPv2c", "2c"}]} /> <.input field={@form[:snmp_community]} type="text" label="Community String" required autocomplete="off" /> <.input field={@form[:snmp_port]} type="number" label="SNMP Port" min="1" max="65535" value={@form[:snmp_port].value || 161} />
<.icon :if={@snmp_test_result.success} name="hero-check-circle" class="w-5 h-5" /> <.icon :if={!@snmp_test_result.success} name="hero-x-circle" class="w-5 h-5" /> {@snmp_test_result.message}
<.button type="button" phx-click="test_snmp" phx-disable-with="Testing..."> Test SNMP Connection
<.button phx-disable-with="Saving..." variant="primary">Save Equipment <.button navigate={~p"/orgs/#{@organization.slug}/equipment"}>Cancel