mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-12-18 14:09:38 +08:00
Add help text for how to access secrets in the secrets sidebar (#1535)
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
This commit is contained in:
parent
42d2386a2d
commit
84361fb207
2 changed files with 30 additions and 5 deletions
|
|
@ -73,7 +73,7 @@ Example usage:
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Note: we let the arrow and content overlap 1px,
|
Note: we let the arrow and content overlap 1px,
|
||||||
othrwise there's a tiny space between them.
|
otherwise there's a tiny space between them.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.tooltip.top:before {
|
.tooltip.top:before {
|
||||||
|
|
@ -98,7 +98,14 @@ othrwise there's a tiny space between them.
|
||||||
transform: translate(-50%, calc(var(--arrow-size) - 1px + var(--distance)));
|
transform: translate(-50%, calc(var(--arrow-size) - 1px + var(--distance)));
|
||||||
}
|
}
|
||||||
|
|
||||||
.tooltip.bottom:after {
|
.tooltip.bottom-left:before {
|
||||||
|
top: 100%;
|
||||||
|
right: 0;
|
||||||
|
transform: translate(0%, calc(var(--arrow-size) - 1px + var(--distance)));
|
||||||
|
}
|
||||||
|
|
||||||
|
.tooltip.bottom:after,
|
||||||
|
.tooltip.bottom-left:after {
|
||||||
top: 100%;
|
top: 100%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translate(-50%, var(--distance));
|
transform: translate(-50%, var(--distance));
|
||||||
|
|
|
||||||
|
|
@ -559,13 +559,13 @@ defmodule LivebookWeb.SessionLive do
|
||||||
defp secrets_list(assigns) do
|
defp secrets_list(assigns) do
|
||||||
~H"""
|
~H"""
|
||||||
<div class="flex flex-col grow">
|
<div class="flex flex-col grow">
|
||||||
<div>
|
<div class="flex justify-between items-center">
|
||||||
<h3 class="uppercase text-sm font-semibold text-gray-500">
|
<h3 class="uppercase text-sm font-semibold text-gray-500">
|
||||||
Secrets
|
Secrets
|
||||||
</h3>
|
</h3>
|
||||||
<span class="text-sm text-gray-500">Available only to this session</span>
|
<.secrets_info_icon />
|
||||||
</div>
|
</div>
|
||||||
|
<span class="text-sm text-gray-500">Available only to this session</span>
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<div class="flex flex-col space-y-4 mt-6">
|
<div class="flex flex-col space-y-4 mt-6">
|
||||||
<%= for {secret_name, secret_value} <- session_only_secrets(@data_view.secrets, @livebook_secrets) do %>
|
<%= for {secret_name, secret_value} <- session_only_secrets(@data_view.secrets, @livebook_secrets) do %>
|
||||||
|
|
@ -724,6 +724,24 @@ defmodule LivebookWeb.SessionLive do
|
||||||
"""
|
"""
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp secrets_info_icon(assigns) do
|
||||||
|
~H"""
|
||||||
|
<span
|
||||||
|
class="icon-button cursor-pointer tooltip bottom-left"
|
||||||
|
data-tooltip={
|
||||||
|
~S'''
|
||||||
|
Secrets are a safe way to share credentials
|
||||||
|
and tokens with notebooks. They are often
|
||||||
|
accessed by Smart cells and can be read as
|
||||||
|
environment variables using the LB_ prefix.
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<.remix_icon icon="question-line" class="text-xl leading-none" />
|
||||||
|
</span>
|
||||||
|
"""
|
||||||
|
end
|
||||||
|
|
||||||
defp runtime_info(assigns) do
|
defp runtime_info(assigns) do
|
||||||
~H"""
|
~H"""
|
||||||
<div class="flex flex-col grow">
|
<div class="flex flex-col grow">
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue