mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-16 04:46:46 +08:00
e2490c0f7f
* Remove Code.Fragment backport * Fix tests compatibility with Elixir 1.13 * Implement signature intellisense * Don't show signatures on module attributes * Add tests for calls with do-end block * Unify spec formatting * Insert parentheses when completing a function call * Send all text until cursor in signature request * Add configuration for completion/signature popups (#693) * Add editor settings form * Add configuration for intellisense defaults * Read fresh settings when editor mounts * Scope attribute names * Fix disabled button styling * Simplify signature box and enable by default * Split settings into system and user sections * Update lib/livebook_web/live/settings_live.ex Co-authored-by: José Valim <jose.valim@dashbit.co> * Update lib/livebook_web/live/settings_live.ex Co-authored-by: José Valim <jose.valim@dashbit.co> Co-authored-by: José Valim <jose.valim@dashbit.co> * Fix spacing in documentation tests Co-authored-by: José Valim <jose.valim@dashbit.co>
45 lines
1.4 KiB
Elixir
45 lines
1.4 KiB
Elixir
defmodule LivebookWeb.SettingsLive.FileSystemsComponent do
|
|
use LivebookWeb, :live_component
|
|
|
|
alias Livebook.FileSystem
|
|
|
|
@impl true
|
|
def render(assigns) do
|
|
~H"""
|
|
<div class="flex flex-col space-y-4">
|
|
<div class="flex flex-col space-y-4">
|
|
<%= for {file_system, index} <- Enum.with_index(@file_systems) do %>
|
|
<div class="flex items-center justify-between border border-gray-200 rounded-lg p-4">
|
|
<div class="flex items-center space-x-12">
|
|
<.file_system_info file_system={file_system} />
|
|
</div>
|
|
<%= unless is_struct(file_system, FileSystem.Local) do %>
|
|
<%= live_patch "Detach",
|
|
to: Routes.settings_path(@socket, :detach_file_system, index),
|
|
class: "button-base button-outlined-red" %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<div class="flex">
|
|
<%= live_patch "Add file system",
|
|
to: Routes.settings_path(@socket, :add_file_system),
|
|
class: "button-base button-blue" %>
|
|
</div>
|
|
</div>
|
|
"""
|
|
end
|
|
|
|
defp file_system_info(%{file_system: %FileSystem.Local{}} = assigns) do
|
|
~H"""
|
|
<.labeled_text label="Type" text="Local disk" />
|
|
"""
|
|
end
|
|
|
|
defp file_system_info(%{file_system: %FileSystem.S3{}} = assigns) do
|
|
~H"""
|
|
<.labeled_text label="Type" text="S3" />
|
|
<.labeled_text label="Bucket URL" text={@file_system.bucket_url} />
|
|
"""
|
|
end
|
|
end
|