defmodule Integrations.Tcp.Display do @moduledoc """ Dashboard panel for `Integrations.Tcp` (same package). Nested under the monitor's own namespace deliberately — the package's top-level module name never changes, and this module's name is guaranteed distinct from any separately-published standalone display package. `Display.BundledDefault` auto-hooks this whenever `Integrations.Tcp` starts, the same as if they were still one module. """ use CodeNameRaven.Display, category: :infrastructure, size_hint: :small @impl true def display_name, do: "TCP Port" @impl true def compatible_monitors, do: [Integrations.Tcp] @impl true def render(assigns) do result = assigns[:result] assigns = Map.merge(assigns, %{result: result}) ~H"""

<%= @config.name || host_port(@config.params) %>

<%= host_port(@config.params) %>

""" end # --------------------------------------------------------------------------- # Helpers # --------------------------------------------------------------------------- defp host_port(params) do host = params[:host] || params["host"] || "?" port = params[:port] || params["port"] || "?" "#{host}:#{port}" end end