✨feature: Add button for single domain page
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
// Helper function to format date
|
||||
function formatDate(dateString) {
|
||||
let date = new Date(dateString);
|
||||
return date.toLocaleString('en-US', {
|
||||
return date.toLocaleString('en-CA', {
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
day: 'numeric',
|
||||
hour: '2-digit',
|
||||
hour: 'numeric',
|
||||
minute: '2-digit'
|
||||
});
|
||||
}
|
||||
@@ -25,20 +25,24 @@ data.forEach(item => {
|
||||
|
||||
<div class="card-container grid gap-6 grid-cols-1 md:grid-cols-3 lg:grid-cols-4">
|
||||
<% Object.keys(groupedDomains).forEach(domain => { %>
|
||||
<% // Sort entries by created_at descending and limit to 5
|
||||
let sortedEntries=groupedDomains[domain]
|
||||
.sort((a, b) => new Date(b.created_at) - new Date(a.created_at))
|
||||
.slice(0, 5);
|
||||
<%
|
||||
// Sort entries by created_at descending and limit to 5
|
||||
let sortedEntries=groupedDomains[domain]
|
||||
.sort((a, b) => new Date(b.created_at) - new Date(a.created_at))
|
||||
.slice(0, 5);
|
||||
%>
|
||||
<div class="card w-fit bg-base-100 card-lg shadow-sm">
|
||||
<div class="card w-full bg-base-100 card-lg shadow-sm">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title"><%= domain %></h2>
|
||||
<% sortedEntries.forEach(entry => { %>
|
||||
<div class="flex">
|
||||
<p class="w-fit px-4 font-normal"><%= entry.id %></p>
|
||||
<p class="flex-grow-1 font-normal"><%= formatDate(entry.created_at) %></p>
|
||||
<div class="flex font-normal">
|
||||
<p class="w-fit"><%= entry.id %></p>
|
||||
<p class="flex-grow-1"><%= formatDate(entry.created_at) %></p>
|
||||
</div>
|
||||
<% }) %>
|
||||
<div class="card-actions justify-end">
|
||||
<a href="/sites/<%= domain %>" class="btn btn-info hover:text-white!">View All Tests</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% }) %>
|
||||
|
||||
Reference in New Issue
Block a user