mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-02-22 22:05:03 +08:00
* Show reconnect for all runtime types when applicable * Make it clear which runtime is the default * Show Mix.install restart suggestion only for standalone runtimes * Fix tests not to rely on the default runtime tab
22 lines
629 B
Elixir
22 lines
629 B
Elixir
defmodule LivebookWeb.SessionLive.RuntimeHelpers do
|
|
use Phoenix.Component
|
|
|
|
@doc """
|
|
Displays an info text if `@module` is the default runtime.
|
|
"""
|
|
def default_runtime_note(assigns) do
|
|
~H"""
|
|
<%= if default_runtime_module?(@module) do %>
|
|
<p class="text-gray-600 text-sm">
|
|
Note: This is the <span class="font-semibold">default runtime</span> and starts
|
|
automatically as soon as you evaluate the first cell.
|
|
</p>
|
|
<% end %>
|
|
"""
|
|
end
|
|
|
|
defp default_runtime_module?(module) do
|
|
{default_module, _args} = Livebook.Config.default_runtime()
|
|
default_module == module
|
|
end
|
|
end
|