Device Configurations

Manage device-specific configurations and settings

<.link patch={~p"/admin/device-configs/new"} class="inline-flex items-center px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg shadow-sm transition-colors duration-200"> New Configuration

Filters & Search

<.input name="name" value={@filters["name"]} placeholder="Search by name" phx-debounce="300" phx-change="filter" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent" />
<%= for config <- @configurations do %> <% end %>
Name Device Type Status Terminal Created Actions
<%= config.name %>
<%= config.description %>
<%= config.device_type %> "bg-green-100 text-green-800" "draft" -> "bg-yellow-100 text-yellow-800" "inactive" -> "bg-red-100 text-red-800" _ -> "bg-gray-100 text-gray-800" end]}> <%= String.capitalize(config.status) %> <%= if config.terminal do %> <%= config.terminal.serial_number %> <% else %> Not assigned <% end %> <%= Calendar.strftime(config.inserted_at, "%b %d, %Y") %>
Showing <%= (@page - 1) * @per_page + 1 %> to <%= min(@page * @per_page, @total) %> of <%= @total %> configurations
<%= if @selected_config do %> <.slide_over origin="right" title={"Configuration: #{@selected_config.name}"}>

Configuration Details

Device Type: <%= @selected_config.device_type %>

"bg-green-100 text-green-800" "draft" -> "bg-yellow-100 text-yellow-800" "inactive" -> "bg-red-100 text-red-800" end]}> <%= String.capitalize(@selected_config.status) %>
<%= if @show_config_form do %>
<% else %>

Basic Information

Name
<%= @selected_config.name %>
Device Type
<%= @selected_config.device_type %>
Description
<%= @selected_config.description || "No description" %>

Configuration Data

<%= Jason.encode!(@selected_config.configuration_data, pretty: true) %>
<% end %>
<% end %> <%= if assigns[:show_new_config] && @show_new_config do %> <.slide_over origin="right" title="Create New Configuration" hide={false}>

Basic Information

<%= if @config_errors["name"] do %>

<%= @config_errors["name"] %>

<% end %>
<%= if @config_errors["device_type"] do %>

<%= @config_errors["device_type"] %>

<% end %>

Configuration Data

<%= if @config_errors["configuration_data"] do %>

<%= @config_errors["configuration_data"] %>

<% end %>

Settings

<% end %>