ZTA metadata - help field (#2411)

Co-authored-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
Cristine Guadelupe 2023-12-24 19:28:24 -03:00 committed by GitHub
parent f9b4d3703e
commit ece00ad70c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -29,8 +29,9 @@ defmodule Livebook.Config do
%{
type: :teleport,
name: "Teleport",
value: "Teleport cluster address (https://[cluster-name]:3080)",
module: Livebook.ZTA.Teleport
value: "Teleport cluster address",
module: Livebook.ZTA.Teleport,
help: "Example: https://[cluster-name]:3080"
}
]

View file

@ -144,6 +144,7 @@ defmodule LivebookWeb.AppHelpers do
:if={zta_metadata = zta_metadata(@form[:zta_provider].value)}
field={@form[:zta_key]}
label={zta_metadata.value}
help={zta_help(zta_metadata)}
phx-debounce
/>
</div>
@ -282,4 +283,7 @@ defmodule LivebookWeb.AppHelpers do
def update_app_list(apps, {:app_closed, app}) do
Enum.reject(apps, &(&1.slug == app.slug))
end
defp zta_help(%{help: help}), do: "#{help}"
defp zta_help(_), do: nil
end