Skip to content

Commit 9030823

Browse files
authored
Changes the alarms to list vertically (#2300)
**From:** <img width="611" height="162" alt="Screenshot 2025-08-22 at 11 44 53 AM" src="https://github.com/user-attachments/assets/3c7d02b7-9484-4d1b-b21c-a38817920e03" /> **To:** <img width="606" height="198" alt="Screenshot 2025-08-22 at 11 45 29 AM" src="https://github.com/user-attachments/assets/049808a2-865f-4fd3-a159-c123b1a8ab5f" />
1 parent 179ebca commit 9030823

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/nerves_hub_web/components/device_page/details_tab.ex

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,11 @@ defmodule NervesHubWeb.Components.DevicePage.DetailsTab do
199199
<div class="text-neutral-50 font-medium leading-6">Alarms</div>
200200
</div>
201201
202-
<div class="flex pt-2 px-4 pb-4 gap-2 items-center">
203-
<div :for={{alarm, description} <- @alarms}>
204-
<div class="flex gap-3 items-center">
205-
<code class="text-sm text-red-500 px-2 py-1 border border-red-500 bg-zinc-800 rounded">{alarm}</code>
206-
<code :if={has_description?(description)}>{description}</code>
207-
</div>
202+
<div class="flex flex-col pt-2 px-4 pb-4 gap-2">
203+
<div :for={{alarm, description} <- @alarms} class="flex gap-3 items-center">
204+
<code class="text-sm text-red-500 px-2 py-1 border border-red-500 bg-zinc-800 rounded">{alarm}</code>
205+
<code :if={has_description?(description)}>{description}</code>
206+
<span :if={!has_description?(description)} class="text-nerves-gray-500">No description</span>
208207
</div>
209208
</div>
210209
@@ -877,6 +876,6 @@ defmodule NervesHubWeb.Components.DevicePage.DetailsTab do
877876
|> Enum.map(&to_string/1)
878877

879878
defp has_description?(description) do
880-
is_binary(description) and byte_size(description) > 0
879+
is_binary(description) and byte_size(description) > 0 and description != "[]"
881880
end
882881
end

0 commit comments

Comments
 (0)