-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Lo-Fi system status widget
- Loading branch information
1 parent
c7e9dee
commit 5a94b4e
Showing
2 changed files
with
43 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
defmodule DotcomWeb.SystemStatus.Widget do | ||
use DotcomWeb, :live_view | ||
|
||
def system_status_widget(assigns) do | ||
~H""" | ||
<div class="flex flex-col gap-2"> | ||
<.status_entry | ||
:for={status <- @statuses} | ||
status={status} | ||
route_id={status.route_id} | ||
sub_routes={status.sub_routes} | ||
statuses={status.statuses} | ||
/> | ||
</div> | ||
""" | ||
end | ||
|
||
defp status_entry(assigns) do | ||
~H""" | ||
<details class="border border-gray-lighter p-2"> | ||
<summary class="flex gap-2"> | ||
<span class="font-bold"> | ||
{@route_id}<span :for={sub_route <- @sub_routes}>{" "}{sub_route}</span>: | ||
</span> | ||
<span class="flex flex-col"> | ||
<div :for={status <- @statuses}> | ||
{status.description} | ||
</div> | ||
</span> | ||
</summary> | ||
<pre>{inspect @status, pretty: true}</pre> | ||
</details> | ||
""" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters