<%= link_to admin_gateways_path, class: "inline-flex items-center gap-2 text-sm font-medium text-gray-600 hover:text-gray-900 transition-colors" do %> Back to Gateways <% end %>

Register New Gateway

Add a new Android gateway device to your SMS system.

<%= form_with url: admin_gateways_path, method: :post, local: true, class: "space-y-6" do |f| %>
<%= label_tag "gateway[device_id]", "Device ID", class: "block text-sm font-medium text-gray-700" %>
<%= text_field_tag "gateway[device_id]", nil, class: "block w-full pl-10 rounded-lg border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm py-3", placeholder: "device-001", required: true %>

A unique identifier for this gateway device (e.g., phone model, serial number)

<%= label_tag "gateway[name]", "Gateway Name", class: "block text-sm font-medium text-gray-700" %>
<%= text_field_tag "gateway[name]", nil, class: "block w-full pl-10 rounded-lg border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm py-3", placeholder: "Office Phone", required: true %>

A friendly name to identify this gateway

<%= label_tag "gateway[priority]", "Priority", class: "block text-sm font-medium text-gray-700" %>
<%= number_field_tag "gateway[priority]", 1, min: 1, max: 10, class: "block w-full pl-10 rounded-lg border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm py-3" %>

Priority level (1-10). Higher priority gateways are used first for sending messages.

Gateway API Key

After creating the gateway, you'll receive a unique API key. You'll need to configure this key in your Android gateway app to connect it to the system.

<%= submit_tag "Register Gateway", class: "inline-flex justify-center items-center gap-2 rounded-lg bg-blue-600 px-6 py-3 text-sm font-semibold text-white shadow-sm hover:bg-blue-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600 transition-all duration-200" %> <%= link_to "Cancel", admin_gateways_path, class: "inline-flex justify-center items-center gap-2 rounded-lg bg-gray-100 px-6 py-3 text-sm font-semibold text-gray-700 hover:bg-gray-200 transition-all duration-200" %>
<% end %>