mirror of
https://github.com/livebook-dev/livebook.git
synced 2026-01-06 23:58:38 +08:00
Rename Hubs to Workspaces (#2574)
This commit is contained in:
parent
d3aad2ba00
commit
7a16ce1926
26 changed files with 45 additions and 44 deletions
|
|
@ -387,7 +387,7 @@ defmodule Livebook.FileSystem.File do
|
|||
else
|
||||
{:error,
|
||||
"could not find file system (id: #{file_system_id}). This means that it has" <>
|
||||
" been either detached or cannot be accessed from the Hub at the moment"}
|
||||
" been either detached or cannot be accessed from the Workspace at the moment"}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ defmodule Livebook.Hubs do
|
|||
:ok
|
||||
|
||||
{:error, reason} ->
|
||||
Logger.error("Could not start Hub #{hub.id}: #{Exception.format_exit(reason)}")
|
||||
Logger.error("Could not start Workspace #{hub.id}: #{Exception.format_exit(reason)}")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ defmodule Livebook.Hubs.Dockerfile do
|
|||
[
|
||||
if Livebook.Session.Data.session_secrets(secrets, hub.id) != [] do
|
||||
"The notebook uses session secrets, but those are not available to deployed apps." <>
|
||||
" Convert them to Hub secrets instead."
|
||||
" Convert them to Workspace secrets instead."
|
||||
end
|
||||
] ++ config_warnings(config)
|
||||
|
||||
|
|
@ -388,8 +388,8 @@ defmodule Livebook.Hubs.Dockerfile do
|
|||
%module{} = hd(used_hub_file_systems)
|
||||
name = LivebookWeb.FileSystemComponents.file_system_name(module)
|
||||
|
||||
"The #{name} file storage, defined in your personal hub, will not be available in the Docker image." <>
|
||||
" You must either download all references as attachments or use Livebook Teams to automatically" <>
|
||||
"The #{name} file storage, configured in your personal workspace, will not be available in the Docker image." <>
|
||||
" You must either download all file references as file attachments or use Livebook Teams to automatically" <>
|
||||
" encrypt and synchronize file storages across your team and deployments."
|
||||
end,
|
||||
if app_settings.access_type == :public do
|
||||
|
|
|
|||
|
|
@ -143,13 +143,13 @@ defimpl Livebook.Hubs.Provider, for: Livebook.Hubs.Team do
|
|||
def connection_status(team) do
|
||||
cond do
|
||||
team.offline ->
|
||||
"You are running an offline Hub for deployment. You cannot modify its settings."
|
||||
"You are running an offline Workspace for deployment. You cannot modify its settings."
|
||||
|
||||
team.user_id == nil ->
|
||||
"You are running a Livebook Agent instance with online Hub for deployment. You are in read-only mode."
|
||||
"You are running a Livebook app server. This worksace is in read-only mode."
|
||||
|
||||
reason = TeamClient.get_connection_status(team.id) ->
|
||||
"Cannot connect to Hub: #{reason}.\nWill attempt to reconnect automatically..."
|
||||
"Cannot connect to Teams: #{reason}.\nWill attempt to reconnect automatically..."
|
||||
|
||||
true ->
|
||||
nil
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ defmodule Livebook.Migration do
|
|||
unless Livebook.Hubs.hub_exists?(Livebook.Hubs.Personal.id()) do
|
||||
Livebook.Hubs.save_hub(%Livebook.Hubs.Personal{
|
||||
id: Livebook.Hubs.Personal.id(),
|
||||
hub_name: "My Hub",
|
||||
hub_name: "Personal",
|
||||
hub_emoji: "🏠",
|
||||
secret_key: Livebook.Hubs.Personal.generate_secret_key()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ defmodule LivebookWeb.LayoutComponents do
|
|||
<div id="hubs" class="flex flex-col mt-12">
|
||||
<div class="space-y-3">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 relative leading-6 mb-2">
|
||||
<small class="ml-5 font-medium text-gray-300 cursor-default">HUBS</small>
|
||||
<small class="ml-5 font-medium text-gray-300 cursor-default">WORKSPACES</small>
|
||||
</div>
|
||||
|
||||
<%= for hub <- @hubs do %>
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ defmodule LivebookWeb.AppsDashboardLive do
|
|||
data-tooltip={
|
||||
~S'''
|
||||
This is a permanent app started
|
||||
from your Livebook Teams hub
|
||||
deployed via Livebook Teams
|
||||
'''
|
||||
}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ defmodule LivebookWeb.Hub.Edit.PersonalComponent do
|
|||
<LayoutComponents.title text={"#{@hub.hub_emoji} #{@hub.hub_name}"} />
|
||||
|
||||
<p class="text-gray-700 text-sm">
|
||||
Your personal hub. All data is stored on your machine and only you can access it.
|
||||
Your personal workspace. All data is stored on your machine and only you can access it.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
@ -245,7 +245,7 @@ defmodule LivebookWeb.Hub.Edit.PersonalComponent do
|
|||
case Personal.update_hub(socket.assigns.hub, params) do
|
||||
{:ok, hub} ->
|
||||
socket
|
||||
|> put_flash(:success, "Hub updated successfully")
|
||||
|> put_flash(:success, "Workspace updated successfully")
|
||||
|> push_navigate(to: ~p"/hub/#{hub.id}")
|
||||
|
||||
{:error, changeset} ->
|
||||
|
|
|
|||
|
|
@ -244,10 +244,10 @@ defmodule LivebookWeb.Hub.Edit.TeamComponent do
|
|||
<div class="flex items-center justify-between gap-4 text-gray-700">
|
||||
<div class="flex flex-col">
|
||||
<h3 class="font-semibold">
|
||||
Delete this hub
|
||||
Delete this workspace
|
||||
</h3>
|
||||
<p class="text-sm">
|
||||
This only removes the hub from this machine. You must rejoin to access its features once again.
|
||||
This only removes the workpsace from this machine. You must rejoin to access its features once again.
|
||||
</p>
|
||||
</div>
|
||||
<.button
|
||||
|
|
@ -256,7 +256,7 @@ defmodule LivebookWeb.Hub.Edit.TeamComponent do
|
|||
id="delete-hub"
|
||||
phx-click={JS.push("delete_hub", value: %{id: @hub.id})}
|
||||
>
|
||||
<span class="hidden sm:block">Delete hub</span>
|
||||
<span class="hidden sm:block">Delete workspace</span>
|
||||
<.remix_icon icon="delete-bin-line" class="text-lg sm:hidden" />
|
||||
</.button>
|
||||
</div>
|
||||
|
|
@ -371,7 +371,7 @@ defmodule LivebookWeb.Hub.Edit.TeamComponent do
|
|||
{:ok, hub} ->
|
||||
{:noreply,
|
||||
socket
|
||||
|> put_flash(:success, "Hub updated successfully")
|
||||
|> put_flash(:success, "Workspace updated successfully")
|
||||
|> push_patch(to: ~p"/hub/#{hub.id}")}
|
||||
|
||||
{:error, changeset} ->
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ defmodule LivebookWeb.Hub.EditLive do
|
|||
hub: nil,
|
||||
counter: 0,
|
||||
type: nil,
|
||||
page_title: "Hub - Livebook",
|
||||
page_title: "Workspace - Livebook",
|
||||
params: %{}
|
||||
)}
|
||||
end
|
||||
|
|
@ -85,14 +85,14 @@ defmodule LivebookWeb.Hub.EditLive do
|
|||
Hubs.delete_hub(id)
|
||||
|
||||
socket
|
||||
|> put_flash(:success, "Hub deleted successfully")
|
||||
|> put_flash(:success, "Workspace deleted successfully")
|
||||
|> push_navigate(to: ~p"/")
|
||||
end
|
||||
|
||||
{:noreply,
|
||||
confirm(socket, on_confirm,
|
||||
title: "Delete hub",
|
||||
description: "Are you sure you want to delete this hub?",
|
||||
title: "Delete workspace",
|
||||
description: "Are you sure you want to delete this workspace?",
|
||||
confirm_text: "Delete",
|
||||
confirm_icon: "close-circle-line"
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ defmodule LivebookWeb.Hub.FileSystemListComponent do
|
|||
|
||||
{:noreply,
|
||||
confirm(socket, on_confirm,
|
||||
title: "Detach hub file storage",
|
||||
title: "Detach workspace file storage",
|
||||
description: "Are you sure you want to detach #{name}?",
|
||||
confirm_text: "Detach",
|
||||
confirm_icon: "delete-bin-6-line"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ defmodule LivebookWeb.Hub.NewLive do
|
|||
socket =
|
||||
assign(socket,
|
||||
selected_option: "new-org",
|
||||
page_title: "Hub - Livebook",
|
||||
page_title: "Workspace - Livebook",
|
||||
requested_code: false,
|
||||
org: nil,
|
||||
verification_uri: nil,
|
||||
|
|
@ -285,7 +285,7 @@ defmodule LivebookWeb.Hub.NewLive do
|
|||
|
||||
{:noreply,
|
||||
socket
|
||||
|> put_flash(:success, "Hub added successfully")
|
||||
|> put_flash(:success, "Workspace added successfully")
|
||||
|> push_navigate(to: ~p"/hub/#{hub.id}?show-key=confirm")}
|
||||
|
||||
{:error, :expired} ->
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ defmodule LivebookWeb.Hub.Teams.DeploymentGroupComponent do
|
|||
<div class="flex flex-row space-x-2">
|
||||
<p class="grow text-gray-700">
|
||||
Secrets that are exclusive to apps deployed to this group.
|
||||
In case of conflicts, these secrets take precedence over Hub secrets.
|
||||
In case of conflicts, these secrets take precedence over Workspace secrets.
|
||||
</p>
|
||||
|
||||
<div class="self-center">
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ defmodule LivebookWeb.OpenLive.UrlComponent do
|
|||
|> Livebook.Utils.validate_url(:url)
|
||||
|> Livebook.Utils.validate_not_s3_url(
|
||||
:url,
|
||||
~s{invalid s3:// URL scheme, you must first connect to the Cloud Storage in your Hub page and then choose the relevant file in "From storage"}
|
||||
~s{invalid s3:// URL scheme, you must first connect to the Cloud Storage in your Workspace page and then choose the relevant file in "From storage"}
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ defmodule LivebookWeb.SessionLive.AddFileEntryUrlComponent do
|
|||
|> Livebook.Utils.validate_url(:url)
|
||||
|> Livebook.Utils.validate_not_s3_url(
|
||||
:url,
|
||||
~s{invalid s3:// URL scheme, you must first connect to the Cloud Storage in your Hub page and then choose the relevant file in "From storage"}
|
||||
~s{invalid s3:// URL scheme, you must first connect to the Cloud Storage in your Workspace page and then choose the relevant file in "From storage"}
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ defmodule LivebookWeb.SessionLive.AppDockerComponent do
|
|||
|
||||
<div class="flex gap-12">
|
||||
<p class="text-gray-700">
|
||||
<.label>Hub</.label>
|
||||
<.label>Workspace</.label>
|
||||
<span>
|
||||
<span class="text-lg"><%= @hub.hub_emoji %></span>
|
||||
<span><%= @hub.hub_name %></span>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ defmodule LivebookWeb.SessionLive.AppInfoComponent do
|
|||
<.message_box
|
||||
:if={@any_session_secrets?}
|
||||
kind={:warning}
|
||||
message="The notebook uses session secrets, but those are not available to deployed apps. Convert them to Hub secrets instead."
|
||||
message="The notebook uses session secrets, but those are not available to deployed apps. Convert them to Workspace secrets instead."
|
||||
/>
|
||||
|
||||
<div class="flex flex-col space-y-3">
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ defmodule LivebookWeb.SessionLive.AppTeamsComponent do
|
|||
|
||||
<div class="flex gap-12">
|
||||
<p class="text-gray-700">
|
||||
<.label>Hub</.label>
|
||||
<.label>Workspace</.label>
|
||||
<span>
|
||||
<span class="text-lg"><%= @hub.hub_emoji %></span>
|
||||
<span><%= @hub.hub_name %></span>
|
||||
|
|
|
|||
|
|
@ -1192,10 +1192,11 @@ defmodule LivebookWeb.SessionLive.Render do
|
|||
class="inline-flex items-center cursor-pointer gap-1 mt-1 text-sm text-gray-600 hover:text-gray-800 focus:text-gray-800"
|
||||
aria-label={@data_view.hub.hub_name}
|
||||
>
|
||||
<span>in</span>
|
||||
<span class="text-lg pl-1"><%= @data_view.hub.hub_emoji %></span>
|
||||
<span>Using</span>
|
||||
<span class="pl-1"><%= @data_view.hub.hub_emoji %></span>
|
||||
<span><%= @data_view.hub.hub_name %></span>
|
||||
<.remix_icon icon="arrow-down-s-line" />
|
||||
<.remix_icon icon="arrow-down-s-line" class="-ml-1" />
|
||||
<span>workspace</span>
|
||||
</div>
|
||||
</:toggle>
|
||||
<.menu_item :for={hub <- @saved_hubs}>
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ defmodule LivebookWeb.SessionLive.SecretsListComponent do
|
|||
</h3>
|
||||
<span class="text-sm text-gray-500">
|
||||
<%= if @hub_secrets == [] do %>
|
||||
No secrets stored in this hub so far
|
||||
No secrets stored in this workspace so far
|
||||
<% else %>
|
||||
Toggle to allow access to a secret
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ defmodule Livebook.Hubs.DockerfileTest do
|
|||
)
|
||||
|
||||
assert warning =~
|
||||
"The S3 file storage, defined in your personal hub, will not be available in the Docker image"
|
||||
"The S3 file storage, configured in your personal workspace, will not be available in the Docker image"
|
||||
end
|
||||
|
||||
test "warns when deploying a directory in personal hub and it has any file systems" do
|
||||
|
|
@ -335,7 +335,7 @@ defmodule Livebook.Hubs.DockerfileTest do
|
|||
Dockerfile.airgapped_warnings(config, hub, [], file_systems, app_settings, [], %{})
|
||||
|
||||
assert warning =~
|
||||
"The S3 file storage, defined in your personal hub, will not be available in the Docker image"
|
||||
"The S3 file storage, configured in your personal workspace, will not be available in the Docker image"
|
||||
end
|
||||
|
||||
test "warns when the app has no password in personal hub" do
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ defmodule LivebookWeb.Integration.Hub.EditLiveTest do
|
|||
|> render_submit(%{"team" => attrs})
|
||||
|
||||
update = render(view)
|
||||
assert update =~ "Hub updated successfully"
|
||||
assert update =~ "Workspace updated successfully"
|
||||
assert update =~ "🐈"
|
||||
|
||||
id = hub.id
|
||||
|
|
@ -51,13 +51,13 @@ defmodule LivebookWeb.Integration.Hub.EditLiveTest do
|
|||
{:ok, view, _html} = live(conn, ~p"/hub/#{hub.id}")
|
||||
|
||||
view
|
||||
|> element("#delete-hub", "Delete hub")
|
||||
|> element("#delete-hub", "Delete workspace")
|
||||
|> render_click()
|
||||
|
||||
render_confirm(view)
|
||||
|
||||
assert_receive {:hub_changed, ^id}
|
||||
%{"success" => "Hub deleted successfully"} = assert_redirect(view, "/")
|
||||
%{"success" => "Workspace deleted successfully"} = assert_redirect(view, "/")
|
||||
|
||||
{:ok, view, _html} = live(conn, ~p"/")
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ defmodule LivebookWeb.Hub.NewLiveTest do
|
|||
# wait for the c:handle_info/2 cycle
|
||||
# check if the page redirected to edit hub page
|
||||
# and check the flash message
|
||||
%{"success" => "Hub added successfully"} =
|
||||
%{"success" => "Workspace added successfully"} =
|
||||
assert_redirect(
|
||||
view,
|
||||
"/hub/team-#{name}?show-key=confirm",
|
||||
|
|
@ -112,7 +112,7 @@ defmodule LivebookWeb.Hub.NewLiveTest do
|
|||
# wait for the c:handle_info/2 cycle
|
||||
# check if the page redirected to edit hub page
|
||||
# and check the flash message
|
||||
%{"success" => "Hub added successfully"} =
|
||||
%{"success" => "Workspace added successfully"} =
|
||||
assert_redirect(
|
||||
view,
|
||||
"/hub/team-#{name}?show-key=confirm",
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ defmodule LivebookWeb.HomeLiveTest do
|
|||
team = Livebook.HubHelpers.offline_hub()
|
||||
|
||||
{:ok, view, _} = live(conn, ~p"/")
|
||||
assert render(view) =~ "HUBS"
|
||||
assert render(view) =~ "WORKSPACES"
|
||||
assert render(view) =~ team.hub_name
|
||||
assert render(view) =~ "Add Organization"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ defmodule LivebookWeb.Hub.EditLiveTest do
|
|||
|> render_submit(%{"personal" => attrs})
|
||||
|> follow_redirect(conn)
|
||||
|
||||
assert render(view) =~ "Hub updated successfully"
|
||||
assert render(view) =~ "Workspace updated successfully"
|
||||
|
||||
id = hub.id
|
||||
assert_receive {:hub_changed, ^id}
|
||||
|
|
|
|||
|
|
@ -2239,7 +2239,7 @@ defmodule LivebookWeb.SessionLiveTest do
|
|||
{:ok, view, _} = live(conn, ~p"/sessions/#{session.id}")
|
||||
|
||||
assert render(view) =~
|
||||
"The notebook uses session secrets, but those are not available to deployed apps. Convert them to Hub secrets instead."
|
||||
"The notebook uses session secrets, but those are not available to deployed apps. Convert them to Workspace secrets instead."
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue