Files
2025-01-23 10:43:16 -05:00

87 lines
2.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Admin Panel</title>
<link rel="favicon" href="templates/favicon.ico">
<style>
table {
width: 100%;
border-collapse: collapse;
font-family: Arial, sans-serif;
margin: 20px 0;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
th, td {
padding: 12px 15px;
text-align: left;
}
th {
background-color: #2f1349;
color: white;
font-weight: bold;
}
/*tr:nth-child(even) {
} */
tr:hover {
background-color: #e9e9e9;
}
a {
text-decoration: none;
color: #007bff;
padding: 8px 12px;
border-radius: 4px;
background-color: #f1f1f1;
transition: background-color 0.3s ease;
margin: 5px;
display: inline-block;
}
a:hover {
background-color: #ddd;
}
</style>
</head>
<body>
<table>
<tr>
<th>Name</th>
<th>Serials</th>
<th>Actions</th>
</tr>
{% for entry in entries %}
<tr>
<td>{{ entry.name }}</td>
<td><b>SD:</b> {{ entry.sdserial }} <b>NAND:</b> {{ entry.nandserial }} <b>inspect.log:</b> {{ entry.twlnserial }} <b>SecureInfo:</b> {{ entry.secinfoserial }}<b>Date:</b> <span class="date-timestamp">{{ entry.date }}</span></td>
<td><a href="{{ entry.retrieveurl }}">Download</a> <a href="{{ entry.deleteurl }}" class="delete-link">Delete</a></td>
</tr>
{% endfor %}
</table>
</body>
<script>
document.querySelectorAll(".date-timestamp").forEach(e => e.textContent = new Date(parseInt(e.textContent)*1000));
// Select all elements with the class 'delete-link'
const deleteLinks = document.querySelectorAll('.delete-link');
// Add a click event listener to each delete link
deleteLinks.forEach(link => {
link.addEventListener('click', function(event) {
// Show a confirmation box
const confirmDelete = confirm('Are you sure you want to delete this item?');
// If the user clicks "Cancel", prevent the link from being followed
if (!confirmDelete) {
event.preventDefault();
}
});
});
</script>
</html>