mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-20 18:36:31 +08:00
Fix File System creation and ID prefix for Personal hub (#2238)
This commit is contained in:
parent
114d649524
commit
d26295ce69
2 changed files with 7 additions and 1 deletions
|
@ -82,8 +82,14 @@ defmodule Livebook.FileSystem.S3 do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@personal_id Livebook.Hubs.Personal.id()
|
||||||
|
|
||||||
def id(_, nil), do: nil
|
def id(_, nil), do: nil
|
||||||
def id(nil, bucket_url), do: hashed_id(bucket_url)
|
def id(nil, bucket_url), do: hashed_id(bucket_url)
|
||||||
|
|
||||||
|
# For Personal hub we keep unprefixed ids
|
||||||
|
def id(@personal_id, bucket_url), do: hashed_id(bucket_url)
|
||||||
|
|
||||||
def id(hub_id, bucket_url), do: "#{hub_id}-#{hashed_id(bucket_url)}"
|
def id(hub_id, bucket_url), do: "#{hub_id}-#{hashed_id(bucket_url)}"
|
||||||
|
|
||||||
defp hashed_id(bucket_url) do
|
defp hashed_id(bucket_url) do
|
||||||
|
|
|
@ -12,7 +12,7 @@ defmodule LivebookWeb.Hub.FileSystemFormComponent do
|
||||||
button = button(file_system)
|
button = button(file_system)
|
||||||
title = title(file_system)
|
title = title(file_system)
|
||||||
|
|
||||||
file_system = file_system || %FileSystem.S3{}
|
file_system = file_system || %FileSystem.S3{hub_id: assigns.hub.id}
|
||||||
changeset = FileSystems.change_file_system(file_system)
|
changeset = FileSystems.change_file_system(file_system)
|
||||||
socket = assign(socket, assigns)
|
socket = assign(socket, assigns)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue