2021-03-20 21:10:15 +08:00
|
|
|
defmodule LivebookWeb.SessionLive.SettingsComponent do
|
|
|
|
use LivebookWeb, :live_component
|
|
|
|
|
|
|
|
@impl true
|
|
|
|
def render(assigns) do
|
|
|
|
~L"""
|
|
|
|
<div class="p-6 pb-4 max-w-4xl w-screen flex flex-col space-y-3">
|
|
|
|
<h3 class="text-2xl font-semibold text-gray-800">
|
|
|
|
Notebook settings
|
|
|
|
</h3>
|
|
|
|
<div class="tabs">
|
|
|
|
<%= live_patch to: Routes.session_path(@socket, :settings, @session_id, "file"),
|
|
|
|
class: "tab #{if(@tab == "file", do: "active")}" do %>
|
|
|
|
<%= remix_icon("file-settings-line", class: "align-middle") %>
|
|
|
|
<span class="font-medium">
|
|
|
|
File
|
|
|
|
</span>
|
|
|
|
<% end %>
|
|
|
|
<%= live_patch to: Routes.session_path(@socket, :settings, @session_id, "runtime"),
|
|
|
|
class: "tab #{if(@tab == "runtime", do: "active")}" do %>
|
|
|
|
<%= remix_icon("play-circle-line", class: "align-middle") %>
|
|
|
|
<span class="font-medium">
|
|
|
|
Runtime
|
|
|
|
</span>
|
|
|
|
<% end %>
|
|
|
|
<div class="flex-grow tab">
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-04-04 18:42:46 +08:00
|
|
|
<div class="pt-2">
|
2021-03-20 21:10:15 +08:00
|
|
|
<%= if @tab == "file" do %>
|
|
|
|
<%= live_component @socket, LivebookWeb.SessionLive.PersistenceComponent,
|
|
|
|
id: :persistence,
|
|
|
|
session_id: @session_id,
|
2021-03-26 06:29:22 +08:00
|
|
|
current_path: @data_view.path,
|
|
|
|
path: @data_view.path %>
|
2021-03-20 21:10:15 +08:00
|
|
|
<% end %>
|
|
|
|
<%= if @tab == "runtime" do %>
|
|
|
|
<%= live_component @socket, LivebookWeb.SessionLive.RuntimeComponent,
|
|
|
|
id: :runtime,
|
|
|
|
session_id: @session_id,
|
2021-03-26 06:29:22 +08:00
|
|
|
runtime: @data_view.runtime %>
|
2021-03-20 21:10:15 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
"""
|
|
|
|
end
|
|
|
|
end
|