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"""
Livebook Teams will amplify Livebook with features designed for teams and businesses.
It will allow you to share notebooks, manage secrets, and deploy Livebook apps within your organization.
The product is still in development. We want to get feedback from beta users and understand
their use cases before the public launch.
Learn more about Livebook Teams
and join the beta program.
- The Livebook crew
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"
/>