Skip to content

Commit

Permalink
style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lyang2821 committed Aug 22, 2024
1 parent f90d5f1 commit 03e6e86
Show file tree
Hide file tree
Showing 3 changed files with 161 additions and 156 deletions.
156 changes: 79 additions & 77 deletions lapdev-dashboard/src/audit_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,91 +150,93 @@ pub fn AuditLogView() -> impl IntoView {
<p class="text-gray-700 dark:text-gray-400">{"View your organization's audit logs"}</p>
</div>

<div class="flex flex-row items-center">
<Datepicker value=from_date />
<span class="mx-2">to</span>
<Datepicker value=to_date />
<button
type="button"
class="ml-4 px-4 py-2 text-sm font-medium text-white rounded-lg bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800"
on:click=move |_| get_action.dispatch(())
>
Search
</button>
</div>
{ move || if let Some(error) = error.get() {
view! {
<div class="my-4 p-4 rounded-lg bg-red-50 dark:bg-gray-800 ">
<span class="text-sm font-medium text-red-800 dark:text-red-400">{ error }</span>
</div>
}.into_view()
} else {
view!{}.into_view()
}}

<div class="mt-4 flex flex-row items-center justify-between">
<span class="text-sm font-normal text-gray-500 dark:text-gray-400">
{"Showing "}
<span class="font-semibold text-gray-900 dark:text-white">
{move || format!("{}-{}", audit_logs.with(|a| if a.records.is_empty() {0} else {1} + a.page * a.page_size ), audit_logs.with(|a| if a.records.is_empty() {0} else {a.records.len() as u64} + a.page * a.page_size ))}
</span>
{" of "}
<span class="font-semibold text-gray-900 dark:text-white">{move || audit_logs.with(|a| a.total_items)}</span>
</span>
<div class="pb-8">
<div class="flex flex-row items-center">
<p class="mr-2">{"rows per page"}</p>

<select
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-18 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
on:change=change_page_size
<Datepicker value=from_date />
<span class="mx-2">to</span>
<Datepicker value=to_date />
<button
type="button"
class="ml-4 px-4 py-2 text-sm font-medium text-white rounded-lg bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800"
on:click=move |_| get_action.dispatch(())
>
<option selected>10</option>
<option>20</option>
<option>50</option>
<option>100</option>
<option>200</option>
</select>
Search
</button>
</div>
{ move || if let Some(error) = error.get() {
view! {
<div class="my-4 p-4 rounded-lg bg-red-50 dark:bg-gray-800 ">
<span class="text-sm font-medium text-red-800 dark:text-red-400">{ error }</span>
</div>
}.into_view()
} else {
view!{}.into_view()
}}

<span class="ml-2 p-2 rounded"
class=("text-gray-300", move || audit_logs.with(|a| a.page == 0))
class=("cursor-pointer", move || !audit_logs.with(|a| a.page == 0))
class=("hover:bg-gray-100", move || !audit_logs.with(|a| a.page == 0))
disabled=move || audit_logs.with(|a| a.page == 0)
on:click=prev_page
>
<svg class="w-5 h-5" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd"></path>
</svg>
</span>
<span class="p-2 rounded"
class=("text-gray-300", move || audit_logs.with(|a| a.page + 1 >= a.num_pages))
class=("cursor-pointer", move || !audit_logs.with(|a| a.page + 1 >= a.num_pages))
class=("hover:bg-gray-100", move || !audit_logs.with(|a| a.page + 1 >= a.num_pages))
on:click=next_page
>
<svg class="w-5 h-5" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path>
</svg>
<div class="mt-4 flex flex-row items-center justify-between">
<span class="text-sm font-normal text-gray-500 dark:text-gray-400">
{"Showing "}
<span class="font-semibold text-gray-900 dark:text-white">
{move || format!("{}-{}", audit_logs.with(|a| if a.records.is_empty() {0} else {1} + a.page * a.page_size ), audit_logs.with(|a| if a.records.is_empty() {0} else {a.records.len() as u64} + a.page * a.page_size ))}
</span>
{" of "}
<span class="font-semibold text-gray-900 dark:text-white">{move || audit_logs.with(|a| a.total_items)}</span>
</span>
<div class="flex flex-row items-center">
<p class="mr-2">{"rows per page"}</p>

<select
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-18 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
on:change=change_page_size
>
<option selected>10</option>
<option>20</option>
<option>50</option>
<option>100</option>
<option>200</option>
</select>

<span class="ml-2 p-2 rounded"
class=("text-gray-300", move || audit_logs.with(|a| a.page == 0))
class=("cursor-pointer", move || !audit_logs.with(|a| a.page == 0))
class=("hover:bg-gray-100", move || !audit_logs.with(|a| a.page == 0))
disabled=move || audit_logs.with(|a| a.page == 0)
on:click=prev_page
>
<svg class="w-5 h-5" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd"></path>
</svg>
</span>
<span class="p-2 rounded"
class=("text-gray-300", move || audit_logs.with(|a| a.page + 1 >= a.num_pages))
class=("cursor-pointer", move || !audit_logs.with(|a| a.page + 1 >= a.num_pages))
class=("hover:bg-gray-100", move || !audit_logs.with(|a| a.page + 1 >= a.num_pages))
on:click=next_page
>
<svg class="w-5 h-5" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path>
</svg>
</span>
</div>
</div>
</div>

<div class="mt-2 flex items-center w-full px-4 py-2 text-gray-900 dark:text-white bg-gray-50 dark:bg-gray-700">
<span class="w-1/4 truncate">Time</span>
<span class="w-1/4 truncate">User</span>
<span class="w-1/4 truncate">Action</span>
<span class="w-1/4 truncate">Resource</span>
</div>
<div class="mt-2 flex items-center w-full px-4 py-2 text-gray-900 dark:text-white bg-gray-50 dark:bg-gray-700">
<span class="w-1/4 truncate">Time</span>
<span class="w-1/4 truncate">User</span>
<span class="w-1/4 truncate">Action</span>
<span class="w-1/4 truncate">Resource</span>
</div>

<For
each=move || audit_logs.get().records.into_iter().enumerate()
key=|(_, a)| a.id
children=move |(i, record)| {
view! {
<RecordItemView i record />
<For
each=move || audit_logs.get().records.into_iter().enumerate()
key=|(_, a)| a.id
children=move |(i, record)| {
view! {
<RecordItemView i record />
}
}
}
/>
/>
</div>
}
}

Expand Down
2 changes: 1 addition & 1 deletion lapdev-dashboard/src/organization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ pub fn DeleteOrgModal(
}
}
<div class="text-left">
<p>{"1. You'll lose all the projects in this organization and this cannot be restored."}</p>
<p>{"1. You'll lose all the projects and workspaces in this organization and this cannot be restored."}</p>
<p>{"2. All organization members will lose access to this organization and all the associated workspaces."}</p>
</div>
<p class="mt-4 text-left">
Expand Down
Loading

0 comments on commit 03e6e86

Please sign in to comment.