- Add authenticated layout with navigation to equipment/site forms and show pages - Remove remaining DaisyUI classes from detail pages - Update buttons to use proper component variants - Ensure consistent styling across all authenticated pages
42 lines
1.3 KiB
Text
42 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>
|