diff --git a/lib/x_trace_web/controllers/trace_live.ex b/lib/x_trace_web/controllers/trace_live.ex index 84f736c..806edbd 100644 --- a/lib/x_trace_web/controllers/trace_live.ex +++ b/lib/x_trace_web/controllers/trace_live.ex @@ -241,7 +241,9 @@ defmodule XTraceWeb.TraceLive do socket = try do map = node |> String.to_existing_atom() |> update_node() + assign(socket, map) + |> put_flash(:info, "Connect to #{node} succeed!") catch _, _ -> put_flash(socket, :error, "bad node: #{node}") end diff --git a/lib/x_trace_web/controllers/trace_live.html.heex b/lib/x_trace_web/controllers/trace_live.html.heex index 23836de..c0fe9e0 100644 --- a/lib/x_trace_web/controllers/trace_live.html.heex +++ b/lib/x_trace_web/controllers/trace_live.html.heex @@ -49,7 +49,8 @@
<.input field={f[:connect_node]} label="Node to connect" placeholder="name@domain" /> <.input field={f[:connect_cookie]} label="Cookie" /> - <.button type="button" class="w-full" phx-click="connect-node">Connect + <.button type="button" class="w-full" phx-click="connect-node" + disabled={is_nil(f[:connect_node].value) || f[:connect_node].value == ""}>Connect <.button type="button" class="w-full" phx-click="reset-node">Reset node
<% else %> @@ -217,9 +218,9 @@
Node:
- self node: <%= @self? %>
- code server mode: <%= @code_server_mode %>
- trace node: <%= @node %> + Is Self Node: <%= @self? %>
+ Code Server mode: <%= @code_server_mode %>
+ Trace Node: <%= @node %>