From 721a2eba4adcb7815b6f4f7af464f4a1f16e8cfb Mon Sep 17 00:00:00 2001 From: Paulo Valim Date: Tue, 30 Jan 2024 16:48:18 +0100 Subject: [PATCH] Adding table view for environement variables (#2461) --- .../live/settings_live/env_vars_component.ex | 86 ++++++++----------- 1 file changed, 35 insertions(+), 51 deletions(-) diff --git a/lib/livebook_web/live/settings_live/env_vars_component.ex b/lib/livebook_web/live/settings_live/env_vars_component.ex index 61da5af2a..947a2f25b 100644 --- a/lib/livebook_web/live/settings_live/env_vars_component.ex +++ b/lib/livebook_web/live/settings_live/env_vars_component.ex @@ -11,11 +11,41 @@ defmodule LivebookWeb.SettingsLive.EnvVarsComponent do ~H"""
-
- <.env_var_info env_var={env_var} edit_label={@edit_label} target={@target} /> + <.no_entries :if={@env_vars == []}> + No environment variables here... yet! + +
+ <.table id="env-var-table" rows={@env_vars}> + <:col :let={env_var} label="Name"><%= env_var.name %> + <:action :let={env_var}> + + + + + <:action :let={env_var}> + + + + +
@@ -26,50 +56,4 @@ defmodule LivebookWeb.SettingsLive.EnvVarsComponent do
""" end - - defp env_var_info(assigns) do - ~H""" -
-
- <.labeled_text label="Name"> - <%= @env_var.name %> - -
- -
- <.menu id={"env-var-#{@env_var.name}-menu"}> - <:toggle> - - - <.menu_item> - - - <.menu_item variant={:danger}> - - - -
-
- """ - end end