mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-12-26 09:22:00 +08:00
Link to live dashboard for each running session to show process info (#186)
* Link to live dashboard for each running session to show process info * Update lib/livebook_web/live/home_live/sessions_component.ex Co-authored-by: José Valim <jose.valim@dashbit.co> Co-authored-by: José Valim <jose.valim@dashbit.co>
This commit is contained in:
parent
9c6d747aca
commit
69343bfc3c
2 changed files with 8 additions and 0 deletions
|
@ -26,6 +26,7 @@ defmodule Livebook.Session do
|
|||
|
||||
@type summary :: %{
|
||||
session_id: id(),
|
||||
pid: pid(),
|
||||
notebook_name: String.t(),
|
||||
path: String.t() | nil,
|
||||
images_dir: String.t()
|
||||
|
@ -504,6 +505,7 @@ defmodule Livebook.Session do
|
|||
defp summary_from_state(state) do
|
||||
%{
|
||||
session_id: state.session_id,
|
||||
pid: self(),
|
||||
notebook_name: state.data.notebook.name,
|
||||
path: state.data.path,
|
||||
images_dir: images_dir_from_state(state)
|
||||
|
|
|
@ -26,6 +26,12 @@ defmodule LivebookWeb.SessionLive.SessionsComponent do
|
|||
<%= remix_icon("git-branch-line") %>
|
||||
<span class="font-medium">Fork</span>
|
||||
</button>
|
||||
<%= link to: Routes.live_dashboard_path(@socket, :page, node(), "processes", info: Phoenix.LiveDashboard.Helpers.encode_pid(summary.pid)),
|
||||
class: "flex space-x-3 px-5 py-2 items-center text-gray-600 hover:bg-gray-50",
|
||||
target: "_blank" do %>
|
||||
<%= remix_icon("dashboard-2-line") %>
|
||||
<span class="font-medium">See on Dashboard</span>
|
||||
<% end %>
|
||||
<%= live_patch to: Routes.home_path(@socket, :close_session, summary.session_id),
|
||||
class: "flex space-x-3 px-5 py-2 items-center text-red-600 hover:bg-gray-50" do %>
|
||||
<%= remix_icon("close-circle-line") %>
|
||||
|
|
Loading…
Reference in a new issue