Skip to content

Commit

Permalink
Run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Dec 4, 2024
1 parent b705c63 commit edfe7d0
Show file tree
Hide file tree
Showing 24 changed files with 133 additions and 133 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ defmodule Phoenix.LiveDashboard.LayeredGraphComponent do
<g>
<circle fill={circle.bg} cx={circle.x} cy={circle.y} r={@radius} class="node" />
<%= if circle.show_detail? do %>
<text x={circle.x} y={circle.y} class="node-label"><%= circle.label %></text>
<text x={circle.x} y={circle.y} class="node-label">{circle.label}</text>
<text x={circle.x} y={circle.y + @y_detail_offset} class="node-detail">
<%= circle.detail %>
{circle.detail}
</text>
<% else %>
<text x={circle.x} y={circle.y + @y_label_offset} class="node-label">
<%= circle.label %>
{circle.label}
</text>
<% end %>
</g>
Expand Down
4 changes: 2 additions & 2 deletions lib/phoenix/live_dashboard/components/nav_bar_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ defmodule Phoenix.LiveDashboard.NavBarComponent do
{item_link_href(@socket, @page, item, @nav_param, @extra_params)}
class={item_link_class(item, @current)}
>
<%= item_label(item) %>
{item_label(item)}
</.link>
</li>
</ul>
</div>
</div>
<%= render_slot(@current) %>
{render_slot(@current)}
</div>
"""
end
Expand Down
16 changes: 8 additions & 8 deletions lib/phoenix/live_dashboard/components/table_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,16 @@ defmodule Phoenix.LiveDashboard.TableComponent do
<div class="col-auto">
<div class="input-group input-group-sm">
<select name="limit" class="custom-select" id="limit-select">
<%= options_for_select(@limit, @table_params.limit) %>
{options_for_select(@limit, @table_params.limit)}
</select>
</div>
</div>
<div class="col-auto">
<%= @rows_name %> out of <%= @total %>
{@rows_name} out of {@total}
</div>
<% else %>
<div class="col-auto">
Showing <%= @total %> <%= @rows_name %>
Showing {@total} {@rows_name}
</div>
<% end %>
</div>
Expand All @@ -208,7 +208,7 @@ defmodule Phoenix.LiveDashboard.TableComponent do
column={column}
/>
<% else %>
<%= column[:header] || column[:field] %>
{column[:header] || column[:field]}
<% end %>
</th>
</tr>
Expand All @@ -217,9 +217,9 @@ defmodule Phoenix.LiveDashboard.TableComponent do
<tr :for={row <- @rows} {calc_attrs(@row_attrs, [row])}>
<td :for={column <- @columns} class={col_class(@dom_id, column)}>
<%= if column[:inner_block] do %>
<%= render_slot(column, row) %>
{render_slot(column, row)}
<% else %>
<%= row[column.field] |> to_string() %>
{row[column.field] |> to_string()}
<% end %>
</td>
</tr>
Expand Down Expand Up @@ -265,7 +265,7 @@ defmodule Phoenix.LiveDashboard.TableComponent do
if assigns.table_params.sort_by == assigns.column.field do
~H"""
<.link patch={PageBuilder.live_dashboard_path(@socket, @page, reverse_sort_dir(@table_params))}>
<%= column_header(@column) %>
{column_header(@column)}
<.sort_link_icon dir={@table_params.sort_dir} />
</.link>
"""
Expand All @@ -274,7 +274,7 @@ defmodule Phoenix.LiveDashboard.TableComponent do
<.link patch={
PageBuilder.live_dashboard_path(@socket, @page, replace_sort_dir(@table_params, @column))
}>
<%= column_header(@column) %>
{column_header(@column)}
</.link>
"""
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule Phoenix.LiveDashboard.TitleBarComponent do
<div class={@class}>
<section>
<div class="d-flex justify-content-between">
<%= render_slot(@inner_block) %>
{render_slot(@inner_block)}
</div>
<style nonce={@csp_nonces.style}>
#<%= "#{@dom_id}-progress" %>{width:<%= @percent %>%}
Expand Down
8 changes: 4 additions & 4 deletions lib/phoenix/live_dashboard/helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule Phoenix.LiveDashboard.Helpers do
text: text
}

~H|<.link patch={@to}><%= @text %></.link>|
~H|<.link patch={@to}>{@text}</.link>|
end

def format_value(%PortDetails{} = info, live_dashboard_path) do
Expand All @@ -36,7 +36,7 @@ defmodule Phoenix.LiveDashboard.Helpers do
text: "#{inspect(port)} (#{description})"
}

~H|<.link patch={@to}><%= @text %></.link>|
~H|<.link patch={@to}>{@text}</.link>|
end

# Not used in `phoenix_live_dashboard` code, but available for custom pages
Expand All @@ -46,7 +46,7 @@ defmodule Phoenix.LiveDashboard.Helpers do
text: inspect(port)
}

~H|<.link patch={@to}><%= @text %></.link>|
~H|<.link patch={@to}>{@text}</.link>|
end

# Not used in `phoenix_live_dashboard` code, but available for custom pages
Expand All @@ -56,7 +56,7 @@ defmodule Phoenix.LiveDashboard.Helpers do
text: inspect(pid)
}

~H|<.link patch={@to}><%= @text %></.link>|
~H|<.link patch={@to}>{@text}</.link>|
end

def format_value([_ | _] = list, live_dashboard_path) do
Expand Down
2 changes: 1 addition & 1 deletion lib/phoenix/live_dashboard/info/app_info_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ defmodule Phoenix.LiveDashboard.AppInfoComponent do
y={node.y + div(node.height, 2)}
dominant-baseline="central"
>
<%= node.label %>
{node.label}
</text>
<% end %>
<%= for line <- @lines do %>
Expand Down
28 changes: 14 additions & 14 deletions lib/phoenix/live_dashboard/info/ets_info_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ defmodule Phoenix.LiveDashboard.EtsInfoComponent do
<div class="tabular-info">
<%= if @alive do %>
<Phoenix.LiveDashboard.PageBuilder.label_value_list>
<:elem label="ID"><%= @id %></:elem>
<:elem label="Name"><%= @name %></:elem>
<:elem label="Size"><%= @size %></:elem>
<:elem label="Node"><%= @node %></:elem>
<:elem label="Named table"><%= @named_table %></:elem>
<:elem label="Read concurrency"><%= @read_concurrency %></:elem>
<:elem label="Write concurrency"><%= @write_concurrency %></:elem>
<:elem label="Compressed"><%= @compressed %></:elem>
<:elem label="Memory"><%= @memory %></:elem>
<:elem label="Owner"><%= @owner %></:elem>
<:elem label="Heir"><%= @heir %></:elem>
<:elem label="Type"><%= @type %></:elem>
<:elem label="Keypos"><%= @keypos %></:elem>
<:elem label="Protection"><%= @protection %></:elem>
<:elem label="ID">{@id}</:elem>
<:elem label="Name">{@name}</:elem>
<:elem label="Size">{@size}</:elem>
<:elem label="Node">{@node}</:elem>
<:elem label="Named table">{@named_table}</:elem>
<:elem label="Read concurrency">{@read_concurrency}</:elem>
<:elem label="Write concurrency">{@write_concurrency}</:elem>
<:elem label="Compressed">{@compressed}</:elem>
<:elem label="Memory">{@memory}</:elem>
<:elem label="Owner">{@owner}</:elem>
<:elem label="Heir">{@heir}</:elem>
<:elem label="Type">{@type}</:elem>
<:elem label="Keypos">{@keypos}</:elem>
<:elem label="Protection">{@protection}</:elem>
</Phoenix.LiveDashboard.PageBuilder.label_value_list>
<% else %>
<div class="tabular-info-not-exists mt-1 mb-3">ETS does not exist.</div>
Expand Down
4 changes: 2 additions & 2 deletions lib/phoenix/live_dashboard/info/modal_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ defmodule Phoenix.LiveDashboard.ModalComponent do
<div class="modal-dialog modal-lg" id="modal-container">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title"><%= @title %></h6>
<h6 class="modal-title">{@title}</h6>
<div class="modal-action">
<span phx-click={enable_fullscreen()} class="modal-action-item mr-3" id="fullscreen-on">
&square;
Expand All @@ -49,7 +49,7 @@ defmodule Phoenix.LiveDashboard.ModalComponent do
</div>
</div>
<div class="modal-body">
<%= render_slot(@inner_block) %>
{render_slot(@inner_block)}
</div>
</div>
</div>
Expand Down
16 changes: 8 additions & 8 deletions lib/phoenix/live_dashboard/info/port_info_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ defmodule Phoenix.LiveDashboard.PortInfoComponent do
<div class="tabular-info">
<%= if @alive do %>
<Phoenix.LiveDashboard.PageBuilder.label_value_list>
<:elem label="Port Name"><%= @name %></:elem>
<:elem label="Id"><%= @id %></:elem>
<:elem label="Connected"><%= @connected %></:elem>
<:elem label="Input"><%= format_bytes(@input) %></:elem>
<:elem label="Output"><%= format_bytes(@output) %></:elem>
<:elem label="OS pid"><%= @os_pid %></:elem>
<:elem label="Port Name">{@name}</:elem>
<:elem label="Id">{@id}</:elem>
<:elem label="Connected">{@connected}</:elem>
<:elem label="Input">{format_bytes(@input)}</:elem>
<:elem label="Output">{format_bytes(@output)}</:elem>
<:elem label="OS pid">{@os_pid}</:elem>
<:elem label="Links"><.info links={@links} /></:elem>
</Phoenix.LiveDashboard.PageBuilder.label_value_list>
<% else %>
Expand Down Expand Up @@ -71,10 +71,10 @@ defmodule Phoenix.LiveDashboard.PortInfoComponent do
defp info(%{links: links} = assigns) when is_list(links) do
~H"""
<%= for info <- @links do %>
<%= info %>
{info}
<% end %>
"""
end

defp info(%{links: _links} = assigns), do: ~H|<%= @links %>|
defp info(%{links: _links} = assigns), do: ~H|{@links}|
end
36 changes: 18 additions & 18 deletions lib/phoenix/live_dashboard/info/process_info_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,26 @@ defmodule Phoenix.LiveDashboard.ProcessInfoComponent do
<div class="tabular-info">
<%= if @alive do %>
<Phoenix.LiveDashboard.PageBuilder.label_value_list>
<:elem label="Registered name"><%= @registered_name %></:elem>
<:elem label="Current function"><%= @current_function %></:elem>
<:elem label="Initial call"><%= @initial_call %></:elem>
<:elem label="Status"><%= @status %></:elem>
<:elem label="Message queue length"><%= @message_queue_len %></:elem>
<:elem label="Registered name">{@registered_name}</:elem>
<:elem label="Current function">{@current_function}</:elem>
<:elem label="Initial call">{@initial_call}</:elem>
<:elem label="Status">{@status}</:elem>
<:elem label="Message queue length">{@message_queue_len}</:elem>
<:elem label="Ancestors"><.info links={@ancestor_links} /></:elem>
<:elem label="Other links"><.info links={@other_links} /></:elem>
<:elem label="Monitors"><.info links={@monitors} /></:elem>
<:elem label="Monitored by"><.info links={@monitored_by} /></:elem>
<:elem label="Trap exit"><%= @trap_exit %></:elem>
<:elem label="Error handler"><%= @error_handler %></:elem>
<:elem label="Priority"><%= @priority %></:elem>
<:elem label="Group leader"><%= @group_leader %></:elem>
<:elem label="Total heap size"><%= @total_heap_size %></:elem>
<:elem label="Heap size"><%= @heap_size %></:elem>
<:elem label="Stack size"><%= @stack_size %></:elem>
<:elem label="Reductions"><%= @reductions %></:elem>
<:elem label="Garbage collection"><%= @garbage_collection %></:elem>
<:elem label="Suspending"><%= @suspending %></:elem>
<:elem label="Current stacktrace"><%= @current_stacktrace %></:elem>
<:elem label="Trap exit">{@trap_exit}</:elem>
<:elem label="Error handler">{@error_handler}</:elem>
<:elem label="Priority">{@priority}</:elem>
<:elem label="Group leader">{@group_leader}</:elem>
<:elem label="Total heap size">{@total_heap_size}</:elem>
<:elem label="Heap size">{@heap_size}</:elem>
<:elem label="Stack size">{@stack_size}</:elem>
<:elem label="Reductions">{@reductions}</:elem>
<:elem label="Garbage collection">{@garbage_collection}</:elem>
<:elem label="Suspending">{@suspending}</:elem>
<:elem label="Current stacktrace">{@current_stacktrace}</:elem>
</Phoenix.LiveDashboard.PageBuilder.label_value_list>
<%= if @page.allow_destructive_actions do %>
Expand Down Expand Up @@ -119,10 +119,10 @@ defmodule Phoenix.LiveDashboard.ProcessInfoComponent do
defp info(%{links: links} = assigns) when is_list(links) do
~H"""
<%= for info <- @links do %>
<%= info %>
{info}
<% end %>
"""
end

defp info(%{links: _links} = assigns), do: ~H|<%= @links %>|
defp info(%{links: _links} = assigns), do: ~H|{@links}|
end
16 changes: 8 additions & 8 deletions lib/phoenix/live_dashboard/info/socket_info_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ defmodule Phoenix.LiveDashboard.SocketInfoComponent do
<div class="tabular-info">
<%= if @alive do %>
<Phoenix.LiveDashboard.PageBuilder.label_value_list>
<:elem label="Module"><%= @module %></:elem>
<:elem label="Sent"><%= @send_oct %></:elem>
<:elem label="Received"><%= @recv_oct %></:elem>
<:elem label="Local Address"><%= @local_address %></:elem>
<:elem label="Foreign Address"><%= @foreign_address %></:elem>
<:elem label="State"><%= @state %></:elem>
<:elem label="Type"><%= @type %></:elem>
<:elem label="Owner"><%= @connected %></:elem>
<:elem label="Module">{@module}</:elem>
<:elem label="Sent">{@send_oct}</:elem>
<:elem label="Received">{@recv_oct}</:elem>
<:elem label="Local Address">{@local_address}</:elem>
<:elem label="Foreign Address">{@foreign_address}</:elem>
<:elem label="State">{@state}</:elem>
<:elem label="Type">{@type}</:elem>
<:elem label="Owner">{@connected}</:elem>
</Phoenix.LiveDashboard.PageBuilder.label_value_list>
<% else %>
<div class="tabular-info-exits mt-1 mb-3">Port was closed or does not exist.</div>
Expand Down
2 changes: 1 addition & 1 deletion lib/phoenix/live_dashboard/layout_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ defmodule Phoenix.LiveDashboard.LayoutView do

~H"""
<%= for component <- @components do %>
<%= component.(assigns) %>
{component.(assigns)}
<% end %>
"""

Expand Down
Loading

0 comments on commit edfe7d0

Please sign in to comment.