diff --git a/lib/towerops_web/live/equipment_live/form.html.heex b/lib/towerops_web/live/equipment_live/form.html.heex index 05d093fd..fda437af 100644 --- a/lib/towerops_web/live/equipment_live/form.html.heex +++ b/lib/towerops_web/live/equipment_live/form.html.heex @@ -1,13 +1,13 @@ -<.header> - {@page_title} - <:subtitle> - {if @live_action == :new, do: "Add new equipment to monitor", else: "Update equipment details"} - - + + <.header> + {@page_title} + <:subtitle> + {if @live_action == :new, do: "Add new equipment to monitor", else: "Update equipment details"} + + -
- <.form for={@form} id="equipment-form" phx-change="validate" phx-submit="save"> -
+
+ <.form for={@form} id="equipment-form" phx-change="validate" phx-submit="save"> <.input field={@form[:name]} type="text" label="Equipment Name" required /> <.input field={@form[:ip_address]} type="text" label="IP Address" required /> @@ -33,10 +33,10 @@ <.input field={@form[:monitoring_enabled]} type="checkbox" label="Enable Monitoring" /> -
- <.button phx-disable-with="Saving...">Save Equipment - <.link navigate={~p"/orgs/#{@organization.slug}/equipment"} class="btn">Cancel +
+ <.button phx-disable-with="Saving..." variant="primary">Save Equipment + <.button navigate={~p"/orgs/#{@organization.slug}/equipment"}>Cancel
-
- -
+ +
+ diff --git a/lib/towerops_web/live/equipment_live/show.html.heex b/lib/towerops_web/live/equipment_live/show.html.heex index 60e683e1..98ff22a5 100644 --- a/lib/towerops_web/live/equipment_live/show.html.heex +++ b/lib/towerops_web/live/equipment_live/show.html.heex @@ -1,150 +1,154 @@ -<.header> - {@page_title} - <:subtitle>{@equipment.ip_address} - <:actions> - <.button phx-click="trigger_check" class="btn-sm btn-primary"> - <.icon name="hero-arrow-path" class="w-4 h-4" /> Check Now - - <.link - navigate={~p"/orgs/#{@current_organization.slug}/equipment/#{@equipment.id}/edit"} - class="btn btn-sm" - > - <.icon name="hero-pencil" class="w-4 h-4" /> Edit - - <.button phx-click="delete" data-confirm="Are you sure?" class="btn-error btn-sm"> - <.icon name="hero-trash" class="w-4 h-4" /> Delete - - - + + <.header> + {@page_title} + <:subtitle>{@equipment.ip_address} + <:actions> + <.button phx-click="trigger_check" variant="primary"> + <.icon name="hero-arrow-path" class="h-4 w-4" /> Check Now + + <.button navigate={~p"/orgs/#{@current_organization.slug}/equipment/#{@equipment.id}/edit"}> + <.icon name="hero-pencil" class="h-4 w-4" /> Edit + + <.button + phx-click="delete" + data-confirm="Are you sure?" + class="bg-red-600 text-white hover:bg-red-700 focus:ring-red-500 dark:bg-red-500 dark:hover:bg-red-600" + > + <.icon name="hero-trash" class="h-4 w-4" /> Delete + + + -
-
-

Equipment Details

-
-
-
Status
-
- - {@equipment.status |> to_string() |> String.upcase()} - -
-
- -
-
Site
-
- <.link - navigate={~p"/orgs/#{@current_organization.slug}/sites/#{@equipment.site.id}"} - class="link link-primary" - > - {@equipment.site.name} - -
-
- -
-
IP Address
-
{@equipment.ip_address}
-
- - <%= if @equipment.description do %> +
+
+

+ Equipment Details +

+
-
Description
-
{@equipment.description}
+
Status
+
+ + {@equipment.status |> to_string() |> String.upcase()} + +
- <% end %> -
-
Monitoring
-
- <%= if @equipment.monitoring_enabled do %> - Enabled - <% else %> - Disabled - <% end %> -
-
+
+
Site
+
+ <.link + navigate={~p"/orgs/#{@current_organization.slug}/sites/#{@equipment.site.id}"} + class="text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300" + > + {@equipment.site.name} + +
+
-
-
Check Interval
-
{@equipment.check_interval_seconds} seconds
-
-
+
+
IP Address
+
{@equipment.ip_address}
+
+ + <%= if @equipment.description do %> +
+
Description
+
{@equipment.description}
+
+ <% end %> + +
+
Monitoring
+
+ <%= if @equipment.monitoring_enabled do %> + + Enabled + + <% else %> + + Disabled + + <% end %> +
+
+ +
+
Check Interval
+
+ {@equipment.check_interval_seconds} seconds +
+
+
+
+ +
+

+ Monitoring History +

+
+
+
Last Checked
+
+ <%= if @equipment.last_checked_at do %> + {Calendar.strftime(@equipment.last_checked_at, "%Y-%m-%d %H:%M:%S UTC")} + <% else %> + Never + <% end %> +
+
+ +
+
Last Status Change
+
+ <%= if @equipment.last_status_change_at do %> + {Calendar.strftime(@equipment.last_status_change_at, "%Y-%m-%d %H:%M:%S UTC")} + <% else %> + Never + <% end %> +
+
+
+
-
-

Monitoring History

-
-
-
Last Checked
-
- <%= if @equipment.last_checked_at do %> - {Calendar.strftime(@equipment.last_checked_at, "%Y-%m-%d %H:%M:%S UTC")} - <% else %> - Never - <% end %> -
+
+

Recent Checks

+ <%= if Enum.empty?(@recent_checks) do %> +
+ No monitoring checks yet
- -
-
Last Status Change
-
- <%= if @equipment.last_status_change_at do %> - {Calendar.strftime(@equipment.last_status_change_at, "%Y-%m-%d %H:%M:%S UTC")} + <% else %> + <.table id="recent-checks" rows={@recent_checks}> + <:col :let={check} label="Status"> + + {check.status |> to_string() |> String.upcase()} + + + <:col :let={check} label="Response Time"> + <%= if check.response_time_ms do %> + {check.response_time_ms}ms <% else %> - Never + - <% end %> -
-
-
+ + <:col :let={check} label="Checked At"> + {Calendar.strftime(check.checked_at, "%Y-%m-%d %H:%M:%S UTC")} + + + <% end %>
-
- -
-

Recent Checks

- <%= if Enum.empty?(@recent_checks) do %> -
- No monitoring checks yet -
- <% else %> -
- - - - - - - - - - <%= for check <- @recent_checks do %> - - - - - - <% end %> - -
StatusResponse TimeChecked At
- - {check.status |> to_string() |> String.upcase()} - - - <%= if check.response_time_ms do %> - {check.response_time_ms}ms - <% else %> - - - <% end %> - {Calendar.strftime(check.checked_at, "%Y-%m-%d %H:%M:%S UTC")}
-
- <% end %> -
+
diff --git a/lib/towerops_web/live/site_live/form.html.heex b/lib/towerops_web/live/site_live/form.html.heex index 85c87d4a..57755ac3 100644 --- a/lib/towerops_web/live/site_live/form.html.heex +++ b/lib/towerops_web/live/site_live/form.html.heex @@ -1,15 +1,15 @@ -<.header> - {@page_title} - <:subtitle> - {if @live_action == :new, - do: "Add a new site to your organization", - else: "Update site details"} - - + + <.header> + {@page_title} + <:subtitle> + {if @live_action == :new, + do: "Add a new site to your organization", + else: "Update site details"} + + -
- <.form for={@form} id="site-form" phx-change="validate" phx-submit="save"> -
+
+ <.form for={@form} id="site-form" phx-change="validate" phx-submit="save"> <.input field={@form[:name]} type="text" label="Site Name" required /> <.input @@ -24,10 +24,10 @@ <.input field={@form[:description]} type="textarea" label="Description" /> -
- <.button phx-disable-with="Saving...">Save Site - <.link navigate={~p"/orgs/#{@organization.slug}/sites"} class="btn">Cancel +
+ <.button phx-disable-with="Saving..." variant="primary">Save Site + <.button navigate={~p"/orgs/#{@organization.slug}/sites"}>Cancel
-
- -
+ +
+ diff --git a/lib/towerops_web/live/site_live/show.html.heex b/lib/towerops_web/live/site_live/show.html.heex index c7603997..3f6001dc 100644 --- a/lib/towerops_web/live/site_live/show.html.heex +++ b/lib/towerops_web/live/site_live/show.html.heex @@ -1,108 +1,110 @@ -<.header> - {@page_title} - <:subtitle>{@site.location} - <:actions> - <.link - navigate={~p"/orgs/#{@current_organization.slug}/sites/#{@site.id}/edit"} - class="btn btn-sm" - > - <.icon name="hero-pencil" class="w-4 h-4" /> Edit - - <.button phx-click="delete" data-confirm="Are you sure?" class="btn-error btn-sm"> - <.icon name="hero-trash" class="w-4 h-4" /> Delete - - - - -
-
-

Site Details

-
- <%= if @site.parent_site do %> -
-
Parent Site
-
- <.link - navigate={~p"/orgs/#{@current_organization.slug}/sites/#{@site.parent_site.id}"} - class="link link-primary" - > - {@site.parent_site.name} - -
-
- <% end %> - <%= if @site.location do %> -
-
Location
-
{@site.location}
-
- <% end %> - <%= if @site.description do %> -
-
Description
-
{@site.description}
-
- <% end %> -
- - <%= if @site.child_sites != [] do %> -
-

Child Sites

-
    -
  • - <.link - navigate={~p"/orgs/#{@current_organization.slug}/sites/#{child.id}"} - class="link link-primary text-sm" - > - {child.name} - -
  • -
-
- <% end %> -
- -
-
-

Equipment

- <.link - navigate={~p"/orgs/#{@current_organization.slug}/equipment/new?site_id=#{@site.id}"} - class="btn btn-sm btn-primary" + + <.header> + {@page_title} + <:subtitle>{@site.location} + <:actions> + <.button navigate={~p"/orgs/#{@current_organization.slug}/sites/#{@site.id}/edit"}> + <.icon name="hero-pencil" class="h-4 w-4" /> Edit + + <.button + phx-click="delete" + data-confirm="Are you sure?" + class="bg-red-600 text-white hover:bg-red-700 focus:ring-red-500 dark:bg-red-500 dark:hover:bg-red-600" > - <.icon name="hero-plus" class="w-4 h-4" /> Add Equipment - + <.icon name="hero-trash" class="h-4 w-4" /> Delete + + + + +
+
+

Site Details

+
+ <%= if @site.parent_site do %> +
+
Parent Site
+
+ <.link + navigate={~p"/orgs/#{@current_organization.slug}/sites/#{@site.parent_site.id}"} + class="text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300" + > + {@site.parent_site.name} + +
+
+ <% end %> + <%= if @site.location do %> +
+
Location
+
{@site.location}
+
+ <% end %> + <%= if @site.description do %> +
+
Description
+
{@site.description}
+
+ <% end %> +
+ + <%= if @site.child_sites != [] do %> +
+

Child Sites

+
    +
  • + <.link + navigate={~p"/orgs/#{@current_organization.slug}/sites/#{child.id}"} + class="text-sm text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300" + > + {child.name} + +
  • +
+
+ <% end %>
- <%= if @equipment == [] do %> -

No equipment at this site yet.

- <% else %> -
-
+
+

Equipment

+ <.button + navigate={~p"/orgs/#{@current_organization.slug}/equipment/new?site_id=#{@site.id}"} + variant="primary" > -
-

{eq.name}

-

{eq.ip_address}

-
-
- - {eq.status |> to_string() |> String.upcase()} - - <.link - navigate={~p"/orgs/#{@current_organization.slug}/equipment/#{eq.id}"} - class="btn btn-xs" - > - View - + <.icon name="hero-plus" class="h-4 w-4" /> Add Equipment + +
+ + <%= if @equipment == [] do %> +

No equipment at this site yet.

+ <% else %> +
+
+
+

{eq.name}

+

{eq.ip_address}

+
+
+ + {eq.status |> to_string() |> String.upcase()} + + <.button navigate={~p"/orgs/#{@current_organization.slug}/equipment/#{eq.id}"}> + View + +
-
- <% end %> + <% end %> +
-
+