Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show current alarms on device page #1648

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

elinol
Copy link
Contributor

@elinol elinol commented Nov 19, 2024

Display any current alarms for device.
Click on alarm to show description if provided.

Display any current alarms for device.
Click on alarm to show description if provided.
@elinol
Copy link
Contributor Author

elinol commented Nov 19, 2024

image
image
image

lib/nerves_hub_web/live/devices/show.html.heex Outdated Show resolved Hide resolved
lib/nerves_hub_web/live/devices/show.ex Outdated Show resolved Hide resolved
lib/nerves_hub/devices/alarms.ex Outdated Show resolved Hide resolved
Comment on lines +70 to +71
for {alarm, description} <- alarms,
do: {String.trim_leading(alarm, "Elixir."), description}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for {alarm, description} <- alarms,
do: {String.trim_leading(alarm, "Elixir."), description}
for {alarm, description} <- alarms, into: %{},
do: {String.trim_leading(alarm, "Elixir."), description}

I don't know if it matters. I originally thought these were a list, but looks like they are a map. If that's a case, then this would ensure it's placed back into a map

Copy link
Contributor Author

@elinol elinol Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the alarms comes in a map. For current use cases it's fine to pass them on as lists here.

@nshoes nshoes self-requested a review November 21, 2024 00:04
@lawik lawik merged commit 4c7bc0d into nerves-hub:main Nov 21, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants