init
This commit is contained in:
44
lib/webmon_web/live/website_live/index.html.heex
Normal file
44
lib/webmon_web/live/website_live/index.html.heex
Normal file
@ -0,0 +1,44 @@
|
||||
<.header>
|
||||
Listing Websites
|
||||
<:actions>
|
||||
<.link patch={~p"/websites/new"}>
|
||||
<.button>New Website</.button>
|
||||
</.link>
|
||||
</:actions>
|
||||
</.header>
|
||||
|
||||
<.table
|
||||
id="websites"
|
||||
rows={@streams.websites}
|
||||
row_click={fn {_id, website} -> JS.navigate(~p"/websites/#{website}") end}
|
||||
>
|
||||
<:col :let={{_id, website}} label="Name"><%= website.name %></:col>
|
||||
<:col :let={{_id, website}} label="Url"><%= website.url %></:col>
|
||||
<:col :let={{_id, website}} label="Status"><.website_status website={website} /></:col>
|
||||
|
||||
<:action :let={{_id, website}}>
|
||||
<div class="sr-only">
|
||||
<.link navigate={~p"/websites/#{website}"}>Show</.link>
|
||||
</div>
|
||||
<.link patch={~p"/websites/#{website}/edit"}>Edit</.link>
|
||||
</:action>
|
||||
<:action :let={{id, website}}>
|
||||
<.link
|
||||
phx-click={JS.push("delete", value: %{id: website.id}) |> hide("##{id}")}
|
||||
data-confirm="Are you sure?"
|
||||
>
|
||||
Delete
|
||||
</.link>
|
||||
</:action>
|
||||
</.table>
|
||||
|
||||
<.modal :if={@live_action in [:new, :edit]} id="website-modal" show on_cancel={JS.patch(~p"/websites")}>
|
||||
<.live_component
|
||||
module={WebmonWeb.WebsiteLive.FormComponent}
|
||||
id={@website.id || :new}
|
||||
title={@page_title}
|
||||
action={@live_action}
|
||||
website={@website}
|
||||
patch={~p"/websites"}
|
||||
/>
|
||||
</.modal>
|
Reference in New Issue
Block a user