- Add LiveView tests for DashboardLive, AlertLive, SiteLive, EquipmentLive, OrgLive - Add comprehensive tests for Organizations context (memberships, invitations, auth) - Add tests for AlertNotifier email delivery - Improve test coverage from 54.78% to 86.65% - Add 101 new tests (256 total tests)
44 lines
1.3 KiB
Text
44 lines
1.3 KiB
Text
<Layouts.authenticated flash={@flash} current_organization={@organization}>
|
|
<.header>
|
|
{@page_title}
|
|
<:subtitle>
|
|
{if @live_action == :new,
|
|
do: "Add new equipment to monitor",
|
|
else: "Update equipment details"}
|
|
</:subtitle>
|
|
</.header>
|
|
|
|
<div class="max-w-2xl">
|
|
<.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 />
|
|
|
|
<.input
|
|
field={@form[:site_id]}
|
|
type="select"
|
|
label="Site"
|
|
required
|
|
prompt="Select a site"
|
|
options={Enum.map(@available_sites, &{&1.name, &1.id})}
|
|
/>
|
|
|
|
<.input field={@form[:description]} type="textarea" label="Description" />
|
|
|
|
<.input
|
|
field={@form[:check_interval_seconds]}
|
|
type="number"
|
|
label="Check Interval (seconds)"
|
|
min="30"
|
|
max="3600"
|
|
/>
|
|
|
|
<.input field={@form[:monitoring_enabled]} type="checkbox" label="Enable Monitoring" />
|
|
|
|
<div class="flex gap-3 mt-6">
|
|
<.button phx-disable-with="Saving..." variant="primary">Save Equipment</.button>
|
|
<.button navigate={~p"/orgs/#{@organization.slug}/equipment"}>Cancel</.button>
|
|
</div>
|
|
</.form>
|
|
</div>
|
|
</Layouts.authenticated>
|