defmodule LivebookWeb.AppsDashboardLive do
use LivebookWeb, :live_view
import LivebookWeb.AppComponents
alias LivebookWeb.LayoutComponents
on_mount LivebookWeb.SidebarHook
@impl true
def mount(_params, _session, socket) do
if connected?(socket) do
Livebook.Apps.subscribe()
end
apps = Livebook.Apps.list_apps()
{:ok, assign(socket, apps: apps, page_title: "Apps - Livebook")}
end
@impl true
def render(assigns) do
~H"""
An overview of all deployed applications and previews running on this instance.
You can preview and deploy new apps by opening a notebook and clicking
<.remix_icon icon="rocket-line" class="align-top text-lg" /> in the sidebar.
"""
end
defp app_list(assigns) do
~H"""