defmodule LivebookWeb.Hub.NewLive do
use LivebookWeb, :live_view
alias Livebook.Teams
alias Livebook.Teams.Org
alias LivebookWeb.LayoutHelpers
on_mount LivebookWeb.SidebarHook
@check_completion_data_interval Application.compile_env(
:livebook,
:check_completion_data_interval,
3000
)
@impl true
def mount(_params, _session, socket) do
enabled? = Livebook.Config.feature_flag_enabled?(:create_hub)
socket =
assign(socket,
selected_option: "new-org",
page_title: "Hub - Livebook",
enabled?: enabled?,
requested_code: false,
org: nil,
verification_uri: nil,
form: nil,
button_label: nil,
request_code_info: nil
)
socket = assign_form(socket, "new-org")
{:ok, socket}
end
@impl true
def render(%{enabled?: false} = assigns) do
~H"""
Deploy applications, share secrets, templates, and more with Livebook Hubs.
Each Livebook user has their own personal Hub and soon they will be able to deploy
their personal notebooks to
Fly.io
and Hugging Face.
We are also working on Livebook Teams, which were
designed from the ground up to deploy notebooks within your organization.
Livebook Teams
runs on your own infrastructure
to provide essential features for secure collaboration between team members,
such as digital signing of notebooks, safe sharing of secrets, and more.
To learn more, get in touch!
- The Livebook crew
"""
end
def render(assigns) do
~H"""
Manage your Livebooks in the cloud with Hubs.
<.tab_button
id="new-org"
selected={@selected_option}
title="Create a new organization"
icon="lightbulb-flash-line"
/>
<.tab_button
id="join-org"
selected={@selected_option}
title="Join an existing organization"
icon="organization-chart"
/>